Skip to content

Commit 73b6523

Browse files
committed
Run the code linter
1 parent bd7b13f commit 73b6523

File tree

5 files changed

+20
-23
lines changed

5 files changed

+20
-23
lines changed

src/appose/builder/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ def create_builder(self) -> Builder:
395395
@abstractmethod
396396
def env_type(self) -> str:
397397
"""
398-
Get the environment type handled by this builder (e.g., "pixi", "mamba", "uv").
398+
Get the environment type handled by this builder (e.g., "pixi", "mamba", "uv").
399399
400400
Returns:
401-
The builder's associated environment type.
401+
The builder's associated environment type.
402402
"""
403403
...
404404

@@ -501,7 +501,9 @@ def content(self, content: str) -> BaseBuilder:
501501

502502
def scheme(self, scheme: str | Scheme) -> BaseBuilder:
503503
"""Set the explicit scheme."""
504-
self._scheme = scheme if isinstance(scheme, Scheme) else scheme_from_name(scheme)
504+
self._scheme = (
505+
scheme if isinstance(scheme, Scheme) else scheme_from_name(scheme)
506+
)
505507
return self
506508

507509
def subscribe_progress(self, subscriber: ProgressConsumer) -> BaseBuilder:
@@ -533,9 +535,11 @@ def _resolve_env_dir(self) -> Path:
533535

534536
# No explicit environment directory set; fall back to
535537
# a subfolder of the Appose-managed environments directory.
536-
dir_name = self._env_name if self._env_name is not None else (
538+
dir_name = (
539+
self._env_name
540+
if self._env_name is not None
537541
# No explicit environment name set; extract name from the source content.
538-
self._resolve_scheme().env_name(self._content)
542+
else (self._resolve_scheme().env_name(self._content))
539543
)
540544

541545
return Path(appose_envs_dir()) / dir_name
@@ -565,6 +569,7 @@ def _create_env(
565569

566570
class BuiltEnvironment(Environment):
567571
"""A simple Environment implementation."""
572+
568573
def __init__(
569574
self,
570575
base_path: str,

src/appose/builder/pixi.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,11 @@ def build(self) -> Environment:
159159
elif self._scheme.name() == "pyproject.toml":
160160
# Write pyproject.toml to envDir (Pixi natively supports it)
161161
pyproject_toml_file = env_dir / "pyproject.toml"
162-
pyproject_toml_file.write_text(
163-
self._content, encoding="utf-8"
164-
)
162+
pyproject_toml_file.write_text(self._content, encoding="utf-8")
165163
elif self._scheme.name() == "environment.yml":
166164
# Write environment.yml and import
167165
environment_yaml_file = env_dir / "environment.yml"
168-
environment_yaml_file.write_text(
169-
self._content, encoding="utf-8"
170-
)
166+
environment_yaml_file.write_text(self._content, encoding="utf-8")
171167
# Only run init --import if pixi.toml doesn't exist yet
172168
# (importing creates pixi.toml, so this avoids "pixi.toml already exists" error)
173169
if not (env_dir / "pixi.toml").exists():

src/appose/environment.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def python(self) -> Service:
131131
return self.service(
132132
python_exes,
133133
"-c",
134-
"import appose.python_worker; appose.python_worker.main()"
134+
"import appose.python_worker; appose.python_worker.main()",
135135
).syntax(PythonSyntax())
136136

137137
def groovy(
@@ -160,9 +160,7 @@ def groovy(
160160
:raises IOError: If something goes wrong starting the worker process.
161161
"""
162162
return self.java(
163-
"org.apposed.appose.GroovyWorker",
164-
class_path=class_path,
165-
jvm_args=jvm_args
163+
"org.apposed.appose.GroovyWorker", class_path=class_path, jvm_args=jvm_args
166164
).syntax(GroovySyntax())
167165

168166
def java(

src/appose/service.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ class Service:
6868

6969
_service_count: int = 0
7070

71-
def __init__(
72-
self, cwd: str | Path, args: list[str]
73-
) -> None:
71+
def __init__(self, cwd: str | Path, args: list[str]) -> None:
7472
self._cwd: Path = Path(cwd)
7573
self._args: list[str] = args[:]
7674
self._tasks: dict[str, "Task"] = {}
@@ -153,12 +151,14 @@ def syntax(self, syntax: str | ScriptSyntax) -> Service:
153151
Environment.groovy() when creating services of those types.
154152
It can also be called manually to support custom languages with
155153
registered ScriptSyntax plugins.
156-
154+
157155
:param syntax: The type identifier (e.g., "python", "groovy").
158156
:return: This service object, for chaining method calls.
159157
:raises: ValueError If no syntax plugin is found for the given type.
160158
"""
161-
self._syntax = syntax if isinstance(syntax, ScriptSyntax) else syntax_from_name(syntax)
159+
self._syntax = (
160+
syntax if isinstance(syntax, ScriptSyntax) else syntax_from_name(syntax)
161+
)
162162
return self
163163

164164
def get_var(self, name: str) -> Any:

src/appose/util/proxy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ def method(*args):
121121
# Use the service's ScriptSyntax to generate the method invocation script.
122122
# This allows support for different languages with varying syntax.
123123
syntax.validate(self._service)
124-
script = self._service._syntax.invoke_method(
125-
self._var, name, arg_names
126-
)
124+
script = self._service._syntax.invoke_method(self._var, name, arg_names)
127125

128126
try:
129127
task = self._service.task(script, inputs, self._queue)

0 commit comments

Comments
 (0)