Skip to content

Commit

Permalink
Set pyk version with importlib.metadata.version (#4615)
Browse files Browse the repository at this point in the history
Closes #4614

Uses `importlib.metadata.version` to read the version from
`pyproject.toml` rather than manually `sed`ding.
  • Loading branch information
Scott-Guest authored Sep 2, 2024
1 parent 07685d9 commit c6ea4fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion package/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ version_sub() {
sed --in-place 's/^version = ".*"$/version = "'${version}'"/' pyk/pyproject.toml
sed --in-place "s/^version = '.*'$/version = '${version}'/" pyk/docs/conf.py
sed --in-place "s/^release = '.*'$/release = '${version}'/" pyk/docs/conf.py
sed --in-place "s/^__version__: Final = '.*'/__version__: Final = '${version}'/" pyk/src/pyk/__init__.py
}

version_command="$1" ; shift
Expand Down
3 changes: 2 additions & 1 deletion pyk/src/pyk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

from importlib.metadata import version
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import Final


__version__: Final = '7.1.0'
__version__: Final = version('kframework')

0 comments on commit c6ea4fa

Please sign in to comment.