Git Product home page Git Product logo

module-release's Introduction

Coverage Status

The Module::Release module

This is the README for the Module::Release Perl module. I created this to automate the testing and uploading of my Perl modules.

You're probably looking at this because you don't know where else to find what you're looking for. Read this once and you might never have to read one again for any Perl module.

Documentation

To read about Module::Release, look at the embedded documentation in the module itself. Inside the distribution, you can format it with perldoc:

% perldoc lib/Module/Release.pm

If you have already installed the module, you can specify the module name instead of the file location:

% perldoc Module::Release

You can read the documentation and inspect the meta data at MetaCPAN.

The standard module documentation has example uses in the SYNOPSIS section, but you can also look in the examples/ directory (if it's there), or look at the test files in t/.

Installation

You can install this module with a CPAN client, which will resolve and install the dependencies:

% cpan Module::Release
% cpanm Module::Release

You can also install directly from the distribution directory, which will also install the dependencies:

% cpan .
% cpanm .

You could install just this module manually:

% perl Makefile.PL
% make
% make test
% make install

You probably don't want to do that unless you're fiddling with the module and only want to run the tests without installing anything.

Source location

The meta data, such as the source repository and bug tracker, is in Makefile.PL or the META.* files it creates. You can find that on those CPAN web interfaces, but you can also look at files directly in the source repository:

If you find a problem, file a ticket in the issue tracker:

Getting help

Although I'm happy to hear from module users in private email, that's the best way for me to forget to do something.

Besides the issue trackers, you can find help at Perlmonks or Stackoverflow, both of which have many competent Perlers who can answer your question, almost in real time. They might not know the particulars of this module, but they can help you diagnose your problem.

You might like to read brian's Guide to Solving Any Perl Problem.

You should have received a LICENSE file, but the license is also noted in the module files. About the only thing you can't do is pretend that you wrote code that you didn't.

Good luck!

Enjoy,

brian d foy, [email protected]

module-release's People

Contributors

briandfoy avatar csjewell avatar hugmeir avatar tux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

module-release's Issues

Evaluate command line args that should also be config options

  • -a automated testing - done: automated_testing
  • -C skip Changes file (done: skip_changes)
  • -d extra debugging stuff (done: debug)
  • -D don't build dist (done: skip_dist)
  • -h help (won't do)
  • -j set parallel test (not yet done, but yes, #38)
  • -k skip kwalitee (done) - done: skip_kwalitee
  • -m skip MANIFEST check - done: skip_manifest
  • -p skip prereqs test - done: skip_prereqs
  • -t make and test only
  • -T don't run tests (done: skip_tests)
  • -v print version and exit (won't do)
  • -V skip version check (done: skip_cpan_version_check)

cosmetic change to release script

Nice to see progress!

  1. I've put the version stuff inside an eval in the dist branch of the else, as I found situations it would crash the debug line should be invoked only once there
  2. I added a counter in the progress line. Handy when testing with close to 500 perl versions
--- release     2021-02-26 13:12:25.558026859 +0100
+++ release-lx09        2021-02-26 13:56:27.431257980 +0100
@@ -509,22 +509,20 @@ if ($skip_dist) {
        }
 else {
        $release->dist unless( $release->local_file and -e $release->local_file );
-       $Version = $release->dist_version;
-       $release->_debug( "dist version is <$Version>\n" );
+       $Version = eval { $release->dist_version; } || "?";
        }

-$Version = $release->dist_version;
-
 $release->_debug( "dist version is <$Version>\n" );

-
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 # test with a bunch of perls
 unless( $opts{T} ) {
        my $old_perl = $release->get_perl;

-       PERL: foreach my $perl ( $release->perls ) {
-               $release->_print("============Testing with $perl\n");
+       my @perls = $release->perls;
+       my ($n, $N) = (1, scalar @perls);
+       PERL: foreach my $perl ( @perls ) {
+               $release->_print("============ Testing with $perl (", $n++, "/$N)\n");
                $release->set_perl( $perl ) or next;

                $release->clean;

[feature request] "requires" entry in .releaserc

with close to 200 available perl versions to test a module against, my .releaserc looks somewhat like this:

--8<---
cpan_user HMBRAND
automated_testing 1
skip_kwalitee 1
skip_manifest 1
skip_prereqs 1
skip_dist 1
allow_glob_in_perls 1
perls /pro/bin/perl:/usr/bin/perl
:/media/Tux/perls/bin/perl5.6.[12]
:/media/Tux/perls/bin/perl5.8.
:/media/Tux/perls/bin/perl5.1[02468]

:/media/Tux/perls/bin/perl5.2[02468]
:/media/Tux/perls/bin/perl5.21.

:/media/Tux/perls/bin/tperl5.6.2
:/media/Tux/perls/bin/tperl5.8.
:/media/Tux/perls/bin/tperl5.1[02468]

:/media/Tux/perls/bin/tperl5.2[02468]
:/media/Tux/perls/bin/tperl5.21.

:/media/Tux/perls/bin/cperl5.2[01].*
-->8---

If a module depends on something else, like DBI, there is currently no way to tell Module::Release to skip a perl if that install does not have that module installed.

Would it be possible to have a line like

requires DBI,Data::Peek

and have Module::Release skip that perl if those modules are not installed?

[feature request] skip git check on untracked files

If working on a project where new tests are work in progress, and these tests are not (yet) in git nor in the MANIFEST, I do not see this as e reason for release -t to fail. So untracked files IMHO should not cause a FAIL.

=item Check that source control is up-to-date

If there are modified files, added files, or extra files so that
source control complains, fail.

I'd like to see an option (which I would default to be enabled in my .releaserc files), to make that

=item Check that source control is up-to-date

If there are modified files so that source control complains, fail.

I've done that by adding -uno:

sub check_vcs {
	my $self = shift;

	$self->_print( "Checking state of Git... " );

	my $git_status = $self->run('git status -s -uno 2>&1');

But if you think this could help others too, it should be an option

Feature request: parallel tests

Currently testing Text::CSV_XS with 145+ versions of perl takes more than an hour.

Most of the consumed time is running the tests (52000+ tests taking 15-20 seconds)

I can see two approaches for a speedup.

1: if the t/ folder is parallel-safe, use -jN

$ prove -wbQ t
All tests successful.
Files=29, Tests=52231, 17 wallclock secs ( 3.12 usr  0.20 sys + 16.47 cusr  0.47 csys = 20.26 CPU)
Result: PASS
$ prove -wbQ -j8 t
All tests successful.
Files=29, Tests=52231, 12 wallclock secs ( 3.67 usr  0.22 sys + 18.01 cusr  0.67 csys = 22.57 CPU)
Result: PASS
$ make test
:
All tests successful.
Files=29, Tests=52231, 17 wallclock secs ( 3.20 usr  0.23 sys + 16.16 cusr  0.42 csys = 20.01 CPU)
Result: PASS
$ env HARNESS_OPTIONS=j8 make test
:
All tests successful.
Files=29, Tests=52231, 12 wallclock secs ( 3.77 usr  0.25 sys + 18.70 cusr  0.50 csys = 23.22 CPU)
Result: PASS

Implementing this is easy:

--- release     2021-03-11 08:56:52.000000000 +0100
+++ release-2   2021-03-24 11:19:51.325116916 +0100
@@ -35,6 +35,10 @@ release - give your Perl distros to the
        # set $ENV{AUTOMATED_TESTING} to a true value
        release -a

+       # Enable parallel testing by setting $ENV{HARNESS_OPTIONS}
+       release -j
+       release -j8
+
 =head1 DESCRIPTION

 This is the prototype program for using C<Module::Release>. You should
@@ -321,8 +325,18 @@ my @extra_opts = split /\s+/, $ENV{RELEA
 push @ARGV, @extra_opts;

 my %opts;
-getopts('aChdptvVkT', \%opts) or $opts{h} = 1;
+getopts('aChdptvVkTj:', \%opts) or $opts{h} = 1;

+if( exists $opts{j} ) {
+       unless( defined $opts{j} ) {
+               delete $opts{h}; # getopts does not support optional arguments like Getopt::Long does in "j|parallel:9"
+               $opts{j} = eval {
+                       require System::Info;
+                       System::Info->new->get_core_count;
+                       } || 9;
+       }
+       $ENV{HARNESS_OPTIONS} = "j$opts{j}";
+}

 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 my( $script_version ) = '2.127';

setting this option reduces my release -t on my laptop today from 65 minutes to 52 minutes. Not a huge win, but still.

2: run tests in parallel in different cloned folders
I envision more gain if I could run in a different folder per perl version 8 (or whatever) folders with a clone in parallel. This would however mean a lot more work.

If I pass a base folder like ~/test/tmp where the current folder is rsync'd too before running the tests and than clean-up when done, I can run 8 perl versions in parallel and use more of the available resources.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.