Skip to content

Commit

Permalink
Make sure to always re-check defaults source files
Browse files Browse the repository at this point in the history
even when falling back from the source files in the lockfile (#231).
  • Loading branch information
riccardoporreca committed Aug 10, 2022
1 parent 8a0214b commit 5098453
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions conda_lock/conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,15 +932,15 @@ def run_lock(
if all(p.exists() for p in locked_environment_files):
environment_files = locked_environment_files
else:
environment_files = DEFAULT_FILES
missing = [p for p in locked_environment_files if not p.exists()]
print(
f"{lockfile_path} was created from {[str(p) for p in locked_environment_files]},"
f" but some files ({[str(p) for p in missing]}) do not exist. Falling back to"
f" {[str(p) for p in environment_files]}.",
f" {[str(p) for p in DEFAULT_FILES]}.",
file=sys.stderr,
)
else:
# always re-check in case no files from the lockfile were assigned
if len(environment_files) == 0:
# bail out if we do not encounter any default .y(a)ml files
candidates = [
p if p.exists() else p.with_suffix(".yaml") for p in DEFAULT_FILES
Expand Down

0 comments on commit 5098453

Please sign in to comment.