Skip to content

Commit

Permalink
Switch from check-manifest to check-sdist (#8846)
Browse files Browse the repository at this point in the history
The latter will work with non-setuptools build backends.
  • Loading branch information
alex authored Apr 30, 2023
1 parent 828bcf3 commit be18c83
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
9 changes: 5 additions & 4 deletions ci-constraints-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ bleach==6.0.0
# via readme-renderer
build==0.10.0
# via
# check-manifest
# check-sdist
# cryptography (pyproject.toml)
certifi==2022.12.7
# via requests
charset-normalizer==3.1.0
# via requests
check-manifest==0.49
check-sdist==0.1.2
# via cryptography (pyproject.toml)
click==8.1.3
# via black
Expand Down Expand Up @@ -84,7 +84,9 @@ packaging==23.1
# pytest
# sphinx
pathspec==0.11.1
# via black
# via
# black
# check-sdist
pkginfo==1.9.6
# via twine
platformdirs==3.5.0
Expand Down Expand Up @@ -193,4 +195,3 @@ zipp==3.15.0
# The following packages are considered to be unsafe in a requirements file:
# cffi
# pycparser
# setuptools
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def flake(session: nox.Session) -> None:

session.run("ruff", ".")
session.run("black", "--check", ".")
session.run("check-manifest")
session.run("check-sdist")
session.run(
"mypy",
"src/cryptography/",
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ test-randomorder = ["pytest-randomly"]
docs = ["sphinx >=5.3.0", "sphinx-rtd-theme >=1.1.1"]
docstest = ["pyenchant >=1.6.11", "twine >=1.12.0", "sphinxcontrib-spelling >=4.0.1"]
sdist = ["build"]
pep8test = ["black", "ruff", "mypy", "check-manifest"]
pep8test = ["black", "ruff", "mypy", "check-sdist"]

[tool.black]
line-length = 79
Expand Down Expand Up @@ -143,3 +143,12 @@ line-length = 79

[tool.ruff.isort]
known-first-party = ["cryptography", "cryptography_vectors", "tests"]

[tool.check-sdist]
git-only = [
"vectors/*",
"release.py",
"ci-constraints-requirements.txt",
".gitattributes",
".gitignore",
]
2 changes: 1 addition & 1 deletion src/_cffi_src/build_openssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
)

if __name__ == "__main__":
out_dir = os.getenv("OUT_DIR")
out_dir = os.environ["OUT_DIR"]
module_name, source, source_extension, kwds = ffi._assigned_source
c_file = os.path.join(out_dir, module_name + source_extension)
if platform.python_implementation() == "PyPy":
Expand Down
13 changes: 7 additions & 6 deletions src/_cffi_src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import platform
import sys
import typing

from cffi import FFI

Expand All @@ -18,9 +19,9 @@


def build_ffi_for_binding(
module_name,
module_prefix,
modules,
module_name: str,
module_prefix: str,
modules: typing.List[str],
):
"""
Modules listed in ``modules`` should have the following attributes:
Expand Down Expand Up @@ -54,9 +55,9 @@ def build_ffi_for_binding(


def build_ffi(
module_name,
cdef_source,
verify_source,
module_name: str,
cdef_source: str,
verify_source: str,
):
ffi = FFI()
# Always add the CRYPTOGRAPHY_PACKAGE_VERSION to the shared object
Expand Down

0 comments on commit be18c83

Please sign in to comment.