Giter Club home page Giter Club logo

Comments (5)

TobyGiacometti avatar TobyGiacometti commented on May 25, 2024 1

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.

juftin avatar juftin commented on May 25, 2024 1

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.

TobyGiacometti avatar TobyGiacometti commented on May 25, 2024 1

Thanks @juftin, working as expected now 👍

from hatch-pip-compile.

juftin avatar juftin commented on May 25, 2024

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-compilehatch env prunels .venv/
hatch-pip-compilehatch env remove defaultls .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.

juftin avatar juftin commented on May 25, 2024

🎉 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.