Skip to content

Commit eee0aff

Browse files
pre-commit-ci[bot]robtaylor
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6ad043a commit eee0aff

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

src/poetry/core/masonry/builders/wheel.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ def _build(self, wheel: zipfile.ZipFile) -> None:
185185
python_version_minor = sys.version_info[1]
186186
build_dir = self._path / "build"
187187
libs: list[Path] = list(build_dir.glob("lib.*"))
188-
scripts: list[Path] = list(build_dir.glob(f"scripts-{python_version_major}.{python_version_minor}/*"))
188+
scripts: list[Path] = list(
189+
build_dir.glob(
190+
f"scripts-{python_version_major}.{python_version_minor}/*"
191+
)
192+
)
189193
if libs:
190194
lib = libs[0]
191195

@@ -208,10 +212,13 @@ def _build(self, wheel: zipfile.ZipFile) -> None:
208212
self._add_file(
209213
wheel,
210214
abs_path,
211-
Path.joinpath(Path(self.wheel_data_folder), "scripts", abs_path.name),
215+
Path.joinpath(
216+
Path(self.wheel_data_folder),
217+
"scripts",
218+
abs_path.name,
219+
),
212220
)
213221

214-
215222
# The result of building the extensions
216223
# does not exist, this may due to conditional
217224
# builds, so we assume that it's okay

tests/masonry/test_api.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,26 @@ def test_build_wheel_extended() -> None:
9393
assert whl.exists()
9494
validate_wheel_contents(name="extended", version="0.1", path=whl.as_posix())
9595

96+
9697
@pytest.mark.skipif(
9798
sys.platform == "win32"
9899
and sys.version_info <= (3, 6)
99100
or platform.python_implementation().lower() == "pypy",
100101
reason="Disable test on Windows for Python <=3.6 and for PyPy",
101102
)
102103
def test_build_wheel_script_generated() -> None:
103-
with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "script_generated")):
104+
with temporary_directory() as tmp_dir, cwd(
105+
os.path.join(fixtures, "script_generated")
106+
):
104107
filename = api.build_wheel(tmp_dir)
105108
whl = Path(tmp_dir) / filename
106109
assert whl.exists()
107-
validate_wheel_contents(name="script_generated", version="0.1", path=whl.as_posix(), data_files=["scripts/file.py"])
110+
validate_wheel_contents(
111+
name="script_generated",
112+
version="0.1",
113+
path=whl.as_posix(),
114+
data_files=["scripts/file.py"],
115+
)
108116

109117

110118
def test_build_sdist() -> None:

tests/testutils.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ def subprocess_run(*args: str, **kwargs: Any) -> subprocess.CompletedProcess[str
6060

6161

6262
def validate_wheel_contents(
63-
name: str, version: str, path: str, files: list[str] | None = None, data_files: list[str] | None = None
63+
name: str,
64+
version: str,
65+
path: str,
66+
files: list[str] | None = None,
67+
data_files: list[str] | None = None,
6468
) -> None:
6569
dist_info = f"{name}-{version}.dist-info"
6670
dist_data = f"{name}-{version}.data"

0 commit comments

Comments
 (0)