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

Configure pip during build to avoid dependencies #2748

Closed
jakirkham opened this issue Mar 9, 2018 · 8 comments · Fixed by #3053
Closed

Configure pip during build to avoid dependencies #2748

jakirkham opened this issue Mar 9, 2018 · 8 comments · Fixed by #3053
Labels
locked [bot] locked due to inactivity

Comments

@jakirkham
Copy link
Member

Currently we patch setuptools to know when conda-build is running and disable pulling in dependencies. This is a good thing and avoids a fair number of issues. However am unaware of us doing anything on this front with pip, which could be problematic if users start pulling in dependencies that way by accident. As this has become a recommendation for Python packages in conda-forge ( conda-forge/conda-forge.github.io#518 ), this deserves more consideration.

One option would be to address this in conda-build, this could amount to setting a pip.conf or pip.in for pip to use based on one internally included and maintained in conda-build. Another option would be to set a number of environment variables for the active build environment to get the same effect. In either case this should allow us to block downloads, avoid build isolation, disable caching, and any other behavior that might be confusing or problematic for end users building conda packages with pip.

@msarahan
Copy link
Contributor

msarahan commented Mar 9, 2018

Conda-build is already setting env vars for when you're in a build. We'd need to patch pip to find and act on those env vars, but I really don't think this is a conda-build issue. Instead, it is one for pip-feedstock.

@jakirkham
Copy link
Member Author

We could patch the pip feedstock. It would probably need to be an activation script.

@jakirkham
Copy link
Member Author

Alternatively we could have a post-link script that writes to the pip.conf/pip.ini in whatever standard location we decide it should live in only if conda-build is running. ( pypa/pip#5060 )

@msarahan
Copy link
Contributor

msarahan commented Mar 9, 2018

Why does it have to be a pip.conf file? I mean, we can certainly do that, if it's the easiest way. If that's what we do, then doing it in conda-build is going to be much nicer than doing it in a post-link or activate script.

If we have to hack pip at all to make it work, why not patch it like setuptools?

@jakirkham
Copy link
Member Author

We could also teach pip where to look for this config file ( pypa/pip#5060 ), which could easily be sent upstream.

@jakirkham
Copy link
Member Author

Solved in PR ( #2972 ), which is included in conda-build version 3.11.0+.

@jakirkham
Copy link
Member Author

Noticed there were a couple things missing. Added PR ( #3053 ) to set them as well.

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Mar 14, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants