Skip to content

Commit 0246c2e

Browse files
committed
Relint the codebase
1 parent 49608b6 commit 0246c2e

File tree

3 files changed

+37
-10
lines changed

3 files changed

+37
-10
lines changed

src/appose/builder/pixi.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ def build(self) -> Environment:
103103
if self._content is not None:
104104
if self._scheme is None:
105105
self._scheme = scheme_from_content(self._content)
106-
if self._scheme.name() not in ["pixi.toml", "pyproject.toml", "environment.yml"]:
106+
if self._scheme.name() not in [
107+
"pixi.toml",
108+
"pyproject.toml",
109+
"environment.yml",
110+
]:
107111
raise ValueError(
108112
f"PixiBuilder only supports pixi.toml, pyproject.toml, and environment.yml schemes, got: {self._scheme.name()}"
109113
)
@@ -333,7 +337,13 @@ def supports_scheme(self, scheme: str) -> bool:
333337
Returns:
334338
True if supported
335339
"""
336-
return scheme in ["pixi.toml", "pyproject.toml", "environment.yml", "conda", "pypi"]
340+
return scheme in [
341+
"pixi.toml",
342+
"pyproject.toml",
343+
"environment.yml",
344+
"conda",
345+
"pypi",
346+
]
337347

338348
def priority(self) -> float:
339349
"""

tests/builder/test_content.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ def test_pixi_with_pixi_toml():
125125

126126

127127
def test_pixi_with_pyproject_toml():
128-
content = (TEST_RESOURCES / "cowsay-pixi-pyproject.toml").read_text(encoding="utf-8")
128+
content = (TEST_RESOURCES / "cowsay-pixi-pyproject.toml").read_text(
129+
encoding="utf-8"
130+
)
129131
env = (
130132
appose.pixi()
131133
.content(content)
@@ -152,12 +154,16 @@ def test_pixi_with_environment_yml():
152154

153155
def test_pixi_with_requirements_txt():
154156
with pytest.raises(Exception):
155-
appose.pixi().content(REQUIREMENTS_TXT_STUB).base("target/envs/content-pixi-requirements").build()
157+
appose.pixi().content(REQUIREMENTS_TXT_STUB).base(
158+
"target/envs/content-pixi-requirements"
159+
).build()
156160

157161

158162
def test_pixi_with_unrecognized():
159163
with pytest.raises(Exception):
160-
appose.pixi().content(UNRECOGNIZED).base("target/envs/content-pixi-unknown").build()
164+
appose.pixi().content(UNRECOGNIZED).base(
165+
"target/envs/content-pixi-unknown"
166+
).build()
161167

162168

163169
# ======================== MambaBuilder ========================
@@ -178,22 +184,30 @@ def test_mamba_with_environment_yml():
178184

179185
def test_mamba_with_pyproject_toml():
180186
with pytest.raises(Exception):
181-
appose.mamba().content(PYPROJECT_TOML_STUB).base("target/envs/content-mamba-pyproject").build()
187+
appose.mamba().content(PYPROJECT_TOML_STUB).base(
188+
"target/envs/content-mamba-pyproject"
189+
).build()
182190

183191

184192
def test_mamba_with_requirements_txt():
185193
with pytest.raises(Exception):
186-
appose.mamba().content(REQUIREMENTS_TXT_STUB).base("target/envs/content-mamba-requirements").build()
194+
appose.mamba().content(REQUIREMENTS_TXT_STUB).base(
195+
"target/envs/content-mamba-requirements"
196+
).build()
187197

188198

189199
def test_mamba_with_pixi_toml():
190200
with pytest.raises(Exception):
191-
appose.mamba().content(PIXI_TOML_STUB).base("target/envs/content-mamba-pixi").build()
201+
appose.mamba().content(PIXI_TOML_STUB).base(
202+
"target/envs/content-mamba-pixi"
203+
).build()
192204

193205

194206
def test_mamba_with_unrecognized():
195207
with pytest.raises(Exception):
196-
appose.mamba().content(UNRECOGNIZED).base("target/envs/content-mamba-unknown").build()
208+
appose.mamba().content(UNRECOGNIZED).base(
209+
"target/envs/content-mamba-unknown"
210+
).build()
197211

198212

199213
# ======================== DynamicBuilder (appose.content) ========================
@@ -236,7 +250,9 @@ def test_content_with_pixi_toml():
236250

237251

238252
def test_content_with_pyproject_toml():
239-
content = (TEST_RESOURCES / "cowsay-pixi-pyproject.toml").read_text(encoding="utf-8")
253+
content = (TEST_RESOURCES / "cowsay-pixi-pyproject.toml").read_text(
254+
encoding="utf-8"
255+
)
240256
env = (
241257
appose.content(content)
242258
.base("target/envs/content-dynamic-pyproject")

tests/builder/test_pixi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def test_pixi_environment_selection():
190190
assert launch_args[idx + 1] == "alt"
191191
# Verify bin path resolves to the alt environment directory
192192
import os
193+
193194
assert os.sep + "alt" + os.sep in env.bin_paths()[0], (
194195
"bin_paths should reference the alt environment"
195196
)

0 commit comments

Comments
 (0)