File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 9797 name : sdist
9898 - name : Build package in isolation
9999 run : |
100- pip install -v tcod-*.tar.gz
100+ pip install tcod-*.tar.gz
101101 - name : Confirm package import
102102 run : |
103103 python -c "import tcod"
Original file line number Diff line number Diff line change 88
99Unreleased
1010------------------
11+ Fixed
12+ - Fixed version mismatch when building from sources.
1113
121412.6.0 - 2021-06-09
1315-------------------
@@ -19,9 +21,6 @@ Deprecated
1921 - The handling of negative indexes given to console drawing and printing
2022 functions will be changed to be used as absolute coordinates in the future.
2123
22- Fixed
23- - Fixed version mismatch when building from sources.
24-
252412.5.1 - 2021-05-30
2625-------------------
2726Fixed
Original file line number Diff line number Diff line change 33import os
44import pathlib
55import platform
6+ import re
67import sys
78import warnings
89from subprocess import CalledProcessError , check_output
@@ -37,12 +38,13 @@ def get_version() -> str:
3738 return version
3839 except CalledProcessError :
3940 try :
40- __version__ = "0.0.0"
4141 with open (PATH / "tcod/version.py" ) as version_file :
42- exec (version_file .read (), globals ()) # Update __version__
42+ match = re .match (r'__version__ = "(\S+)"' , version_file .read ())
43+ assert match
44+ return match .groups ()[0 ]
4345 except FileNotFoundError :
44- warnings .warn ("Unknown version: " " Not in a Git repository and not from a sdist bundle or wheel." )
45- return __version__
46+ warnings .warn ("Unknown version: Not in a Git repository and not from a sdist bundle or wheel." )
47+ return "0.0.0"
4648
4749
4850is_pypy = platform .python_implementation () == "PyPy"
You can’t perform that action at this time.
0 commit comments