Skip to content

Commit

Permalink
sys: Update version numbers on build
Browse files Browse the repository at this point in the history
  • Loading branch information
TEParsons committed Mar 31, 2024
1 parent 5ec8fad commit f8193af
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mkdocs/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mkdocs-torillic"
version = "2.0.3"
version = "{{VERSION}}"
authors = [
{name = "Todd Parsons", email = "todd.e.parsons@gmail.com"}
]
Expand Down
2 changes: 1 addition & 1 deletion sphinx/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "sphinx-torillic"
version = "2.0.3"
version = "{{VERSION}}"
authors = [
{name = "Todd Parsons", email = "todd.e.parsons@gmail.com"}
]
Expand Down
20 changes: 19 additions & 1 deletion utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
folder = Path(__file__).parent
# ref to root folder
root = folder.parent

# --- Inject base code in place of stub files ---

# ref to base folder
base = root / "base"
# find all .stub files...
Expand All @@ -22,4 +25,19 @@
# log
print(
f"Copied {base} to {target}."
)
)

# --- Update version for sub-packages ---

# ref to version file
version_file = root / "version"
# get version
version = version_file.read_text(encoding="utf-8")
# find all pyproject.toml files...
for proj in root.glob("**/pyproject.toml"):
# read file
content = proj.read_text(encoding="utf-8")
# update version
content = content.replace("{{VERSION}}", version)
# write file
proj.write_text(content)
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.3

0 comments on commit f8193af

Please sign in to comment.