Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 24, 2024
1 parent 2f77339 commit cb140a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/wheel/bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ class bdist_wheel(Command):
None,
"directory where a pre-generated dist-info can be found (e.g. as a "
"result of calling the PEP517 'prepare_metadata_for_build_wheel' "
"method)"),
"method)",
),
]

boolean_options = ["keep-temp", "skip-build", "relative", "universal"]
Expand Down
19 changes: 12 additions & 7 deletions tests/test_bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,28 @@ def test_dist_info_provided(dummy_dist, monkeypatch, tmp_path):
monkeypatch.chdir(dummy_dist)
distinfo = tmp_path / "dummy_dist.dist-info"
distinfo.mkdir()
(distinfo / 'METADATA').write_text("name: helloworld", encoding="utf-8")
(distinfo / "METADATA").write_text("name: helloworld", encoding="utf-8")

# We don't control the metadata. According to PEP-517, "The hook MAY also
# create other files inside this directory, and a build frontend MUST
# preserve".
(distinfo / 'FOO').write_text("bar", encoding="utf-8")
(distinfo / "FOO").write_text("bar", encoding="utf-8")
subprocess.check_call(
[
sys.executable, "setup.py", "bdist_wheel",
"-b", str(tmp_path), "--universal",
"--dist-info-dir", str(distinfo),
sys.executable,
"setup.py",
"bdist_wheel",
"-b",
str(tmp_path),
"--universal",
"--dist-info-dir",
str(distinfo),
],
)
with WheelFile("dist/dummy_dist-1.0-py2.py3-none-any.whl") as wf:
with wf.open("dummy_dist-1.0.dist-info/METADATA") as fh:
assert fh.read() == b'name: helloworld'
assert 'dummy_dist-1.0.dist-info/FOO' in list(wf.namelist())
assert fh.read() == b"name: helloworld"
assert "dummy_dist-1.0.dist-info/FOO" in list(wf.namelist())


def test_licenses_default(dummy_dist, monkeypatch, tmp_path):
Expand Down

0 comments on commit cb140a6

Please sign in to comment.