Skip to content

Commit c093e2a

Browse files
setuptools → flit
Also: - Write package version to `_version.py` instead of `version.py`. - Get rid of the `README` symlink, `README.md` is good enough nowadays. - I have deliberately removed from the sdist: hidden files, `HOWTOPUBLISH` and `benchmark`.
1 parent c26c2ef commit c093e2a

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

HOWTOPUBLISH

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ python -m pre_commit run -a # and then commit changes
33
tox -e py310-extra,py311-extra,py312-extra,py313-extra,py314-extra
44
# tag version release (vX.Y.Z)
55
python -m pip install build twine
6-
python -m build -s # this will update tabulate/version.py
6+
python -m build -s # this will update tabulate/_version.py
77
python -m pip install . # install tabulate in the current venv
88
python -m pip install -r benchmark/requirements.txt
99
python benchmark/benchmark.py # then update README
1010
# move tag to the last commit
11-
python -m build -s # update tabulate/version.py
11+
python -m build -s # update tabulate/_version.py
1212
python -m build -nswx .
1313
git push # wait for all CI builds to succeed
1414
git push --tags # if CI builds succeed

MANIFEST.in

Lines changed: 0 additions & 6 deletions
This file was deleted.

README

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["setuptools>=77.0.3", "setuptools_scm[toml]>=3.4.3"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["flit>=3.12", "flit_scm"]
3+
build-backend = "flit_scm:buildapi"
44

55
[project]
66
name = "tabulate"
@@ -32,7 +32,12 @@ widechars = ["wcwidth>=0.6.0"]
3232
[project.scripts]
3333
tabulate = "tabulate:_main"
3434

35+
[tool.flit.sdist]
36+
include = ["CHANGELOG", "test/", "tox.ini"]
37+
exclude = ["tabulate/_version.py"]
38+
3539
[tool.setuptools_scm]
40+
write_to = "tabulate/_version.py"
3641

3742
[dependency-groups]
3843
dev = [
@@ -49,6 +54,7 @@ line-length = 99
4954
[tool.ruff.lint]
5055
extend-select = ["W", "C90"]
5156
ignore = ["E721", "C901"]
57+
exclude = ["tabulate/_version.py"]
5258

5359
[tool.ruff.lint.mccabe]
5460
max-complexity = 22

tabulate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _is_file(f):
3636

3737
__all__ = ["tabulate", "tabulate_formats", "simple_separated_format"]
3838
try:
39-
from .version import version as __version__ # noqa: F401
39+
from ._version import version as __version__ # noqa: F401
4040
except ImportError:
4141
pass # running __init__.py as a script, AppVeyor pytests
4242

0 commit comments

Comments
 (0)