Skip to content

Commit 3fa8e77

Browse files
committed
Fix missing metadata in MacOS wheels.
The TCOD_TAG environment variable was skipping writing to version.py.
1 parent 3d55abd commit 3fa8e77

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ v2.0.0
88

99
Unreleased
1010
------------------
11+
Fixed
12+
- MacOS wheels had broken version metadata.
1113

1214
11.19.2 - 2020-12-30
1315
--------------------

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
def get_version():
1616
"""Get the current version from a git tag, or by reading tcod/version.py"""
1717
if os.environ.get("TCOD_TAG"):
18+
# Force a tag version from an environment variable.
19+
# Needed to work with GitHub Actions.
20+
with open("tcod/version.py", "w") as f:
21+
f.write('__version__ = "%s"\n' % os.environ["TCOD_TAG"])
1822
return os.environ["TCOD_TAG"]
1923
try:
2024
tag = check_output(
@@ -33,7 +37,8 @@ def get_version():
3337
version += ".dev%i" % commits_since_tag
3438

3539
# update tcod/version.py
36-
open("tcod/version.py", "w").write('__version__ = "%s"\n' % version)
40+
with open("tcod/version.py", "w") as f:
41+
f.write('__version__ = "%s"\n' % version)
3742
return version
3843
except:
3944
try:

0 commit comments

Comments
 (0)