DCIT / perl-CryptX

https://metacpan.org/pod/CryptX
Other
35 stars 23 forks source link

Crypt::PK::ECC needs $VERSION #24

Closed tlhackque closed 8 years ago

tlhackque commented 8 years ago

I am using Crypt::PK::ECC in another CPAN module.

I can't specify a prerequisite version in my package's META because Crypt::PK::ECC doesn't include a $VERSION "our" variable. This makes diagnosing CPANTS reports difficult...

Apparently you only have a $VERSION in Cryptx - which I don't explicitly use or install.

Please add a $VERSION to Crypt::PK::ECC.

It looks like this should also be done for DH, RSA and DSA, though I don't currently use them.

It would also be a good idea for these modules to add a version constraint when they use Cryptx, PK, etc.

Thanks.

karel-m commented 8 years ago

I see your point but on the other hand there is in total 77 modules in CryptX distribution and I do not know of a simple way how to maintain consistent $VERSION in 77 *.pm files.

The workaround might be to depend not on Crypt::PK::ECC but on the whole CryptX where you can define required version.

tlhackque commented 8 years ago

I can depend on CryptX, but it's by no means obvious that one should do this. I didn't know that Crypt::PK::ECC was part of CryptX until I started reading code. I found the module directly (not from CryptX). The doc only mentions CryptX in "since" under some methods... As far as I can tell, the end user never has use CryptX; in his code.

Are there really 77 modules that an end-user would use in his code? The most important are what other packages use, since that what they list for dependencies. (Also, tools such as Dist::Zilla identify the dependencies by scanning source code for require and use.) But even 77 is manageable.

Some ways to maintain consistent $VERSION with a multi-module distribution:

Dist::Zilla::Plugin::PkgVersion sounds like your best choice, if you package with Dist::Zilla.

If not, your package builder could include something like VERSION=1.99 find lib -name '*.pm' -exec sed -i.bak -e"s/^our \$VERSION = .*'\$/our \$VERSION = '$VERSION';/g" {} \; There are other choices depending on how you manage your development...

For the reverse dependencies (use CryptX, etc), you can do something similar, or just update them when a change makes it necessary. "It depends"...

karel-m commented 8 years ago

Fixed in CryptX-0.041 which I have just uploaded to CPAN,

Thanks for your time.

tlhackque commented 8 years ago

Thanks!