Skip to content

Commit e91387b

Browse files
committed
Rely on hatchling's default version-source settings
[tool.hatch.version] only needs the path — source = 'regex' is the default, and hatch's default pattern matches plain __version__ = "…" assignments. Drop the type annotation from __version__ in _version.py (keep them on __commit__ / __branch__ where they still convey useful optionality) so the default pattern matches. Update the publish workflow to emit the same unannotated __version__ line.
1 parent 8a504f1 commit e91387b

5 files changed

Lines changed: 3 additions & 7 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
# in the wheel metadata.
7676
run: |
7777
cat > ${{ matrix.source_dir }}/_version.py <<EOF
78-
__version__: str = "${{ steps.version.outputs.version }}"
78+
__version__ = "${{ steps.version.outputs.version }}"
7979
__commit__: str | None = "${{ steps.version.outputs.commit }}"
8080
__branch__: str | None = "${{ steps.version.outputs.branch }}"
8181
EOF

packages/palace-opds/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ packages = ["src/palace"]
2626

2727
[tool.hatch.version]
2828
path = "src/palace/opds/_version.py"
29-
pattern = '__version__: str = "(?P<version>[^"]+)"'
30-
source = "regex"
3129

3230
[tool.isort]
3331
combine_as_imports = true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__: str = "0.0.0.dev0"
1+
__version__ = "0.0.0.dev0"
22
__commit__: str | None = None
33
__branch__: str | None = None

packages/palace-util/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ packages = ["src/palace"]
2323

2424
[tool.hatch.version]
2525
path = "src/palace/util/_version.py"
26-
pattern = '__version__: str = "(?P<version>[^"]+)"'
27-
source = "regex"
2826

2927
[tool.isort]
3028
combine_as_imports = true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__: str = "0.0.0.dev0"
1+
__version__ = "0.0.0.dev0"
22
__commit__: str | None = None
33
__branch__: str | None = None

0 commit comments

Comments
 (0)