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

Do not disable pip's cache, rather point in to a location inside the work dir #3104

Merged
merged 5 commits into from
Sep 4, 2018

Conversation

jjhelmus
Copy link
Contributor

@jjhelmus jjhelmus commented Sep 1, 2018

closes #3094

Do not disable pip's cache directory.  When the cache is disable pip does not
try to build wheels for an install.  This is undesirable as it leads to
.egg-info directory where as wheel produce modern .dist-info directories.

This change allows the user to choose if pip's cache directory should be
enabled or not via the build script.  Pip's default is to enable the cache.
Point the PIP_CACHE_DIR environment variable to a non-existant folder in
the work directory.  This directory does not exist at the time when the
environment variable is set but could potentially exist later, note that the
directory is not created.
@jjhelmus
Copy link
Contributor Author

jjhelmus commented Sep 1, 2018

Disabling pip's cache results in pip not building wheels which leads to the conda package containing Python versioned .egg-info directories rather than modern .dist-info directories. This change leaves the choice of disabling the cache up to the user (pip by default uses the cache directory) but when the cache is enabled it points to a location inside the work directory. This avoid situations where the wheels from the default pip cache are installed into the conda environment.

@jjhelmus
Copy link
Contributor Author

jjhelmus commented Sep 1, 2018

My choice of mktemp was intentional despite the function being deprecated and unsafe. Other options from the tempfile module would create a folder inside the work directory which is not ideal. If there is better method to generate a unique directory name but not actually create the directory I'm all ears.

@nehaljwani
Copy link
Contributor

nehaljwani commented Sep 2, 2018

Wouldn't this hurt the builder in the scenario where merge_build_host: True ? Wouldn't the cache directory then become part of the package itself?

How about instead of putting it in the _build_env directory, we shove it one level up and call it something like __pipcache_<(not-necessarily!?-)long-path-here> ?

@nehaljwani
Copy link
Contributor

Sorry, I misread. You are actually using the work directory. Nevertheless, I would still like to know your thoughts about a top level __pipcache diretory.

@nehaljwani
Copy link
Contributor

nehaljwani commented Sep 2, 2018

Or we could still put it in the work directory, but prefix it with __pipcache. I want an identifier, so that I wouldn't have to go inside the work directory and hunt for the cache directory whereas I could simply /path/to/work-or-top-level/__pipcache<hit-tab>

@msarahan
Copy link
Contributor

msarahan commented Sep 4, 2018

There's one more of these vars in windows.py.

If it helps @nehaljwani, I agree that it would be helpful to have a folder for these files, though I personally don't know that I would use it.

@msarahan msarahan merged commit 634bc8b into conda:master Sep 4, 2018
@jakirkham
Copy link
Member

Thanks all. This seems like a nice, simple fix to the issue.

@github-actions
Copy link

Hi there, thank you for your contribution!

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

Please open a new issue or pull request if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 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 this pull request may close these issues.

Disabling pip's cache directory results in .egg-info directories
4 participants