Skip to content

Commit

Permalink
Rename conda-lock plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Nov 25, 2024
1 parent 3a70c53 commit 984ed5a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def lock_plugins():
"""conda-lock locking plugin"""

yield types.TypeLockPlugin(
name="lock-conda_lock",
name="conda-lock",
synopsis="Generate a lockfile using conda-lock",
backend=CondaLock,
)
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ def build_conda_environment(db: Session, conda_store, build):
else:
lock_plugin_name, locker = conda_store.lock_plugin()
conda_lock_spec = locker.lock_environment(
spec=schema.CondaSpecification.parse_obj(
build.specification.spec
),
platforms=settings.conda_solve_platforms,
context=plugin_context.PluginContext(
conda_store=conda_store,
stdout=LoggedStream(
Expand All @@ -236,8 +240,6 @@ def build_conda_environment(db: Session, conda_store, build):
prefix=f"plugin-{lock_plugin_name}: ",
),
),
spec=schema.CondaSpecification.parse_obj(build.specification.spec),
platforms=settings.conda_solve_platforms,
)

conda_store.storage.set(
Expand Down
3 changes: 2 additions & 1 deletion conda-store-server/conda_store_server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _check_build_key_version(self, proposal):
)

lock_plugin_name = Unicode(
default_value="lock-conda_lock",
default_value="conda-lock",
allow_none=False,
config=True,
)
Expand Down Expand Up @@ -481,6 +481,7 @@ def celery_app(self):

@property
def plugin_manager(self):
"""Creates a plugin manager(if it doesn't already exist) and registers all plugins"""
if hasattr(self, "_plugin_manager"):
return self._plugin_manager

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def run_command(
for line in proc.stdout:
self.stdout.write(line)
if not redirect_stderr:
import pdb; pdb.set_trace()
for line in proc.stderr:
self.stderr.write(line)

Expand Down
6 changes: 3 additions & 3 deletions conda-store-server/tests/plugins/test_plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_get_lock_plugins(plugin_manager):
lp = plugin_manager.get_lock_plugins()

# Ensure built in lock plugins are accounted for
assert "lock-conda_lock" in lp
assert "conda-lock" in lp

# Ensure all plugins are lock plugins
for plugin in lp.values():
Expand All @@ -29,8 +29,8 @@ def test_get_lock_plugins(plugin_manager):

def get_lock_plugin(plugin_manager):
plugin_manager.collect_plugins()
lp = plugin_manager.lock_plugin("lock-conda_lock")
assert lp.name == "lock-conda_lock"
lp = plugin_manager.lock_plugin("conda-lock")
assert lp.name == "conda-lock"
assert lp.backend == conda_lock.CondaLock


Expand Down
2 changes: 1 addition & 1 deletion conda-store-server/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_conda_store_register_environment_duplicate_force_true(db, conda_store):


def test_conda_store_get_lock_plugin(conda_store):
lock_plugin_setting = "lock-conda_lock"
lock_plugin_setting = "conda-lock"
conda_store.lock_plugin_name = lock_plugin_setting
name, plugin = conda_store.lock_plugin()
assert name == lock_plugin_setting
Expand Down

0 comments on commit 984ed5a

Please sign in to comment.