Skip to content

Commit

Permalink
Minimally migrate to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jun 30, 2024
1 parent 37da768 commit b05dc6a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 52 deletions.
42 changes: 40 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
[build-system]
# Must be kept in sync with `setup_requirements` in `setup.py`
# Must be kept in sync with `dependencies` below
requires = [
"setuptools>=40.8.0",
"setuptools>=61.0.0",
"wheel",
"cffi>=1.4.1; platform_python_implementation != 'PyPy'",
]
build-backend = "setuptools.build_meta"

[project]
dynamic = ["readme"]

name = "PyNaCl"
# Must be kept in sync with `src/nacl/__init__.py`
version = "1.6.0.dev1"
authors = [
{name = "The PyNaCl developers", email = "[email protected]"}
]
description = "Python binding to the Networking and Cryptography (NaCl) library"
license = {text = "Apache-2.0"}
classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"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",
]
requires-python = ">=3.6"
dependencies = [
"cffi>=1.4.1; platform_python_implementation != 'PyPy'"
]

[project.optional-dependencies]
tests = [
"pytest>=3.2.1,!=3.3.0",
"hypothesis>=3.27.0",
]
docs = [
"sphinx<7",
"sphinx_rtd_theme"
]

[tool.black]
line-length = 79
target-version = ["py36"]
Expand Down
35 changes: 0 additions & 35 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,12 @@
from setuptools.command.build_ext import build_ext as _build_ext


requirements = []
setup_requirements = ["setuptools"]
test_requirements = [
"pytest>=3.2.1,!=3.3.0",
"hypothesis>=3.27.0",
]
docs_requirements = ["sphinx<7", "sphinx_rtd_theme"]


if platform.python_implementation() == "PyPy":
if sys.pypy_version_info < (2, 6):
raise RuntimeError(
"PyNaCl is not compatible with PyPy < 2.6. Please "
"upgrade PyPy to use this library."
)
else:
requirements.append("cffi>=1.4.1")
setup_requirements.append("cffi>=1.4.1")


def here(*paths):
Expand Down Expand Up @@ -194,19 +182,8 @@ def run(self):


setup(
name=nacl.__title__,
version=nacl.__version__,
description=nacl.__summary__,
long_description="\n".join((README, INSTALL, CHANGELOG)),
url=nacl.__uri__,
license=nacl.__license__,
author=nacl.__author__,
author_email=nacl.__email__,
python_requires=">=3.6",
setup_requires=setup_requirements,
install_requires=requirements,
extras_require={"tests": test_requirements, "docs": docs_requirements},
tests_require=test_requirements,
package_dir={"": "src"},
packages=["nacl", "nacl.pwhash", "nacl.bindings"],
package_data={"nacl": ["py.typed"]},
Expand All @@ -215,16 +192,4 @@ def run(self):
cmdclass={"build_clib": build_clib, "build_ext": build_ext},
distclass=Distribution,
zip_safe=False,
classifiers=[
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"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",
],
)
16 changes: 1 addition & 15 deletions src/nacl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,12 @@


__all__ = [
"__title__",
"__summary__",
"__uri__",
"__version__",
"__author__",
"__email__",
"__license__",
"__copyright__",
]

__title__ = "PyNaCl"
__summary__ = (
"Python binding to the Networking and Cryptography (NaCl) library"
)
__uri__ = "https://github.com/pyca/pynacl/"

# Must be kept in sync with `pyproject.toml`
__version__ = "1.6.0.dev1"

__author__ = "The PyNaCl developers"
__email__ = "[email protected]"

__license__ = "Apache License 2.0"
__copyright__ = "Copyright 2013-2018 {}".format(__author__)

0 comments on commit b05dc6a

Please sign in to comment.