From ab2594f1ce268fb72486b5e57a2cee89e732905b Mon Sep 17 00:00:00 2001 From: Ed Summers Date: Mon, 29 Jul 2024 10:46:54 -0400 Subject: [PATCH] Use pyproject.toml setuptools has [deprecated] the test command for the past five years and recently removed it. This caused [quite a stir] since many people's build broke. Our build of [pywb] failed because surt is still using setuptools.test. I thought perhaps this would be a good time to removing that dependency and given adoption of [PEP-621] perhaps now is a good time to switch over to using a `pyproject.toml` file? [deprecated]: https://github.com/pypa/setuptools/issues/1684 [quite a stir]: https://github.com/pypa/setuptools/issues/4519 [pywb]: https://github.com/webrecorder/pywb [PEP-621]: https://peps.python.org/pep-0621/ --- pyproject.toml | 17 +++++++++++++++++ setup.py | 39 --------------------------------------- tox.ini | 2 +- 3 files changed, 18 insertions(+), 40 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6cd8eed --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "surt" +version = "0.3.1" +description = "Sort-friendly URI Reordering Transform (SURT) python package." +authors = [ + {name = "rajbot", email = "raj@archive.org"} +] +license = {text = "GNU Affero General Public License v3"} +readme = "README.md" +dependencies = [ + "six", + "tldextract>=2.0" +] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py deleted file mode 100644 index 14591c5..0000000 --- a/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -from setuptools import setup -from setuptools.command.test import test as TestCommand - -class PyTest(TestCommand): - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_suite = True - - def run_tests(self): - import pytest - import sys - cmdline = ' -v --cov surt tests/' - errcode = pytest.main(cmdline) - sys.exit(errcode) - - -setup(name='surt', - version='0.3.1', - author='rajbot', - author_email='raj@archive.org', - classifiers=[ - 'License :: OSI Approved :: GNU Affero General Public License v3', - ], - description='Sort-friendly URI Reordering Transform (SURT) python package.', - long_description=open('README.rst').read(), - url='https://github.com/internetarchive/surt', - zip_safe=True, - install_requires=[ - 'six', - 'tldextract>=2.0', - ], - provides=[ 'surt' ], - packages=[ 'surt' ], - scripts=[], - # Tests - tests_require=[ 'pytest', 'pytest-cov' ], - test_suite='', - cmdclass={'test': PyTest}, - ) diff --git a/tox.ini b/tox.ini index a92e22f..8aaf030 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ [tox] envlist = py26, py27, - py33, py34, py35, py36 + py33, py34, py35, py36, py312 pypy, pypy3, [testenv]