Skip to content

Commit

Permalink
Merge pull request #267 from polywrap/dev
Browse files Browse the repository at this point in the history
prep 0.1.1 | /workflows/cd
  • Loading branch information
Niraj-Kamdar authored Sep 6, 2023
2 parents 2750910 + 38d66dc commit 0cbb375
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/publish_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
logger = ColoredLogger("PackagePublisher")


def extract_major_minor(version: str) -> str:
return ".".join(version.split(".")[:2] + ["0"])


def patch_version(version: str):
with open("pyproject.toml", "r") as f:
pyproject = tomlkit.load(f)
Expand All @@ -22,7 +26,7 @@ def patch_version(version: str):
for dep in list(pyproject["tool"]["poetry"]["dependencies"].keys()):
if dep.startswith("polywrap-"):
pyproject["tool"]["poetry"]["dependencies"].pop(dep)
pyproject["tool"]["poetry"]["dependencies"].add(dep, f"^{version}")
pyproject["tool"]["poetry"]["dependencies"].add(dep, f"^{extract_major_minor(version)}")

with open("pyproject.toml", "w") as f:
tomlkit.dump(pyproject, f)
Expand Down

0 comments on commit 0cbb375

Please sign in to comment.