From 5861e35460d7ee37d1bd888e7a8fc60a283a382a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 20 Jan 2023 16:18:24 +0100 Subject: [PATCH 1/2] Remove setuptools mention from README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is mostly related to the upcoming switch to `flit_core` but even with `setuptools` backend, building through `build` does not require `setuptools` to be installed on the host system — `build` installs the build backend locally in a venv. --- README-dist.rst | 2 -- README.rst | 2 -- 2 files changed, 4 deletions(-) diff --git a/README-dist.rst b/README-dist.rst index 9f8d3b9..bf513f8 100644 --- a/README-dist.rst +++ b/README-dist.rst @@ -137,7 +137,6 @@ Installation required: - `build`_ (>=0.6.0) -- `setuptools`_ (>=40.8.0) *pathspec* can then be built and installed with:: @@ -146,7 +145,6 @@ required: .. _`PyPI`: http://pypi.python.org/pypi/pathspec .. _`build`: https://pypi.org/project/build/ -.. _`setuptools`: https://pypi.org/project/setuptools/ Documentation diff --git a/README.rst b/README.rst index 0d86f06..e934d40 100644 --- a/README.rst +++ b/README.rst @@ -137,7 +137,6 @@ Installation required: - `build`_ (>=0.6.0) -- `setuptools`_ (>=40.8.0) *pathspec* can then be built and installed with:: @@ -146,7 +145,6 @@ required: .. _`PyPI`: http://pypi.python.org/pypi/pathspec .. _`build`: https://pypi.org/project/build/ -.. _`setuptools`: https://pypi.org/project/setuptools/ Documentation From 8608ab5b6795bdaf3239ff13cc7c9cc7f957a0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 20 Jan 2023 16:19:29 +0100 Subject: [PATCH 2/2] Switch the build system to flit_core Fixes #72 --- prebuild.py | 6 +++--- pyproject.toml | 10 ++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/prebuild.py b/prebuild.py index 30426dc..9c5a2bf 100644 --- a/prebuild.py +++ b/prebuild.py @@ -50,16 +50,16 @@ def generate_setup_cfg() -> None: 'long_description_content_type': "text/x-rst", 'name': config['project']['name'], 'url': config['project']['urls']['Source Code'], - 'version': f"attr: {config['tool']['setuptools']['dynamic']['version']['attr']}", + 'version': "attr: pathspec._meta.__version__", } output['options'] = { 'packages': "find:", 'python_requires': config['project']['requires-python'], - 'setup_requires': ", ".join(config['build-system']['requires']), + 'setup_requires': "setuptools>=40.8.0", 'test_suite': "tests", } output['options.packages.find'] = { - 'include': ", ".join(config['tool']['setuptools']['packages']['find']['include']) + 'include': "pathspec, pathspec.*", } with open("setup.cfg", 'w', encoding='utf8') as fh: diff --git a/pyproject.toml b/pyproject.toml index ccd9265..fac42f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -build-backend = "setuptools.build_meta" -requires = ["setuptools>=40.8.0"] +build-backend = "flit_core.buildapi" +requires = ["flit_core >=3.2,<4"] [project] authors = [ @@ -34,9 +34,3 @@ requires-python = ">=3.7" "Source Code" = "https://github.com/cpburnz/python-pathspec" "Documentation" = "https://python-path-specification.readthedocs.io/en/latest/index.html" "Issue Tracker" = "https://github.com/cpburnz/python-pathspec/issues" - -[tool.setuptools.dynamic] -version = {attr = "pathspec._meta.__version__"} - -[tool.setuptools.packages.find] -include = ["pathspec", "pathspec.*"]