@@ -14,7 +14,6 @@ manage *COMMAND:
1414 import os
1515 import sys
1616 from django.core import management
17- sys.path.append (os .getcwd())
1817 os .environ[" DJANGO_SETTINGS_MODULE" ] = " tests.settings"
1918 management.execute_from_command_line(sys.argv + " {{ COMMAND }} " .split(" " ))
2019
@@ -92,9 +91,17 @@ clean: clean-docs clean-env clean-git-ignored
9291build-docs-html : install-docs
9392 @ just run sphinx-build --fresh-env --builder html --doctree-dir ./ doc/ build/ doctrees ./ doc/ source ./ doc/ build/ html
9493
94+ [script ]
95+ _ open-pdf-docs :
96+ import webbrowser
97+ from pathlib import Path
98+ webbrowser.open(f" file://{Path('./doc/build/pdf/django-render-static.pdf').absolute()}" )
99+
95100# build pdf documentation
96101build-docs-pdf : install-docs
97- @ just run sphinx-build --fresh-env --builder latexpdf --doctree-dir ./ doc/ build/ doctrees ./ doc/ source ./ doc/ build/ pdf
102+ @ just run sphinx-build --fresh-env --builder latex --doctree-dir ./ doc/ build/ doctrees ./ doc/ source ./ doc/ build/ pdf
103+ make -C ./ doc/ build/ pdf
104+ @ just _open-pdf-docs
98105
99106# build the docs
100107build-docs : build-docs-html
@@ -212,10 +219,15 @@ validate_version VERSION:
212219 import re
213220 import tomllib
214221 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)
222+ from packaging.version import Version
223+ raw_version = " {{ VERSION }} " .lstrip(" v" )
224+ version_obj = Version(raw_version)
225+ # the version should be normalized
226+ assert str(version_obj) == raw_version
227+ # make sure all places the version appears agree
228+ assert raw_version == tomllib.load(open(' pyproject.toml' , ' rb' ))[' project' ][' version' ]
229+ assert raw_version == django_enum.__version__
230+ print(raw_version)
219231
220232# issue a relase for the given semver string (e.g. 2.1.0)
221233release VERSION :
0 commit comments