From 38e1200510de8fadc872e90934e9f963a6ef7459 Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Sun, 15 Dec 2024 18:57:10 +0800 Subject: [PATCH] Introduce pyproject.toml It declares the project-level metadata (previously found in setup.py), declares setuptools as its build system, and includes the contents of the now removed pytest.ini. Signed-off-by: Rodrigo Tobar --- CHANGELOG.md | 5 +++++ pyproject.toml | 36 ++++++++++++++++++++++++++++++++++++ pytest.ini | 3 --- setup.py | 30 ------------------------------ 4 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 pyproject.toml delete mode 100644 pytest.ini diff --git a/CHANGELOG.md b/CHANGELOG.md index 120af67..059b908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Development +* Use `pyproject.toml` to declare project metadata and configuration, + including declaring its build dependency and build system (setuptools), + moving most static content from `setup.py` to `pyproject.toml`, + and moving the `pytest` configuration out from `pytest.ini` too. + ## [2.7.1] * Actually advertise that our C extension supports diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..abb260b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "crc32c" +version = "2.7.1" +authors = [ + { name = "Rodrigo Tobar", email = "rtobar@icrar.org" }, +] +description = "A python package implementing the crc32c algorithm in hardware and software" +readme = "README.rst" +license = { text = "LGPL-2.1-or-later" } +requires-python = ">=3.7" +classifiers = [ + # There's no more specific classifier for LGPLv2.1+ + "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", + "Operating System :: OS Independent", + "Programming Language :: C", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] + +[project.urls] +github = "https://github.com/ICRAR/crc32c" +changelog = "https://github.com/ICRAR/crc32c/blob/master/CHANGELOG.md" +issues = "https://github.com/ICRAR/crc32c/issues" + +[tool.pytest.ini_options] +markers = + calculates_crc32c: Mark a test as needing crc32c working diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 5ba52e2..0000000 --- a/pytest.ini +++ /dev/null @@ -1,3 +0,0 @@ -[pytest] -markers = - calculates_crc32c: Mark a test as needing crc32c working diff --git a/setup.py b/setup.py index 4231067..59ce516 100644 --- a/setup.py +++ b/setup.py @@ -32,40 +32,10 @@ include_dirs=["src/cc32c/ext/"], ) -classifiers = [ - # There's no more specific classifier for LGPLv2.1+ - "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", - "Operating System :: OS Independent", - "Programming Language :: C", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", -] - -with open("README.rst", "rt") as f: - long_description = f.read() - setup( - name="crc32c", - author="The ICRAR DIA Team", - url="https://github.com/ICRAR/crc32c", - author_email="rtobar@icrar.org", - version="2.7.1", - license="LGPL-2.1-or-later", - description=( - "A python package implementing the crc32c algorithm" " in hardware and software" - ), - long_description=long_description, - long_description_content_type="text/x-rst", - classifiers=classifiers, packages=["crc32c"], package_dir={"": "src"}, package_data={"crc32c": ["*.pyi", "py.typed", "ext/*.h"]}, - python_requires=">=3.7", ext_modules=[crcmod_ext], test_suite="test", )