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

Force resolving dependency via pip #186

Merged
merged 3 commits into from
Oct 22, 2022

Conversation

olivier-lacroix
Copy link
Contributor

@olivier-lacroix olivier-lacroix commented Apr 17, 2022

Use the [tool.conda-lock.dependencies] section in the pyproject.toml file to force resolving a package via pip, fixing (part of) #115.

This is useful in particular for packages that are not present on conda channels.

Note that

  • I have used the {source = 'pypi'} syntax to flag a package which should be installed via pip to match how conda-locks interprets poetry sections. In case of poetry, source designate the pypi repository where the package should be downloaded. i.e. it could be a different (e.g. private) repository, in which case conda-lock should most likely also flag it as a pip installable-package. This is a question broader than this PR though, so I assume this should be OK here, and dealt with more broadly.
  • If a package marked with {source = 'pypi'} in the [tool.conda-lock.dependencies] is not present in the packages dependencies (specified outside of [tool.conda-lock.dependencies]), it will not be added as a dependency. This makes sense to me as something downloaded via pip should be a python dependency. Currently it will be ignored silently - maybe a warning would be handy here?

@netlify
Copy link

netlify bot commented Apr 17, 2022

Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit e665fd6
🔍 Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/6350b50005117a0008681b1a
😎 Deploy Preview https://deploy-preview-186--conda-lock.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@mariusvniekerk
Copy link
Collaborator

Can you add a test for this in the test suite?

@olivier-lacroix
Copy link
Contributor Author

@mariusvniekerk sure. Will do.

@olivier-lacroix
Copy link
Contributor Author

@mariusvniekerk apologies for not following-up sooner...

I have modified test_parse_flit to check that the manager is properly set to pip for relevant packages. Let me know if you think this is appropriate / enough in terms of tests

@mariusvniekerk mariusvniekerk merged commit 4531bb8 into conda:main Oct 22, 2022
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 this pull request may close these issues.

2 participants