Skip to content

Commit

Permalink
[pre-commit.ci] Apply automatic pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 23, 2025
1 parent a693995 commit 0a790d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

class CondaLock(lock.LockPlugin):
def _conda_command(self, conda_store, namespace=None, environment=None) -> str:
return conda_store.get_setting(
"conda_command", namespace=namespace, environment_name=environment
) or "mamba"
return (
conda_store.get_setting(
"conda_command", namespace=namespace, environment_name=environment
)
or "mamba"
)

def _conda_flags(self, conda_store) -> str:
return conda_store.config.conda_flags
Expand All @@ -34,7 +37,9 @@ def lock_environment(
) -> str:
context.log.info("lock_environment entrypoint for conda-lock")
conda_command = self._conda_command(
context.conda_store, namespace=context.namespace, environment=context.environment
context.conda_store,
namespace=context.namespace,
environment=context.environment,
)
conda_flags = self._conda_flags(context.conda_store)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ def test_solve_lockfile_simple(conda_store, simple_specification):
@mock.patch("conda_store_server._internal.plugins.lock.conda_lock.conda_lock.run_lock")
def test_solve_right_conda_command(mock_run_lock, conda_store, simple_specification):
# Update conda_command settings
conda_store.set_settings(
data={"conda_command": "conda"}
)

conda_store.set_settings(data={"conda_command": "conda"})

# Dump dummy data to the expected lockfile output location
def run_lock_side_effect(lockfile_path, **kwargs):
with open(lockfile_path, "w") as f:
Expand All @@ -90,7 +88,9 @@ def run_lock_side_effect(lockfile_path, **kwargs):

locker = conda_lock.CondaLock()
locker.lock_environment(
context=plugin_context.PluginContext(conda_store, namespace="test", environment="one"),
context=plugin_context.PluginContext(
conda_store, namespace="test", environment="one"
),
spec=simple_specification,
platforms=[conda_utils.conda_platform()],
)
Expand Down

0 comments on commit 0a790d0

Please sign in to comment.