in reply to My Perl Module Toolchain

Just for contrast, here is my process. Again, it is just what works for me, without any guarantee that it will work the same for you:

Starting a project

Usually, I start a project by starting with an empty directory, in which I usually only create bin/ and lib/ directories, together with (eventually) scripts and modules. The t/ directory of tests only gets filled with tests once I have stumbled upon a tricky part of code where I think that tests will help me to formalize the results and/or the API even where the existing program in bin/ does not.

Makefile.PL

Once a module goes "to release", that is, gets installed on any other machine, I like to list all dependencies and use cpan . (or cpanm) to install these prerequisites. I use a Makefile.PL from my other modules and change it to fit the distribution at hand. Usually at the same time, I copy the "boilerplate" tests 99-* which check for POD wellformedness, version number consistency, line endings consistency and some other technicalities. Also the "boilerplate" MANIFEST.skip and .gitignore get copied and customized. Usually, this is the moment when I check the whole tree into source control, git in my case.

Releasing

I cobbled a shell script together that does a full test suite run from the git repository checkout, uploads the tarball to CPAN, and then pushes the tree and tag to github. It's based on Module::Release (resp. the included release script) doing the heavy lifting of running the test suite, checking that the checkout is recent etc.:

#!/bin/bash if [ -d .git ]; then git checkout -f fi rm *.tar.gz rm *.tar /opt/perl/bin/release_corion -k -p if [[ $? -ne 0 ]]; then echo "Some error, not pushing ($?)" exit fi if [[ -d .git ]]; then for REMOTE in $(git remote); do git push $REMOTE --tags && git push $REMOTE --all done fi

Replies are listed 'Best First'.
Re^2: My Perl Module Toolchain
by Tux (Canon) on May 28, 2012 at 09:50 UTC

    Module::Release' release will support wildcards when you have multiple versions of perl to test against. This is very useful when you have threaded and unthreaded perls, 64bitall and/or 64bitint and/or longdouble supported perl releases installed. I have now 111 versions of perl available on my external disk ranging from 5.003_07 to 5.17.0. Picking the versions that ought to be supported by your module could be something like this:

    $ cat .releaserc cpan_user HMBRAND automated_testing 1 skip_kwalitee 1 skip_manifest 1 skip_prereqs 1 allow_glob_in_perls 1 perls /pro/bin/perl:/pro/bin/perl5.00504:/usr/bin/perl:/media/Tux/perl +s/bin/perl5.6.2:/media/Tux/perls/bin/perl5.8.*:/media/Tux/perls/bin/p +erl5.1[024567]*:/media/Tux/perls/bin/tperl5.6.2:/media/Tux/perls/bin/ +tperl5.8.*:/media/Tux/perls/bin/tperl5.1[024567]* $

    I explicitely disable the quality checks for release as most of the modules that are needed for those are only installed in my "normal" perl and not in the test set so release would fail. I run the quality tests using Module::CPANTS::Kwalitee's cpants_lint.pl after release is done.

    My Makefile.PL contains a special target "tgzdist", which checks spelling, dependency versions, minimal (declared) perl version and more:

    Text-CSV_XS $ make tgzdist pod-spell-check --aspell --ispell ok 1 - CSV_XS.pm ok 2 - sandbox/genMETA.pm ok 3 - sandbox/i-ttt/lib/i/ttt.pm 1..3 ok 1 - CommonMistakes ok 1 - CSV_XS.pm ok 2 - sandbox/genMETA.pm ok 3 - sandbox/i-ttt/lib/i/ttt.pm 1..3 ok 2 - Spell-check with aspell ok 1 - CSV_XS.pm ok 2 - sandbox/genMETA.pm ok 3 - sandbox/i-ttt/lib/i/ttt.pm 1..3 ok 3 - Spell-check with ispell 1..3 perl sandbox/genPPPort_h.pl ppport.h updated to 3.20 perl sandbox/genMETA.pl -c Checking generated YAML ... Checking for Text::CSV_XS-0.89 Check if ChangeLog and README are still valid UTF8 ... Check required and recommended module versions ... Check distribution module versions ... Checking if 5.006 is still OK as minimal version for examples 1..5 ok 1 - examples/parser-xs.pl ok 2 - examples/speed.pl ok 3 - examples/csv2xls ok 4 - examples/csvdiff ok 5 - examples/csv-check ok 1 - Minimum perl version 5.006 : : gzip --best Text-CSV_XS-0.89.tar /pro/bin/perl "-MExtUtils::Manifest=fullcheck" -e fullcheck Not in MANIFEST: MYMETA.json Checked dist Text-CSV_XS-0.89.tgz Kwalitee rating 133.33% (32/24) Ignoring metrics is_prereq, prereq_matches_use, build_prereq_ma +tches_use

    Enjoy, Have FUN! H.Merijn