Description
Just discovered that pytest has a hard dependency on (https://github.com/pypa/packaging)
I was about to reinvent the Version class after forgetting how tuple worked.
But it seems like there's not any blockers to switching to it instead?
Examples
Use properties for testing parts of a version:
- "pyarrow_table" in str(constructor) and PYARROW_VERSION < (14,),
+ "pyarrow_table" in str(constructor) and PYARROW_VERSION.major < 14,
Compare between instances:
- PYARROW_VERSION == (0, 0, 0) or PANDAS_VERSION < (2, 2)
+ PYARROW_VERSION == (0, 0, 0) or PANDAS_VERSION < Version("2.2")
Although for that, I'd probably write it as:
+ PANDAS_SUPPORTS_DECIMAL = Version("2.2")
- PYARROW_VERSION == (0, 0, 0) or PANDAS_VERSION < (2, 2)
+ PYARROW_VERSION.major == 0 or PANDAS_VERSION < PANDAS_SUPPORTS_DECIMAL
There's more features like handling pre-release versions too - which might be handy in ci
Description
Just discovered that
pytesthas a hard dependency on (https://github.com/pypa/packaging)I was about to reinvent the
Versionclass after forgetting howtupleworked.But it seems like there's not any blockers to switching to it instead?
Examples
Use properties for testing parts of a version:
Compare between instances:
Although for that, I'd probably write it as:
There's more features like handling pre-release versions too - which might be handy in ci