-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some still remain. DoD: No warnings about setup deprecations printed when running tox. Ref: https://packaging.python.org/en/latest/discussions/setup-py-deprecated/#id2
- Loading branch information
Showing
3 changed files
with
36 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import filecmp | ||
import os | ||
import shutil | ||
import subprocess | ||
import tempfile | ||
|
||
|
||
VERSIONFILE = "px/version.py" | ||
|
||
git_version = ( | ||
subprocess.check_output(["git", "describe", "--dirty"]).decode("utf-8").strip() | ||
) | ||
with tempfile.NamedTemporaryFile(suffix=".py", delete=False) as tmp: | ||
tmp.write(b"# NOTE: Auto generated by setup.py, no touchie!\n") | ||
tmp.write(b'VERSION = "%s"\n' % bytearray(git_version, "utf_8")) | ||
|
||
# Flushing is required for filecmp.cmp() to work (below) | ||
tmp.flush() | ||
|
||
if not os.path.isfile(VERSIONFILE): | ||
# No version file found | ||
shutil.move(tmp.name, VERSIONFILE) | ||
elif not filecmp.cmp(tmp.name, VERSIONFILE): | ||
# Version file needs updating | ||
shutil.move(tmp.name, VERSIONFILE) | ||
else: | ||
# VERSIONFILE was already up to date. If we touch it in this | ||
# case, it will have its file timestamp updated, which will | ||
# force the slow px_integration_test.py tests to get rerun. | ||
# | ||
# Just clean up our tempfile and be merry. | ||
os.remove(tmp.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters