SilasTheMonk has asked for the wisdom of the Perl Monks concerning the following question:

....or even a novice actually.

My latest struggle is with why license information is not showing correctly in Test::Regression. I have a clue in that on my CPANTS entry it says: "The META.yml file of this distributioncould not be parsed by the version of YAML.pm CPANTS is using." However I am on the latest version of YAML and the distribution does have a META.yml file. I also found this node Re: Module Dependency Grapher but I am on the latest version of ExtUtils::MakeMaker. I have also found http://module-build.sourceforge.net/META-spec-current.html and looked at other modules of mine that do not have this issue, but nothing yields me the wisdpm I seek.

Replies are listed 'Best First'.
Re: I am not a META.yml expert.....
by moritz (Cardinal) on Sep 28, 2009 at 10:50 UTC
    I think that in the META.yml it is not allowed to use arbitrary YAML, but only a (sadly poorly defined, afaict) subset.

    Maybe try to use Test::YAML::Meta to verify it locally.

    Perl 6 - links to (nearly) everything that is Perl 6.

      Thanks. I have tested with Test::YAML::Meta and Test::YAML::Valid and it confirms that there is a problem with my META.yml. However it does not pinpoint what the problem is, nor how it got generated incorrectly. Thus I am still stuck. Also curiously the problem seems to be identified by YAML::Syck but not straight YAML.

      Edit: Just to make this clear. If I run this code:

      use strict; use warnings; use Test::More; use Test::YAML::Valid qw(-Syck); yaml_file_ok('META.yml', 'META.yml is YAML');
      it indicates that the YAML is invalid. If I remove the "-Syck" it's okay. If I run it on other META.yml it's okay. I find this very puzzling as it suggests not just that there is something mysteriously wrong with my YAML, but that Syck is not that transparent.
        $ perl -MDDS -mYAML::Syck -le 'Dump( YAML::Syck::LoadFile( shift))' M +ETA.yml Syck parser (line 4, column 62): syntax error ...
        line 4, column 62 is the abstract
        abstract: Test library that can be run in two modes: once to + generate outputs and secondly to compare against them ----------------------------------------------------------62-^
        Looks like a bug in ExtUtils::MakeMaker, it doesn't quote abstract properly.
Re: I am not a META.yml expert..... (review)
by toolic (Bishop) on Sep 28, 2009 at 14:09 UTC
    This is unrelated to your YAML problem...

    Do you mind a mini-review of your code?

    To get your SYNOPSIS POD to render as code, you should indent as follows:

    =head1 SYNOPSIS use Test::Regression; ok_regression(sub {return "hello world"}, "t/out/hello_world.txt") +;

    You should explicitly mention that TEST_REGRESSION_GEN is an environment variable:

    If the TEST_REGRESSION_GEN environment variable is set to a true value

    Additionally, I recommend adding a DESCRIPTION section to briefly discuss why someone would use your module. How would I distinguish it from the other CPAN Test modules? Does it complement other Test modules?

Re: I am not a META.yml expert.....
by Anonymous Monk on Sep 28, 2009 at 09:47 UTC
    It may be lag, or CPANTS YAML module is too old
    $ wget http://cpansearch.perl.org/src/SILASMONK/Test-Regression-0.03/M +ETA.yml $ perl -MDDS -mYAML -le'Dump( YAML::LoadFile( shift))' META.yml $HASH1 = { abstract => 'Test library that can be run in two modes: o +nce to generate outputs and secondly to compare against them', author => [ 'Nicholas Bamber <nicholas@periapt.co.uk>' +], build_requires => { "ExtUtils::MakeMaker" => 0 }, configure_requires => { "ExtUtils::MakeMaker" => 0 }, distribution_type => 'module', generated_by => 'ExtUtils::MakeMaker version 6.54', license => 'perl', "meta-spec" => { url => 'http://module-build.sourceforge +.net/META-spec-v1.4.html', version => 1.4 }, name => 'Test-Regression', no_index => { directory => [ 't', 'inc' ] }, requires => { "Algorithm::Diff" => 0, "Test::Differences" => 0, "Test::More" => 0, "Text::Diff" => 0 }, version => 0.03 }; $ pmvers YAML 0.70
Re: I am not a META.yml expert.....
by leocharre (Priest) on Sep 28, 2009 at 14:06 UTC
    1. An Example

      Maybe the following is of use..

      Here's an example of a Makefile.PL that helps generate a proper META.yml..

      use ExtUtils::MakeMaker; WriteMakefile( NAME => 'WordPress::XMLRPC', VERSION_FROM => 'lib/WordPress/XMLRPC.pm', PREREQ_PM => { 'YAML' => 0, 'SOAP::Lite' => 0, 'XMLRPC::Lite' => 0, 'Smart::Comments' => 0, 'LEOCHARRE::Debug' => 0, 'LEOCHARRE::CLI2' => 0, }, LICENSE => 'perl', AUTHOR => 'Leo Charre leocharre at cpan dot org', ABSTRACT_FROM => 'lib/WordPress/XMLRPC.pod', );
      The META.yml I get is..
      --- #YAML:1.0 name: WordPress-XMLRPC version: 1.21 abstract: api to wordpress xml rpc calls author: - Leo Charre leocharre at cpan dot org license: perl distribution_type: module configure_requires: ExtUtils::MakeMaker: 0 requires: LEOCHARRE::CLI2: 0 LEOCHARRE::Debug: 0 Smart::Comments: 0 SOAP::Lite: 0 XMLRPC::Lite: 0 YAML: 0 no_index: directory: - t - inc generated_by: ExtUtils::MakeMaker version 6.48 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4

      You can browse this in the distro WordPress::XMLRPC, also note the pod.

    2. Checking What You're Getting..

      You can check what it's doing via the following.

      Once you have your distro,

      perl Makefile.PL
      make disttest
      
      # now look at the dir created mydistroname-vernum/META.yml and see if it's what you want.