Transcript
Page 1: What you need to remember when you upload to CPAN

Perlのモジュールを公開するときに

気をつけておいた方がよい**個のこと

Kenichi Ishigaki

(@charsbar)

YAPC::Asia 2013

Sep 20, 2013

Page 2: What you need to remember when you upload to CPAN

Have you ever

uploaded anything

to CPAN?

Page 3: What you need to remember when you upload to CPAN

Part I

When you upload

a distribution...

Page 4: What you need to remember when you upload to CPAN

An uploaded

distribution is

placed like this,

(CPAN root)/authors/id/P/PA/PAUSEID/Distribution-1.00.tar.gz

Page 5: What you need to remember when you upload to CPAN

indexed if necessary,

Page 6: What you need to remember when you upload to CPAN

mirrored,

(CPAN is the Comprehensive Perl Archive Network)

Page 7: What you need to remember when you upload to CPAN

announced, tested,

and more ...

Page 8: What you need to remember when you upload to CPAN

even if you try to

delete it.

Page 9: What you need to remember when you upload to CPAN

What's done is

done and stays in

BackPAN.

Page 10: What you need to remember when you upload to CPAN

PAUSE/CPAN also accepts

(almost) everything.

Page 11: What you need to remember when you upload to CPAN

Be prepared

before you upload.

http://www.cpan.org/modules/04pause.html

Page 12: What you need to remember when you upload to CPAN

Part II

CPAN Testing Services

Page 13: What you need to remember when you upload to CPAN

There are several testing

services to improve CPAN.

• PAUSE (kind of)

• CPAN Testers

• CPANTS

• CPAN::Changes Kwalitee Service

• CPAN Coverage report

• and (maybe) more...

Page 14: What you need to remember when you upload to CPAN

PAUSE

• https://pause.perl.org/

• sees if a distribution extracts

nicely and is safe.

• authorizes packages.

• sends you emails when packages

are indexed or errors are found.

Page 15: What you need to remember when you upload to CPAN

CPAN Testers • http://www.cpantesters.org/

• gathers reports from testers under

various environments.

• sends you emails about fail reports

(if requested).

• provides rss feeds for each

author/distribution.

• welcomes donation:

https://members.enlightenedperl.org/

drupal/donate-cpan-testers

Page 16: What you need to remember when you upload to CPAN

CPANTS

• http://cpants.cpanauthors.org/

• sees various aspects of a

distribution.

• sends no email (yet)

• provides rss feeds for each author.

Page 17: What you need to remember when you upload to CPAN

CPAN::Changes

Kwalitee Service

• http://changes.cpanhq.org/

• sees the format of a Changes file.

• provides rss feeds for each

author/distribution.

Page 18: What you need to remember when you upload to CPAN

CPAN Coverage Report

• http://cpancover.com/

• sees the coverage of a distribution

(by Devel::Cover)

Page 19: What you need to remember when you upload to CPAN

An example of making

use of them (by RJBS)

• http://rjbs.manxome.org/rubric/entry/2007

• http://rjbs.manxome.org/rubric/entry/2010

• https://github.com/rjbs/misc/blob/master/code-review

Page 20: What you need to remember when you upload to CPAN

Part III

Kwalitee in depth

Page 21: What you need to remember when you upload to CPAN

There are 44 metrics.

• 30 core, 9 extra, and 5 experimental

(as of ver 0.91)

• 6 added, 12 removed

(at/after the QA hackathon)

Page 22: What you need to remember when you upload to CPAN

Many of them are

based on the past

toolchain issues.

Page 23: What you need to remember when you upload to CPAN

http://weblog.bulknews.net/post/33907905561

Page 24: What you need to remember when you upload to CPAN

http://cpants.cpanauthors.org/kwalitee/no_broken_module_install

Page 25: What you need to remember when you upload to CPAN

http://cpants.cpanauthors.org/stats/module_install

Page 26: What you need to remember when you upload to CPAN

http://weblog.bulknews.net/post/44251476706

Page 27: What you need to remember when you upload to CPAN

http://cpants.cpanauthors.org/kwalitee/no_mymeta_files

Page 28: What you need to remember when you upload to CPAN

We can't remember

everything.

Let CPANTS remember for the rest of us!

Page 29: What you need to remember when you upload to CPAN

Metrics on availability

• extractable

• extracts_nicely

• no_pax_headers

• portable_filenames

• no_dot_underscore_files

• no_symlinks

Page 30: What you need to remember when you upload to CPAN

• Use short, alphanumeric-only

names.

• Avoid links.

• COPYFILE_DISABLE=1 (Mac OS X)

• Use GNU tar.

• See if Archive::Tar (ptar) can

extract your distribution.

Page 31: What you need to remember when you upload to CPAN

Metrics on integrity

• has_manifest

• manifest_mathces_dist

• valid_signature

• no_mymeta_files

• no_generated_files

Page 32: What you need to remember when you upload to CPAN

• Update MANIFEST.SKIP if

exists.

• Update MANIFEST, or let

it be generated.

• Update .gitignore if

exists.

Page 33: What you need to remember when you upload to CPAN

Metrics on file layout

• has_readme

• has_changelog

• has_tests

• has_tests_in_t_dir

(optional)

• proper_libs (optional)

Page 34: What you need to remember when you upload to CPAN

• Use some generators.

• Minilla, Milla, Dist::Zilla

• pmsetup, Module::Setup

Page 35: What you need to remember when you upload to CPAN

Metrics on build tool

• has_buildtool

• buildtool_not_executable

• no_broken_module_install

• no_broken_auto_install

• no_stdin_for_prompting

(optional)

Page 36: What you need to remember when you upload to CPAN

• Avoid Module::Install.

• Avoid prompting for smooth

installation.

• Release from non-Windows

environment if possible.

Page 37: What you need to remember when you upload to CPAN

Metrics on META

• has_meta_yml

• metayml_is_parsable

• metayml_conforms_to_known_spec

• metayml_conforms_spec_current

(optional)

• metayml_declares_perl_version

(optional)

• metayml_has_provides (experimental)

Page 38: What you need to remember when you upload to CPAN

• Don't edit it by hand.

• META.yml and META.json may (often)

be generated differently.

• See specs when necessary.

http://module-build.sourceforge.net/META-spec-v1.4.html

http://search.cpan.org/perldoc?CPAN::Meta::Spec

Page 39: What you need to remember when you upload to CPAN

Stats on META generators

http://cpants.cpanauthors.org/stats/meta_generator

Page 40: What you need to remember when you upload to CPAN

Stats on META generator users

Page 41: What you need to remember when you upload to CPAN

Metrics on license

• has_human_readable_license

• has_license_in_source

• metayml_has_license

(optional)

• has_separate_license_file

(experimental)

Page 42: What you need to remember when you upload to CPAN

• Write explicitly (and machine-

readably if possible) about license.

• Adding a LICENSE file is a good idea.

(Fedora/Debian package managers

would like you.)

• You still need to tweak WriteMakefile

to support perl < 5.8.9.

Page 43: What you need to remember when you upload to CPAN

Metrics on versions

• has_version

• has_proper_version

• consistent_version

• package_version_matches_dist_version

Page 44: What you need to remember when you upload to CPAN

• Don't remove versions

from packages (which

would cause version

downgrade).

• Bump up inconsistent

versions to the highest.

Page 45: What you need to remember when you upload to CPAN

Metrics on prerequisites

• prereq_matches_use

• build_prereq_matches_use

(optional)

• is_prereq (optional)

Page 46: What you need to remember when you upload to CPAN

• Don't take these metrics too

seriously (especially when

you do something clever).

• dynamic_config may (or

may not) be your friend.

Page 47: What you need to remember when you upload to CPAN

Metrics on strictness

• use_strict

• use_warnings (optional)

Page 48: What you need to remember when you upload to CPAN

• Just use them, or their

well-known equivalents

(like Moose and its

friends).

• If you want to do

something clever,

document it as well.

Page 49: What you need to remember when you upload to CPAN

Metrics on pod

• no_pod_errors

Page 50: What you need to remember when you upload to CPAN

• Update Pod::Simple to

find issues.

• Test::Pod and

Test::Pod::Coverage are

still your friends.

Page 51: What you need to remember when you upload to CPAN

Metrics on repackaging

• easily_repackageable_by_debian

(experimental)

• easily_repackageable_by_fedora

(experimental)

• fits_fedora_license (experimental)

Page 52: What you need to remember when you upload to CPAN

• Nothing to remember.

These are not for you.

Page 53: What you need to remember when you upload to CPAN

Too much to

remember?

Page 54: What you need to remember when you upload to CPAN

The bottom line:

use better tools • made by those who have a

good knowledge of the issues.

https://github.com/Perl-Toolchain-Gang?tab=members

http://qa-hackathon.org/reviews.html

Page 55: What you need to remember when you upload to CPAN

Questions?

Page 56: What you need to remember when you upload to CPAN

Thank you

Page 57: What you need to remember when you upload to CPAN

bonus track

Page 58: What you need to remember when you upload to CPAN

Part IV

Using CPANTS

Page 59: What you need to remember when you upload to CPAN

Test::Kwalitee(::Extra)

• uses CPANTS analyzer

against local files

(though the analyzer is

made for a prepared

distribution).

Page 60: What you need to remember when you upload to CPAN

Subscribing CPANTS Feeds

http://cpants.cpanauthors.org/author/ID/feed

Page 61: What you need to remember when you upload to CPAN

Want raw data?

Add .json to urls.

(What's in JSON response may (often) change.)

Page 62: What you need to remember when you upload to CPAN

Want status icons?

http://cpants.cpanauthors.org/author/ID.png

http://cpants.cpanauthors.org/dist/Name.png

Page 63: What you need to remember when you upload to CPAN

Part V

When you find something is

broken or unimplemented

Page 64: What you need to remember when you upload to CPAN

CPANTS repositories

• https://github.com/cpants/Module-CPANTS-Analyse

• https://github.com/cpants/Module-CPANTS-SiteKwalitee

• https://github.com/cpants/www-cpants

Page 65: What you need to remember when you upload to CPAN

Other related repositories

that may have a big impact.

• https://github.com/domm/Module-ExtractUse

• https://github.com/rjbs/Software-License

• https://github.com/Perl-Toolchain-Gang/CPAN-Meta

• https://github.com/charsbar/Parse-PMFile

Page 66: What you need to remember when you upload to CPAN

Thank you