File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed
Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -212,10 +212,15 @@ validate_version VERSION:
212212 import re
213213 import tomllib
214214 import django_enum
215- version = re.match(r" v?(\d +[.]\d +[.]\w +)" , " {{ VERSION }} " ).groups()[0]
216- assert version == tomllib.load(open(' pyproject.toml' , ' rb' ))[' project' ][' version' ]
217- assert version == django_enum.__version__
218- print(version)
215+ from packaging.version import Version
216+ raw_version = " {{ VERSION }} " .lstrip(" v" )
217+ version_obj = Version(raw_version)
218+ # the version should be normalized
219+ assert str(version_obj) == raw_version
220+ # make sure all places the version appears agree
221+ assert raw_version == tomllib.load(open(' pyproject.toml' , ' rb' ))[' project' ][' version' ]
222+ assert raw_version == django_enum.__version__
223+ print(raw_version)
219224
220225# issue a relase for the given semver string (e.g. 2.1.0)
221226release VERSION :
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ packages = ["src/django_enum"]
6060
6161
6262[project .optional-dependencies ]
63- properties = [" enum-properties>=2.0 .0" ]
63+ properties = [" enum-properties>=2.2 .0" ]
6464filters = [" django-filter>=21" ]
6565rest = [" djangorestframework>=3.9,<4.0" ]
6666
@@ -86,6 +86,7 @@ dev = [
8686 " matplotlib>=3.9.4" ,
8787 " mypy>=1.15.0" ,
8888 " numpy>=2.0.2" ,
89+ " packaging>=24.2" ,
8990 " pre-commit>=4.1.0" ,
9091 " pytest>=8.3.4" ,
9192 " pytest-cov>=6.0.0" ,
You can’t perform that action at this time.
0 commit comments