Module::Install::AuthorRequires(3pm)

Module::Install::AuthorRequires3pm

Declare author-only dependencies

Usage

    author_requires 'Some::Module';
    author_requires 'Another::Module' => '0.42';

Overview

Modules often have optional requirements, for example dependencies that are useful for (optional) tests, but not required for the module to work properly.

Usually you want all developers of a project to have these optional modules installed. However, simply telling everyone or printing diagnostic messages if optional dependencies are missing often isn't enough to make sure all authors have all optional modules installed.

"Module::Install" already has a way of detecting an author environment, so an easy way to achieve the above would be something like:

    if ($Module::Install::AUTHOR) {
        requires 'Some::Module';
        requires 'Another::Module' => '0.42';
    }

Unfortunately, that'll also make the optional dependencies show up in the distributions "META.yml" file, which is obviously wrong, as they aren't actually hard requirements.

Working that around requires a considerable amount of non-trivial Makefile.PL hackery, or simply using this module's "author_requires" command.

Commands

author_requires

    author_requires $module;
    author_requires $module => $version;

This declares a hard dependency, that's only enforced in author environments and is not put in the generate "META.yml" file of the distribution.

Releases

7 releases since Debian 7 (Wheezy); the text changed 2 times.

  1. 7–10
  2. 11–12
  3. 13

Author

Florian Ragwitz <[email protected]>

From libmodule-install-authorrequires-perl 0.02-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.