Skip to content

Commit

Permalink
Bump version to 0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Feb 20, 2024
1 parent e6b74c8 commit 158680b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion narwhals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
from narwhals.translate import to_original_object
from narwhals.translate import to_polars_api

__version__ = "0.2.6"
__version__ = "0.1.8"

__all__ = ["to_polars_api", "to_original_object", "get_namespace", "containers"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "narwhals"
version = "0.1.7"
version = "0.1.8"
authors = [
{ name="Marco Gorelli", email="[email protected]" },
]
Expand Down
34 changes: 34 additions & 0 deletions utils/bump_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# mypy: ignore
# ruff: noqa
import re
import subprocess
import sys

how = sys.argv[1]

with open("pyproject.toml", encoding="utf-8") as f:
content = f.read()
old_version = re.search(r'version = "(.*)"', content).group(1)
version = old_version.split(".")
if how == "patch":
version = ".".join(version[:-1] + [str(int(version[-1]) + 1)])
elif how == "minor":
version = ".".join(version[:-2] + [str(int(version[-2]) + 1), "0"])
elif how == "major":
version = ".".join([str(int(version[0]) + 1), "0", "0"])
content = content.replace(f'version = "{old_version}"', f'version = "{version}"')
with open("pyproject.toml", "w", encoding="utf-8") as f:
f.write(content)

with open("narwhals/__init__.py", encoding="utf-8") as f:
content = f.read()
content = content.replace(
f'__version__ = "{old_version}"',
f'__version__ = "{version}"',
)
with open("narwhals/__init__.py", "w", encoding="utf-8") as f:
f.write(content)

subprocess.run(["git", "commit", "-a", "-m", f"Bump version to {version}"])
subprocess.run(["git", "tag", "-a", version, "-m", version])
subprocess.run(["git", "push", "--follow-tags"])

0 comments on commit 158680b

Please sign in to comment.