diff --git a/.circleci/config.yml b/.circleci/config.yml index 1904e2a..ac9c525 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,6 +39,16 @@ jobs: - ./venv key: v1-dependencies-{{ checksum ".circleci/requirements.txt" }} + - run: + name: build wheel + command: | + . venv/bin/activate + python -m build -nwx . + + - store_artifacts: + path: dist + destination: dist + - run: name: run tests command: | diff --git a/.circleci/requirements.txt b/.circleci/requirements.txt index 650d583..ea5e80c 100644 --- a/.circleci/requirements.txt +++ b/.circleci/requirements.txt @@ -3,3 +3,8 @@ tox numpy pandas wcwidth +setuptools +pip +build +wheel +setuptools_scm diff --git a/.gitignore b/.gitignore index 460933e..0495ac7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/tabulate/version.py + build dist .tox diff --git a/HOWTOPUBLISH b/HOWTOPUBLISH index 6730e8a..5be16ed 100644 --- a/HOWTOPUBLISH +++ b/HOWTOPUBLISH @@ -1,8 +1,7 @@ # update contributors and CHANGELOG in README +# tag version release python3 benchmark.py # then update README -tox -e py33,py34,py36-extra -python3 setup.py sdist bdist_wheel +tox -e py37-extra,py38-extra,py39-extra,py310-extra +python3 -m build -nswx . twine upload --repository-url https://test.pypi.org/legacy/ dist/* twine upload dist/* -# tag version release -# bump version number in setup.py in tabulate.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..85ede02 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +requires = ["setuptools>=61.2.0", "wheel", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "tabulate" +authors = [{name = "Sergey Astanin", email = "s.astanin@gmail.com"}] +license = {text = "MIT"} +description = "Pretty-print tabular data" +readme = "README.md" +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Software Development :: Libraries", +] +requires-python = ">=3.7" +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/astanin/python-tabulate" + +[project.optional-dependencies] +widechars = ["wcwidth"] + +[project.scripts] +tabulate = "tabulate:_main" + +[tool.setuptools] +packages = ["tabulate"] + +[tool.setuptools_scm] +write_to = "tabulate/version.py" diff --git a/setup.py b/setup.py deleted file mode 100644 index bbff185..0000000 --- a/setup.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python - -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - - -from platform import python_implementation -import os -import re - -# strip links from the description on the PyPI -LONG_DESCRIPTION = open("README.md", encoding="utf-8").read() - -# strip Build Status from the PyPI package -try: - status_re = "^Build status\n(.*\n){7}" - LONG_DESCRIPTION = re.sub(status_re, "", LONG_DESCRIPTION, flags=re.M) -except TypeError: - if python_implementation() == "IronPython": - # IronPython doesn't support flags in re.sub (IronPython issue #923) - pass - else: - raise - -install_options = os.environ.get("TABULATE_INSTALL", "").split(",") -libonly_flags = {"lib-only", "libonly", "no-cli", "without-cli"} -if libonly_flags.intersection(install_options): - console_scripts = [] -else: - console_scripts = ["tabulate = tabulate:_main"] - - -setup( - name="tabulate", - version="0.8.11", - description="Pretty-print tabular data", - long_description=LONG_DESCRIPTION, - long_description_content_type="text/markdown", - author="Sergey Astanin", - author_email="s.astanin@gmail.com", - url="https://github.com/astanin/python-tabulate", - license="MIT", - python_requires=">=3.7", - classifiers=[ - "Development Status :: 4 - Beta", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Software Development :: Libraries", - ], - py_modules=["tabulate"], - entry_points={"console_scripts": console_scripts}, - extras_require={"widechars": ["wcwidth"]}, -) diff --git a/tabulate.py b/tabulate/__init__.py similarity index 99% rename from tabulate.py rename to tabulate/__init__.py index 46f2e0d..4752585 100644 --- a/tabulate.py +++ b/tabulate/__init__.py @@ -22,7 +22,7 @@ def _is_file(f): __all__ = ["tabulate", "tabulate_formats", "simple_separated_format"] -__version__ = "0.8.11" +from .version import version as __version__ # noqa: F401 # minimum extra space in headers