From dd9e040e20dcbac18edc275cd4e0c4a366d75bde Mon Sep 17 00:00:00 2001 From: nicoo Date: Sat, 12 Nov 2022 22:55:21 +0100 Subject: [PATCH 1/2] Drop spurious setup requirements Since setuptools 46.4.0 (May 2020), `attr:` are statically extracted using the `ast` module if possible: https://github.com/pypa/setuptools/pull/1753 --- pyproject.toml | 2 +- setup.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 78f6535f..4b0aac2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] # Minimum requirements for the build system to execute. -requires = ["setuptools", "wheel"] # PEP 508 specifications. +requires = ["setuptools>=46.4.0", "wheel"] # PEP 508 specifications. # Actually tell PEP517 tools to call setuptools build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 257640f6..032a0a07 100755 --- a/setup.py +++ b/setup.py @@ -15,8 +15,7 @@ def requirements(section=None): # See setup.cfg for the actual configuration. setup( - # setup needs to be able to import the library, for attr: to work - setup_requires=requirements() + ['pytest-runner'], + setup_requires=['pytest-runner'], install_requires=requirements(), tests_require=requirements('tests'), ) From 43383c7118cb9f633dd0db7f85897c881337deab Mon Sep 17 00:00:00 2001 From: nicoo Date: Sat, 12 Nov 2022 23:06:24 +0100 Subject: [PATCH 2/2] Move dependency options to setup.cfg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can now get rid of setup.py! 🎉 --- setup.cfg | 6 ++++++ setup.py | 21 --------------------- 2 files changed, 6 insertions(+), 21 deletions(-) delete mode 100755 setup.py diff --git a/setup.cfg b/setup.cfg index 05936ff3..ecc3f5b6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,6 +23,12 @@ classifiers = [options] packages = ppb_vector python_requires = >= 3.7 + +setup_requires = + pytest-runner +install_requires = file: requirements.txt +test_requires = file: requirements-tests.txt + zip_safe = True [aliases] diff --git a/setup.py b/setup.py deleted file mode 100755 index 032a0a07..00000000 --- a/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -from setuptools import setup - - -def requirements(section=None): - """Helper for loading dependencies from requirements files.""" - if section is None: - filename = "requirements.txt" - else: - filename = f"requirements-{section}.txt" - - with open(filename) as file: - return [line.strip() for line in file] - - -# See setup.cfg for the actual configuration. -setup( - setup_requires=['pytest-runner'], - install_requires=requirements(), - tests_require=requirements('tests'), -)