Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip solver does not consider dependencies conditional on platform #293

Closed
scottyhq opened this issue Dec 9, 2022 · 0 comments · Fixed by #295
Closed

pip solver does not consider dependencies conditional on platform #293

scottyhq opened this issue Dec 9, 2022 · 0 comments · Fixed by #295

Comments

@scottyhq
Copy link
Contributor

scottyhq commented Dec 9, 2022

I came across #289 which may already solve this issue, but here is another example where conda-lock (1.2.1) adds dependencies of pip packages for all platforms regardless of the lock target. For example, jupyter_server has a conditional dependency on pywintpy here for Windows ( "pywinpty;os_name=='nt'"):
https://github.com/jupyter-server/jupyter_server/blob/a55bc587e9c343509e95bd93961e27e331882834/pyproject.toml#L40

# environment.yml
channels:
  - conda-forge
dependencies:
  - jupyterlab
  - pip
  - pip:
    - jupyter-server

conda-lock lock -k env -p linux-64 still includes this Windows-only dependency, so trying to install the lockfile fails (output from the resulting lockfile below):

  - jupyterlab=3.5.1=pyhd8ed1ab_0
  - pip:
    - fastjsonschema === 2.16.2 --hash=sha256:21f918e8d9a1a4ba9c22e09574ba72267a6762d47822db9add95f6454e51cc1c
    - fqdn === 1.5.1 --hash=sha256:3a179af3761e4df6eb2e026ff9e1a3033d3587bf980a0b1b2e1e5d08d7358014
    - jsonpointer === 2.3 --hash=sha256:51801e558539b4e9cd268638c078c6c5746c9ac96bc38152d443400e4f3793e9
    - py === 1.11.0 --hash=sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378
    - pywinpty === 2.0.9 --hash=sha256:01b6400dd79212f50a2f01af1c65b781290ff39610853db99bf03962eb9a615f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant