Closed hartzell closed 6 years ago
You could not declare a specific Bio::Perl you depend on, if you can get away with that safely. But Bio::Perl needs to declare its version properly for static version detection to work.
There's nothing really to be done here on the Module::Metadata side, so I'm closing this.
Thanks @karenetheridge!
There were arguments in the Bio::Perl community about this back in the day, it won't change. This (and a companion bug here) are mostly to save the next person (or me, in a year) from wasting time debugging this....
Just out of curiousity, is there a "proper way to declare a version"?
There's always been more than one way to do it (e.g. Chromatics blog post). I get that a static analysis tool can only do so much, but I'm curious if someone has put their foot down.
Chromatic's post is mostly orthogonal to the problem you encountered here. How Module::Metadata (and MM->parse_version, which is an earlier even more dumbed down version of the same strategy) does it is by evaluating the single line of code upon which the declaration is found. That line needs to contain all the information needed to define the version, without depending on an external module to be loaded.
If one did
require Bio::Root::Version; our $VERSION = $Bio::Root::Version::VERSION;
..in a single line this would almost work, except that one cannot guarantee that Bio::Root::Version is installed in the caller's @INC
at the time of parsing.
Is it really out of the question for Bio::Perl to update $VERSION declarations as part of the release process? Some distributions do this by incorporating a bump
target into their Makefile and ensuring this target is triggered during make release
(or whatever other release helper they are using).
Thanks for the additional detail.
I've raised the issue on the Bio::Perl side and we'll see what comes of it. Worst case, there's a workaround.
Thanks!
Is it really out of the question for Bio::Perl to update $VERSION declarations as part of the release process? Some distributions do this by incorporating a bump target into their Makefile and ensuring this target is triggered during make release (or whatever other release helper they are using).
@karenetheridge can you point to any specific (non-dzil) examples of this?
@haarg thanks!
[edit, add a link for Bio::Root::Version]
I'd like to use Carton to manage a project that uses Bio::Perl. Unfortunately it fails thusly:
The problem is that
Bio/Perl.pm
doesn't explicitly set VERSION, instead does this:and
Bio::Root::Version
has animport
statement here that sets the appropriate packages$VERSION
. I believe that this is from the pre-dzil days as a way to avoid having to update every file in the tree.My work-around is to have my project depend on
Bio::Root::Version
, but that's not really very nice.I suppose the fix would be to actually eval the module and ask it for it's version (perhaps in a subprocess) but I can imagine that might cause additional problems.