3

One of my modules is failing the CPANTS policy meta_yml_has_provides

The documentation states:

Add all modules contained in this distribution to the META.yml field 'provides'. Module::Build or Dist::Zilla::Plugin::MetaProvides do this automatically for you.

How can I to apply this to my CPAN module while using ExtUtils::MakeMaker?

MichielB
  • 4,181
  • 1
  • 30
  • 39

1 Answers1

3

You could do something like this:

use ExtUtils::MakeMaker;
use Module::Metadata;
WriteMakefile(
    ...
    META_ADD => {
        provides => Module::Metadata->provides(version => '1.4', dir => 'lib'),
    },
    ...
);

But then your end users also need to depend on Module::Metadata. You may want to add some author only logic to that for production use. YMMV.

I'm not sure it's really worth it in that regard. Possibly MakeMaker should have built-in support for this instead.

Leon Timmermans
  • 30,029
  • 2
  • 61
  • 110