Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
52 additions
and
56 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
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,37 @@ | ||
import re | ||
from pathlib import Path | ||
|
||
MAJOR = 0 | ||
REVISION = 4 | ||
PATCH = 3 | ||
VERSION = f"{MAJOR}.{REVISION}.{PATCH}" | ||
|
||
|
||
def write_version_py(filename: str = "popmon/version.py") -> None: | ||
"""Write package version to version.py. | ||
This will ensure that the version in version.py is in sync with us. | ||
:param filename: The version.py to write too. | ||
:type filename: str | ||
""" | ||
# Do not modify the indentation of version_str! | ||
version_str = f"""\"\"\"THIS FILE IS AUTO-GENERATED BY SETUP.PY.\"\"\" | ||
version = \"{VERSION:s}\" | ||
""" | ||
|
||
with open(filename, "w") as version_file: | ||
version_file.write(version_str) | ||
|
||
|
||
def update_setup_py(filename="setup.py"): | ||
contents = Path(filename).read_text() | ||
contents = re.sub( | ||
r'version="[0-9]+\.[0-9]+\.[0-9]+[A-Za-z]*",', f'version="{VERSION}",', contents | ||
) | ||
Path(filename).write_text(contents) | ||
|
||
|
||
write_version_py() | ||
update_setup_py() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
"""THIS FILE IS AUTO-GENERATED BY SETUP.PY.""" | ||
|
||
name = "popmon" | ||
version = "0.4.2" | ||
full_version = "0.4.2" | ||
release = True | ||
version = "0.4.3" |
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