Declaring dependencies on specific versions of Perl modules using Dist :: Zilla

I used Dist :: Zilla for the project at work, and I declared all my dependencies in the section [Prereqs / Requires]. So far it has been good.

Now I have discovered that the latest version of one of my dependencies violates backward compatibility, so I want to limit the range of versions that I am dependent on. Something like cpanmsupports:

# from perldoc cpanm
cpanm Plack~">= 1.0000, < 2.0000"  # latest of 1.xxxx
cpanm Plack@0.9990                 # specific version. same as Plack~"== 0.9990"

Or Module::Build:

'Other::Module' => '>= 1.2, != 1.5, < 2.0',

In general, how to declare this type of dependency using Dist :: Zilla?

+4
source share
2 answers

Dist::Zilla::Prereqs CPAN:: Meta:: Spec prereqs. Version Ranges.

(prereq, optional_features) (-) - , . , .

- , . 2,4. , 2.4 . , , , 0.

, < (), <= ( ), > (), >= ( ), == (), != ( ). , < 2,0 , 2.0 .

AND-ed . >= 1,2,!= 1,5, 2,0 , 1,2, 2,0, 1,5.

, prereqs :

[Prereqs]
Plack = >= 1.0000, < 2.0000
Plack = == 0.9990
Other::Module = >= 1.2, != 1.5, < 2.0

=, () ().

:

  • >= 1.0000, 2,0000

    1.0000 2.0000

  • == 0.9990

    0.9990

  • = 1,2,!= 1,5, 2.0

    12, 1.5 2.0

, , cpanfile Module:: Build.

+4

, ( , ).

:

[Prereqs]
Plack = >= 1.000, < 2.000
Other::Module = == 1.0
Other::Other::Module = >= 1.2, != 1.5, < 2.0

ETA: Simbaque ; .

+1

Source: https://habr.com/ru/post/1658424/


All Articles