Versioning::Scheme::Python - Python (PEP 440) version numbering
This document describes version 0.001 of Versioning::Scheme::Python (from Perl distribution Versioning-Scheme-Python), released on 2018-11-18.
use Versioning::Scheme::Python; # checking validity Versioning::Scheme::Perl->is_valid_version('1.2.1a1'); # 1 Versioning::Scheme::Perl->is_valid_version('foo1'); # 0 # parsing $parsed = Versioning::Scheme::Perl->parse_version('1.2.1a1'); # => {base=>[1, 2, 1], prerelease=>["a",1]} # normalizing Versioning::Scheme::Perl->normalize_version('1.001'); # => '1.1' # comparing Versioning::Scheme::Perl->cmp_version('1.2.1', '1.2.01'); # 0 Versioning::Scheme::Perl->cmp_version('1.2.1', '1.2.1a1'); # 1 Versioning::Scheme::Perl->cmp_version('1.2.1', '1!1.1.0'); # -1 # bumping Versioning::Scheme::Perl->bump_version('1.2.3'); # => '1.2.4' Versioning::Scheme::Perl->bump_version('1.2.3', {num=>2}); # => '1.2.5' Versioning::Scheme::Perl->bump_version('1.2.3', {num=>-1}); # => '1.2.2' Versioning::Scheme::Perl->bump_version('1.2.3', {part=>-2}); # => '1.3.0' Versioning::Scheme::Perl->bump_version('1.2.3', {part=>0}); # => '2.0.0' Versioning::Scheme::Perl->bump_version('1.2.3', {part=>-2, reset_smaller=>0}); # => '1.3.3' Versioning::Scheme::Perl->bump_version('1.2.3a1', {part=>'a'}); # => '1.2.3a2'
You can also mix this role into your class.
This role handles Python versioning scheme (as defined in PEP 440) which can be used to version Python-based projects. The role uses Python::Version internally.
Usage:
Versioning::Scheme::Python->bump_version($v [ , \%opts ]);
Options:
num => int (default: 1)
part => int|str (default: -1)
Use number to bump base version, e.g.:
Versioning::Scheme::Python->bump_version('1.2.7', {part=>1}); # => 1.3.0 Versioning::Scheme::Python->bump_version('1.2.7', {part=>1, reset_smaller=>0}); # => 1.3.7 Versioning::Scheme::Python->bump_version('1.2.7', {part=>-3}); # => 2.0.0
Use dev, post, a, b, rc to bump dev/post/alpha/beta/rc numbers, respectively. Will die if version does not have those elements.
dev
post
a
b
rc
Use epoch to bump epoch number.
epoch
Please visit the project's homepage at https://metacpan.org/release/Versioning-Scheme-Python.
Source repository is at https://github.com/perlancar/perl-Versioning-Scheme-Python.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Versioning-Scheme-Python
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Python::Version
Python PEP 440, https://www.python.org/dev/peps/pep-0440/
Role::Versioning::Scheme
Other Versioning::Scheme::* modules.
Versioning::Scheme::*
perlancar <perlancar@cpan.org>
This software is copyright (c) 2018 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Versioning::Scheme::Python, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Versioning::Scheme::Python
CPAN shell
perl -MCPAN -e shell install Versioning::Scheme::Python
For more information on module installation, please visit the detailed CPAN module installation guide.