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

Improved sophistication of environment strategies #85

Open
jaraco opened this issue Sep 26, 2023 · 2 comments
Open

Improved sophistication of environment strategies #85

jaraco opened this issue Sep 26, 2023 · 2 comments

Comments

@jaraco
Copy link
Owner

jaraco commented Sep 26, 2023

I'd like to consider some possible improvements to PIP_RUN_MODE to make it more configurable and responsive:

consistent voice

Instead of "ephemeral", use "destroy" to match the active voice of "persist". Or maybe prefer "persistent" and "ephemeral" to describe the environment and not the behavior.

Done in #86.

mode parameters

Consider allowing for parameters to the strategy. For example, allow specifying a max age for any enviroment:

mode=persist; max-age=NNNN

(similar to cookie syntax).

new mode - persist resolved dependencies

A new mode "persist resolved" would use PyPI to resolve all dependencies and only then calculate the cache key. This mode could re-use environments when no dependencies change, but be responsive when they do. It too could use parameters to cache the resolution with a TTL.

mode=persist resolved; max-age=NNNN

And maybe then, the default mode should be persist resolved; max-age=86400. This approach would resolve dependencies once a day (for any given spec) and re-use the resolved set when unchanged.

new mode - in-memory install

Imagine - instead of having to assemble expanded installs of packages into some folder on a file system, instead resolving dependencies to wheels and importing modules from those wheels directly from zip files in memory, similar to how a web browser can load javascript dependencies from a URL. This ambitious approach would require developing custom loaders/finders/resource providers and developing facilities for handling non-pure wheels.

Tracked in #89.

@bswck
Copy link
Contributor

bswck commented Dec 6, 2023

I can try to implement the in-memory install mode. Sounds fun 🚀

@jaraco jaraco changed the title Improved sophsitication of environment strategies Improved sophistication of environment strategies Feb 10, 2024
@bswck
Copy link
Contributor

bswck commented Jun 19, 2024

The demand for new mode - persist resolved dependencies increases with coherent-oss/coherent.test#2. Filed #103 to track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants