Merge branch 'master' into smart_holder

This commit is contained in:
Ralf W. Grosse-Kunstleve
2021-07-13 05:57:50 -07:00
11 changed files with 195 additions and 57 deletions

View File

@@ -134,7 +134,7 @@ def test_build_sdist(monkeypatch, tmpdir):
with tarfile.open(str(sdist)) as tar:
start = tar.getnames()[0] + "/"
version = start[9:-1]
simpler = set(n.split("/", 1)[-1] for n in tar.getnames()[1:])
simpler = {n.split("/", 1)[-1] for n in tar.getnames()[1:]}
with contextlib.closing(
tar.extractfile(tar.getmember(start + "setup.py"))
@@ -146,9 +146,9 @@ def test_build_sdist(monkeypatch, tmpdir):
) as f:
pyproject_toml = f.read()
files = set("pybind11/{}".format(n) for n in all_files)
files = {"pybind11/{}".format(n) for n in all_files}
files |= sdist_files
files |= set("pybind11{}".format(n) for n in local_sdist_files)
files |= {"pybind11{}".format(n) for n in local_sdist_files}
files.add("pybind11.egg-info/entry_points.txt")
files.add("pybind11.egg-info/requires.txt")
assert simpler == files
@@ -189,7 +189,7 @@ def test_build_global_dist(monkeypatch, tmpdir):
with tarfile.open(str(sdist)) as tar:
start = tar.getnames()[0] + "/"
version = start[16:-1]
simpler = set(n.split("/", 1)[-1] for n in tar.getnames()[1:])
simpler = {n.split("/", 1)[-1] for n in tar.getnames()[1:]}
with contextlib.closing(
tar.extractfile(tar.getmember(start + "setup.py"))
@@ -201,9 +201,9 @@ def test_build_global_dist(monkeypatch, tmpdir):
) as f:
pyproject_toml = f.read()
files = set("pybind11/{}".format(n) for n in all_files)
files = {"pybind11/{}".format(n) for n in all_files}
files |= sdist_files
files |= set("pybind11_global{}".format(n) for n in local_sdist_files)
files |= {"pybind11_global{}".format(n) for n in local_sdist_files}
assert simpler == files
with open(os.path.join(MAIN_DIR, "tools", "setup_global.py.in"), "rb") as f:
@@ -228,7 +228,7 @@ def tests_build_wheel(monkeypatch, tmpdir):
(wheel,) = tmpdir.visit("*.whl")
files = set("pybind11/{}".format(n) for n in all_files)
files = {"pybind11/{}".format(n) for n in all_files}
files |= {
"dist-info/LICENSE",
"dist-info/METADATA",
@@ -241,10 +241,10 @@ def tests_build_wheel(monkeypatch, tmpdir):
with zipfile.ZipFile(str(wheel)) as z:
names = z.namelist()
trimmed = set(n for n in names if "dist-info" not in n)
trimmed |= set(
trimmed = {n for n in names if "dist-info" not in n}
trimmed |= {
"dist-info/{}".format(n.split("/", 1)[-1]) for n in names if "dist-info" in n
)
}
assert files == trimmed
@@ -258,8 +258,8 @@ def tests_build_global_wheel(monkeypatch, tmpdir):
(wheel,) = tmpdir.visit("*.whl")
files = set("data/data/{}".format(n) for n in src_files)
files |= set("data/headers/{}".format(n[8:]) for n in headers)
files = {"data/data/{}".format(n) for n in src_files}
files |= {"data/headers/{}".format(n[8:]) for n in headers}
files |= {
"dist-info/LICENSE",
"dist-info/METADATA",
@@ -272,6 +272,6 @@ def tests_build_global_wheel(monkeypatch, tmpdir):
names = z.namelist()
beginning = names[0].split("/", 1)[0].rsplit(".", 1)[0]
trimmed = set(n[len(beginning) + 1 :] for n in names)
trimmed = {n[len(beginning) + 1 :] for n in names}
assert files == trimmed