mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Migrate a bit more logic to pyproject.toml (#9489)
This commit is contained in:
parent
2879af1e81
commit
afc06e28f2
2 changed files with 10 additions and 29 deletions
|
|
@ -6,7 +6,7 @@ requires = [
|
||||||
"wheel",
|
"wheel",
|
||||||
# Must be kept in sync with `project.dependencies`
|
# Must be kept in sync with `project.dependencies`
|
||||||
"cffi>=1.12; platform_python_implementation != 'PyPy'",
|
"cffi>=1.12; platform_python_implementation != 'PyPy'",
|
||||||
"setuptools-rust>=0.11.4",
|
"setuptools-rust>=1.7.0",
|
||||||
]
|
]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
|
@ -81,6 +81,13 @@ docstest = ["pyenchant >=1.6.11", "twine >=1.12.0", "sphinxcontrib-spelling >=4
|
||||||
sdist = ["build"]
|
sdist = ["build"]
|
||||||
pep8test = ["black", "ruff", "mypy", "check-sdist"]
|
pep8test = ["black", "ruff", "mypy", "check-sdist"]
|
||||||
|
|
||||||
|
[[tool.setuptools-rust.ext-modules]]
|
||||||
|
target = "cryptography.hazmat.bindings._rust"
|
||||||
|
path = "src/rust/Cargo.toml"
|
||||||
|
py-limited-api = true
|
||||||
|
rust-version = ">=1.63.0"
|
||||||
|
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 79
|
line-length = 79
|
||||||
target-version = ["py37"]
|
target-version = ["py37"]
|
||||||
|
|
|
||||||
30
setup.py
30
setup.py
|
|
@ -14,23 +14,6 @@ import warnings
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
try:
|
|
||||||
from setuptools_rust import RustExtension
|
|
||||||
except ImportError:
|
|
||||||
print(
|
|
||||||
"""
|
|
||||||
=============================DEBUG ASSISTANCE==========================
|
|
||||||
If you are seeing an error here please try the following to
|
|
||||||
successfully install cryptography:
|
|
||||||
|
|
||||||
Upgrade to the latest pip and try again. This will fix errors for most
|
|
||||||
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
|
|
||||||
=============================DEBUG ASSISTANCE==========================
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
raise
|
|
||||||
|
|
||||||
|
|
||||||
# distutils emits this warning if you pass `setup()` an unknown option. This
|
# distutils emits this warning if you pass `setup()` an unknown option. This
|
||||||
# is what happens if you somehow run this file without `cffi` installed:
|
# is what happens if you somehow run this file without `cffi` installed:
|
||||||
# `cffi_modules` is an unknown option.
|
# `cffi_modules` is an unknown option.
|
||||||
|
|
@ -47,17 +30,8 @@ if hasattr(sys, "pypy_version_info") and sys.pypy_version_info < (7, 3, 10):
|
||||||
raise RuntimeError("cryptography is not compatible with PyPy3 < 7.3.10")
|
raise RuntimeError("cryptography is not compatible with PyPy3 < 7.3.10")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# See pyproject.toml for most of the config metadata.
|
# See pyproject.toml for the config metadata.
|
||||||
setup(
|
setup()
|
||||||
rust_extensions=[
|
|
||||||
RustExtension(
|
|
||||||
"cryptography.hazmat.bindings._rust",
|
|
||||||
"src/rust/Cargo.toml",
|
|
||||||
py_limited_api=True,
|
|
||||||
rust_version=">=1.63.0",
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
except:
|
except:
|
||||||
# Note: This is a bare exception that re-raises so that we don't interfere
|
# Note: This is a bare exception that re-raises so that we don't interfere
|
||||||
# with anything the installation machinery might want to do. Because we
|
# with anything the installation machinery might want to do. Because we
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue