Skip to content

Commit

Permalink
Make the version detection slightly more flexible
Browse files Browse the repository at this point in the history
Just in case someone using GPax as a dev copy does not have dunamai
installed, GPax will now gracefully fail to detect the version
and will simply use "dev" as the version name.
  • Loading branch information
matthewcarbone committed Mar 1, 2024
1 parent e3cfefd commit 7d8156b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gpax/_version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""Version file. This is overwritten during build and will contain a static
__version__ variable."""

import dunamai as _dunamai
try:
import dunamai as _dunamai

__version__ = _dunamai.Version.from_any_vcs().serialize()
del _dunamai
__version__ = _dunamai.Version.from_any_vcs().serialize()
del _dunamai
except ImportError:
__version__ = "dev"
1 change: 1 addition & 0 deletions scripts/build_project.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

pip install flit~=3.7
pip install dunamai==1.19.2
echo "__version__ = '$(dunamai from any --style=pep440 --no-metadata)'" >gpax/_version.py
flit build

0 comments on commit 7d8156b

Please sign in to comment.