Comments (5)
Thanks for checking!
You are right, hatch env remove
works most of the time, but there is an edge case where it fails as well. I must have encountered that edge case during my initial test. You can reproduce it as follows:
[env]
requires = [ "hatch-pip-compile" ]
[envs.default]
type = "pip-compile"
pip-compile-constraint = "default"
dependencies = [ "pyinfra>=2.9" ]
[envs.dev]
extra-dependencies = [ "black" ]
> hatch --env default shell
(default) > pyinfra
Usage: pyinfra [OPTIONS] INVENTORY OPERATIONS...
Try 'pyinfra --help' for help.
Error: Missing argument 'INVENTORY'.
(default) > exit
> hatch --env dev shell
(dev) > exit
> hatch env remove default
> hatch env remove dev
> hatch --env default shell
(default) > pyinfra
bash: pyinfra: command not found
The hatch env remove dev
command removes the dev environment, but at the same time creates a broken default environment. While trying to reproduce this edge case, I noticed that the pip-compile-constraint = "default"
setting is responsible for the issue. When this setting is not present, hatch env prune
works as well.
from hatch-pip-compile.
Oh very interesting! I think this is actually the same as #63
In order for the pip-compile-constraint
feature to work hatch-pip-compile
has to check inside the constraint environment from whichever environment you're operating from. This is inadvertently creating the environment but not actually installing the dependencies into it.
I'll keep digging and get this fixed up. Thanks very much for reporting the issue.
from hatch-pip-compile.
Thanks @juftin, working as expected now 👍
from hatch-pip-compile.
Hmm... it seems like hatch env prune
isn't doing exactly what I would expect it to while hatch env remove <envName>
is:
❯ ls .venv/
hatch-pip-compile
❯ hatch env prune
❯ ls .venv/
hatch-pip-compile
❯ hatch env remove default
❯ ls .venv/
ls: .venv/: No such file or directory
Is this something you're able to replicate when using a virtual
environment type instead of pip-compile
type?
from hatch-pip-compile.
🎉 This issue has been resolved in version 1.10.1 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
from hatch-pip-compile.
Related Issues (20)
- matrix environments with parent environment with different python version raise an error HOT 1
- depend on constraint env lockfile only if dependencies are present HOT 1
- Why is pip-tools being installed into the destination virtualenv? HOT 1
- pip complains about installing with `--no-deps`
- lockfile check not running HOT 8
- exhaustively check `dependencies_in_sync` HOT 1
- Specific Version of `pip-tools`
- Installation instructions not working HOT 13
- Regex error when installing pydantic as dependency HOT 5
- Lockfile Out Of Date between Windows vs. Linux HOT 3
- creating constraint environment without installing dependencies leaves it in bad state HOT 3
- "PIP_COMPILE_DISABLE" does not affect exit code HOT 8
- How can I use this plugin using hatch config `dirs.env.virtual`? HOT 2
- Use `uv` as locker / installer? HOT 1
- uv pip sync support
- singular uv install
- How can one update hatch-pip-compile itself ? HOT 5
- Recursive optional dependencies lead to incorrect requirements files HOT 11
- Possible issue on windows with wrong environment content HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hatch-pip-compile.