diff --git a/.gitignore b/.gitignore index 0495ac7..460933e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -/tabulate/version.py - build dist .tox diff --git a/HOWTOPUBLISH b/HOWTOPUBLISH index 24203de..4e5292c 100644 --- a/HOWTOPUBLISH +++ b/HOWTOPUBLISH @@ -3,12 +3,10 @@ python -m pre_commit run -a # and then commit changes tox -e py310-extra,py311-extra,py312-extra,py313-extra,py314-extra # tag version release (vX.Y.Z) python -m pip install build twine -python -m build -s # this will update tabulate/_version.py python -m pip install . # install tabulate in the current venv python -m pip install -r benchmark/requirements.txt python benchmark/benchmark.py # then update README # move tag to the last commit -python -m build -s # update tabulate/_version.py python -m build -nswx . git push # wait for all CI builds to succeed git push --tags # if CI builds succeed diff --git a/pyproject.toml b/pyproject.toml index 2a80daa..c982198 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["flit>=3.12", "flit_scm"] +requires = ["flit_core>=3.12", "flit_scm"] build-backend = "flit_scm:buildapi" [project] @@ -32,13 +32,6 @@ widechars = ["wcwidth>=0.6.0"] [project.scripts] tabulate = "tabulate:_main" -[tool.flit.sdist] -include = ["CHANGELOG", "test/", "tox.ini"] -exclude = ["tabulate/_version.py"] - -[tool.setuptools_scm] -write_to = "tabulate/_version.py" - [dependency-groups] dev = [ "build>=1.4.0", @@ -48,9 +41,13 @@ dev = [ "twine>=6.2.0", ] +[tool.setuptools_scm] + +[tool.flit.sdist] +include = ["CHANGELOG", "test/", "tox.ini"] + [tool.ruff] line-length = 99 -exclude = ["tabulate/_version.py"] [tool.ruff.lint] extend-select = ["W", "ISC", "I", "C90"] diff --git a/tabulate/__init__.py b/tabulate/__init__.py index b0810a9..4154e5f 100644 --- a/tabulate/__init__.py +++ b/tabulate/__init__.py @@ -8,10 +8,7 @@ try: __version__ = _version("tabulate") except _PackageNotFoundError: - try: - from .version import version as __version__ # noqa: F401 - except ImportError: - __version__ = "unknown" + __version__ = "unknown" from collections import namedtuple from collections.abc import Iterable, Sized