Skip to content

Commit

Permalink
Introduce pyproject.toml
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rtobar committed Dec 15, 2024
1 parent 783f9a9 commit 38e1200
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 33 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" },
]
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
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

30 changes: 0 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
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",
)

0 comments on commit 38e1200

Please sign in to comment.