Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: correct __version__ in hugr.py #1085

Merged
merged 4 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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