Skip to content

Commit

Permalink
Merge pull request #176 from pangeo-forge/ab/use-set-for-deps
Browse files Browse the repository at this point in the history
Ab/use set for deps
  • Loading branch information
abarciauskas-bgse authored Feb 26, 2024
2 parents 849394d + 16960f3 commit 7ae3a8f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pangeo_forge_runner/commands/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,9 @@ def start(self):
# alert if deps in requirements.txt are missing things
from importlib.metadata import distributions

deps = ["pangeo-forge-recipes", "fsspec", "apache-beam"]
missing_deps = []
for dep in deps:
if not dep in [d.metadata["Name"] for d in distributions()]:
missing_deps.append(dep)
deps_set = {"pangeo-forge-recipes", "fsspec", "apache-beam"}
dist_set = {d.metadata["Name"] for d in distributions()}
missing_deps = deps_set - dist_set
if missing_deps:
raise ValueError(
f"To use the 'bake' command, the packages {missing_deps} must be listed in your recipe's requirements.txt"
Expand Down

0 comments on commit 7ae3a8f

Please sign in to comment.