Skip to content

Commit

Permalink
chore: correct __version__ in hugr.py (#1085)
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q authored May 21, 2024
1 parent 02f3864 commit 14ab387
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
4 changes: 3 additions & 1 deletion hugr-py/src/hugr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
representation.
"""

__version__ = "0.2.0a1"
# This is updated by our release-please workflow, triggered by this
# annotation: x-release-please-version
__version__ = "0.2.1"


def it_works() -> str:
Expand Down
16 changes: 16 additions & 0 deletions hugr-py/tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# from https://github.com/python-poetry/poetry/issues/144#issuecomment-877835259
import toml # type: ignore[import-untyped]
from pathlib import Path
import hugr


def test_versions_are_in_sync():
"""Checks if the pyproject.toml and package.__init__.py __version__ are in sync."""

path = Path(__file__).resolve().parents[1] / "pyproject.toml"
pyproject = toml.loads(open(str(path)).read())
pyproject_version = pyproject["tool"]["poetry"]["version"]

package_init_version = hugr.__version__

assert package_init_version == pyproject_version
15 changes: 13 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pytest = "^8.1.1"
pytest-cov = "^4.1.0"
mypy = "^1.9.0"
ruff = "^0.3.3"
toml = "^0.10.0"

[tool.poetry.group.hugr.dependencies]
hugr = { path = "hugr-py", develop = true }
Expand Down

0 comments on commit 14ab387

Please sign in to comment.