-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from climate-resource/fix-towncrier
- Loading branch information
Showing
8 changed files
with
59 additions
and
125 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
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
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 @@ | ||
Use get-version script instead of a sed one-liner |
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,29 @@ | ||
""" | ||
Extract the current version from pyproject.toml and print to stdout | ||
These can then be used in our release template. | ||
""" | ||
|
||
from pathlib import Path | ||
|
||
import toml | ||
|
||
|
||
def get_version() -> str: | ||
""" | ||
Extract the current version from pyproject.toml | ||
""" | ||
version = "unknown" | ||
# adopt path to your pyproject.toml | ||
pyproject_toml_file = Path(__file__).parent.parent / "pyproject.toml" | ||
|
||
if pyproject_toml_file.exists() and pyproject_toml_file.is_file(): | ||
data = toml.load(pyproject_toml_file) | ||
# check project.version | ||
if "project" in data and "version" in data["project"]: | ||
version = data["project"]["version"] | ||
return version | ||
|
||
|
||
if __name__ == "__main__": | ||
print(get_version()) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.