Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
packaging.version.Version Class Reference
Inheritance diagram for packaging.version.Version:
Inheritance graph
[legend]
Collaboration diagram for packaging.version.Version:
Collaboration graph
[legend]

Public Member Functions

None __init__ (self, str version)
 
str __repr__ (self)
 
str __str__ (self)
 
int epoch (self)
 
tuple[int,...] release (self)
 
tuple[str, int]|None pre (self)
 
int|None post (self)
 
int|None dev (self)
 
str|None local (self)
 
str public (self)
 
str base_version (self)
 
bool is_prerelease (self)
 
bool is_postrelease (self)
 
bool is_devrelease (self)
 
int major (self)
 
int minor (self)
 
int micro (self)
 
- Public Member Functions inherited from packaging.version._BaseVersion
int __hash__ (self)
 
bool __lt__ (self, _BaseVersion other)
 
bool __le__ (self, _BaseVersion other)
 
bool __eq__ (self, object other)
 
bool __ge__ (self, _BaseVersion other)
 
bool __gt__ (self, _BaseVersion other)
 
bool __ne__ (self, object other)
 

Public Attributes

 release
 
 pre
 

Protected Attributes

 _version
 
 _key
 
- Protected Attributes inherited from packaging.version._BaseVersion
 _key
 

Static Protected Attributes

 _regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE)
 
CmpKey _key
 
- Static Protected Attributes inherited from packaging.version._BaseVersion
tuple _key [Any, ...]
 

Detailed Description

This class abstracts handling of a project's versions.

A :class:`Version` instance is comparison aware and can be compared and
sorted using the standard Python interfaces.

>>> v1 = Version("1.0a5")
>>> v2 = Version("1.0")
>>> v1
<Version('1.0a5')>
>>> v2
<Version('1.0')>
>>> v1 < v2
True
>>> v1 == v2
False
>>> v1 > v2
False
>>> v1 >= v2
False
>>> v1 <= v2
True

Constructor & Destructor Documentation

◆ __init__()

None packaging.version.Version.__init__ (   self,
str  version 
)
Initialize a Version object.

:param version:
    The string representation of a version which will be parsed and normalized
    before use.
:raises InvalidVersion:
    If the ``version`` does not conform to PEP 440 in any way then this
    exception will be raised.

Member Function Documentation

◆ __repr__()

str packaging.version.Version.__repr__ (   self)
A representation of the Version that shows all internal state.

>>> Version('1.0.0')
<Version('1.0.0')>

◆ __str__()

str packaging.version.Version.__str__ (   self)
A string representation of the version that can be round-tripped.

>>> str(Version("1.0a5"))
'1.0a5'

◆ base_version()

str packaging.version.Version.base_version (   self)
The "base version" of the version.

>>> Version("1.2.3").base_version
'1.2.3'
>>> Version("1.2.3+abc").base_version
'1.2.3'
>>> Version("1!1.2.3dev1+abc").base_version
'1!1.2.3'

The "base version" is the public version of the project without any pre or post
release markers.

◆ dev()

int | None packaging.version.Version.dev (   self)
The development number of the version.

>>> print(Version("1.2.3").dev)
None
>>> Version("1.2.3.dev1").dev
1

◆ epoch()

int packaging.version.Version.epoch (   self)
The epoch of the version.

>>> Version("2.0.0").epoch
0
>>> Version("1!2.0.0").epoch
1

◆ is_devrelease()

bool packaging.version.Version.is_devrelease (   self)
Whether this version is a development release.

>>> Version("1.2.3").is_devrelease
False
>>> Version("1.2.3.dev1").is_devrelease
True

◆ is_postrelease()

bool packaging.version.Version.is_postrelease (   self)
Whether this version is a post-release.

>>> Version("1.2.3").is_postrelease
False
>>> Version("1.2.3.post1").is_postrelease
True

◆ is_prerelease()

bool packaging.version.Version.is_prerelease (   self)
Whether this version is a pre-release.

>>> Version("1.2.3").is_prerelease
False
>>> Version("1.2.3a1").is_prerelease
True
>>> Version("1.2.3b1").is_prerelease
True
>>> Version("1.2.3rc1").is_prerelease
True
>>> Version("1.2.3dev1").is_prerelease
True

◆ local()

str | None packaging.version.Version.local (   self)
The local version segment of the version.

>>> print(Version("1.2.3").local)
None
>>> Version("1.2.3+abc").local
'abc'

◆ major()

int packaging.version.Version.major (   self)
The first item of :attr:`release` or ``0`` if unavailable.

>>> Version("1.2.3").major
1

◆ micro()

int packaging.version.Version.micro (   self)
The third item of :attr:`release` or ``0`` if unavailable.

>>> Version("1.2.3").micro
3
>>> Version("1").micro
0

◆ minor()

int packaging.version.Version.minor (   self)
The second item of :attr:`release` or ``0`` if unavailable.

>>> Version("1.2.3").minor
2
>>> Version("1").minor
0

◆ post()

int | None packaging.version.Version.post (   self)
The post-release number of the version.

>>> print(Version("1.2.3").post)
None
>>> Version("1.2.3.post1").post
1

◆ pre()

tuple[str, int] | None packaging.version.Version.pre (   self)
The pre-release segment of the version.

>>> print(Version("1.2.3").pre)
None
>>> Version("1.2.3a1").pre
('a', 1)
>>> Version("1.2.3b1").pre
('b', 1)
>>> Version("1.2.3rc1").pre
('rc', 1)

◆ public()

str packaging.version.Version.public (   self)
The public portion of the version.

>>> Version("1.2.3").public
'1.2.3'
>>> Version("1.2.3+abc").public
'1.2.3'
>>> Version("1!1.2.3dev1+abc").public
'1!1.2.3.dev1'

◆ release()

tuple[int, ...] packaging.version.Version.release (   self)
The components of the "release" segment of the version.

>>> Version("1.2.3").release
(1, 2, 3)
>>> Version("2.0.0").release
(2, 0, 0)
>>> Version("1!2.0.0.post0").release
(2, 0, 0)

Includes trailing zeroes but not the epoch or any pre-release / development /
post-release suffixes.

Reimplemented in packaging.version._TrimmedRelease.

Member Data Documentation

◆ release

packaging.version.Version.release

The documentation for this class was generated from the following file: