Skip to content

Commit

Permalink
chore: correct __version__ in hugr.py
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q committed May 20, 2024
1 parent bcffabd commit fd75380
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 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.0.a1"


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
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
6 changes: 5 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"package-name": "hugr",
"include-component-in-tag": true,
"draft": false,
"prerelease": false
"prerelease": false,
"extra-files": [{
"type": "generic",
"path": "hugr-py/src/__init__.py"
}]
}
},
"changelog-sections": [
Expand Down

0 comments on commit fd75380

Please sign in to comment.