From f6bd86857d49525a2a5d3c221f3bde1077b745be Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Tue, 4 Feb 2025 12:20:56 +0100 Subject: [PATCH] build: move version to pyproject.toml --- pyproject.toml | 15 +++------------ src/re3data/__about__.py | 5 ----- src/re3data/__init__.py | 5 ++++- 3 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 src/re3data/__about__.py diff --git a/pyproject.toml b/pyproject.toml index d062044..0f952ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,7 @@ requires = [ [project] name = "python-re3data" +version = "0.10.0" description = "The Pythonic client for the re3data API." readme = "README.md" keywords = [ @@ -39,9 +40,6 @@ classifiers = [ "Topic :: Text Processing :: Markup :: XML", "Typing :: Typed", ] -dynamic = [ - "version", -] dependencies = [ "httpx>=0.27", "xsdata>=24.5", @@ -98,9 +96,6 @@ packages = [ "src/re3data", ] -[tool.hatch.version] -path = "src/re3data/__about__.py" - [tool.hatch.env] requires = [ "hatch-pip-compile", @@ -198,9 +193,6 @@ lint.ignore = [ "D105", # undocumented-magic-method "D107", # undocumented-public-init ] -lint.per-file-ignores."src/re3data/__about__.py" = [ - "D100", # undocumented-public-module -] lint.per-file-ignores."src/re3data/_resources/*.py" = [ "D101", # undocumented-public-class "D106", # undocumented-public-nested-class @@ -250,7 +242,6 @@ source = [ "re3data", ] omit = [ - "__about__.py", "__main__.py", ] @@ -304,8 +295,8 @@ commit_author = "github-actions[bot] <41898282+github-actions[bot]@users.noreply commit_message = "chore: release {version}\n\nAutomatically generated by python-semantic-release [skip ci]" major_on_zero = false tag_format = "{version}" -version_variables = [ - "src/re3data/__about__.py:__version__", +version_toml = [ + "pyproject.toml:project.version", ] build_command = ''' sed -i "s/^version: .*/version: $NEW_VERSION/" CITATION.cff diff --git a/src/re3data/__about__.py b/src/re3data/__about__.py deleted file mode 100644 index 354798b..0000000 --- a/src/re3data/__about__.py +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2024 Heinz-Alexander Fütterer -# -# SPDX-License-Identifier: MIT - -__version__ = "0.10.0" diff --git a/src/re3data/__init__.py b/src/re3data/__init__.py index 1f3955e..a719eb9 100644 --- a/src/re3data/__init__.py +++ b/src/re3data/__init__.py @@ -4,7 +4,10 @@ """python-re3data.""" -from re3data.__about__ import __version__ +from importlib.metadata import version + +__version__: str = version("python-re3data") + from re3data._client import AsyncClient, Client, ReturnType from re3data._exceptions import Re3dataError, RepositoryNotFoundError from re3data._resources import Re3Data, Repository, RepositoryList, RepositorySummary