Python packaging

since 2021-07-19

"2021.1jp" というバージョン表記が PEP 440 準拠でない件の確認

https://www.python.org/dev/peps/pep-0440/

https://zenn.dev/shinsa82/articles/pep-440-overview

https://github.com/pypa/packaging/blob/main/tests/test_version.py

$ pip install packaging

$ python
>>> from packaging.version import Version, parse

>>> Version("2021.1jp")
packaging.version.InvalidVersion: Invalid version: '2021.1jp'

>>> parse("2021.1jp")
packaging.version.InvalidVersion: Invalid version: '2021.1jp'

local version label を + で後置できる件

>>> parse("2021.1+jp")
<Version('2021.1+jp')>

>>> parse("2021.1.1+jp")
<Version('2021.1.1+jp')>

>>> parse("2021.1.1+jp1")
<Version('2021.1.1+jp1')>

>>> parse("2021.1.1+jp2")
<Version('2021.1.1+jp2')>
python_packaging.txt · 最終更新: 2021/07/19 08:46 by Takuya Nishimoto
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0