Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Compute local package dir when pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Jul 25, 2023
1 parent 375e5b1 commit dcd02f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions jupyterlite_xeus_python/build.py
Expand Up @@ -240,9 +240,11 @@ def build_and_pack_emscripten_env(

# Process environment.yml file
if environment_file and Path(environment_file).exists():
env_file = Path(environment_file)

bail_early = False

with open(Path(environment_file)) as f:
with open(env_file) as f:
env_data = yaml.safe_load(f)

if env_data.get("name") is not None:
Expand All @@ -260,7 +262,11 @@ def build_and_pack_emscripten_env(
if isinstance(dependency, str) and dependency not in specs:
specs.append(dependency)
elif isinstance(dependency, dict) and dependency.get("pip") is not None:
pip_dependencies = dependency["pip"]
# If it's a local Python package, make its path relative to the environment file
pip_dependencies = [
((env_file.parent / pip_dep).resolve() if os.path.isdir(env_file.parent / pip_dep) else pip_dep)
for pip_dep in dependency["pip"]
]

# Bail early if there is nothing to do
if bail_early and not force:
Expand Down

0 comments on commit dcd02f0

Please sign in to comment.