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

Don't deepfreeze on each environmental action #2

Open
Bobronium opened this issue Jan 25, 2023 · 2 comments · May be fixed by #3
Open

Don't deepfreeze on each environmental action #2

Bobronium opened this issue Jan 25, 2023 · 2 comments · May be fixed by #3

Comments

@Bobronium
Copy link

Bobronium commented Jan 25, 2023

Whenever I use hatch run with pip-deepfreeze environments, it seems like it tries to perform pip install and depfreeze, regardless of whether dependencies were changed in the pyproject.toml or not.

For example, it takes almost 10 seconds just to display current python version in such env:

No change to /Users/bobronium/.../requirements-all.txt
No change to /Users/bobronium/.../requirements.txt
Python 3.9.16
hatch run python --version  9.44s user 1.31s system 86% cpu 12.495 total

This is what I get without type = "pip-deepfreeze"

hatch run python --version  0.51s user 0.11s system 98% cpu 0.626 total

Ideally, I would expect deepfreeze to run only when hatch decides to sync environment AND finds something to be changed.

@Bobronium Bobronium linked a pull request Jan 25, 2023 that will close this issue
@sbidoul
Copy link
Owner

sbidoul commented Jan 26, 2023

@Bobronium thanks for your interest !

Removing the forced sync raises the question of what it means for the environment to be in sync.

If I remember correctly, hatch only checks that the dependencies are installed?

But if one uses this plugin, it is is presumably because one wants precise versions to be installed.

So what we would need is a more sophisticated implementation of dependencies_in_sync(), which is also not trivial.

@Bobronium
Copy link
Author

Right, my bad. Well, I don't have a quick solution here, unfortunately.

And maybe it's worth to move our focus on implementing this in hatch, since pypa/pip#10748, which seemingly was a blocker for this, is resolved now.

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.

2 participants