Giter Club home page Giter Club logo

Comments (5)

juftin avatar juftin commented on May 23, 2024 2

Nice 🙌 I'm glad you got that worked out. I raised pypa/hatch#1293 re: this issue.

Let me know how you like the new uv functionality, I've really enjoyed it so far - it's been a huge performance improvement.

from hatch-pip-compile.

Tobi-De avatar Tobi-De commented on May 23, 2024 2

Nice 🙌 I'm glad you got that worked out. I raised pypa/hatch#1293 re: this issue.

Let me know how you like the new uv functionality, I've really enjoyed it so far - it's been a huge performance emportement.

I was skeptical at first, but damn, it does make a difference, especially when you are using the same sets of dependencies in most of your projects. I was looking for support for it within Hatch directly and saw there was a pending issue on that. Luckily, today I was looking for something in the hatch-pip-compile docs and discovered you added support for it weeks ago. Frankly, bravo, thanks so much for your work.

from hatch-pip-compile.

juftin avatar juftin commented on May 23, 2024 1

How do you have hatch installed @Tobi-De?

If you have it installed with something like pipx the following works (see https://juftin.com/hatch-pip-compile/notes/#manual-installation) (This is why I like pipx best for hatch):

pipx runpip hatch install --upgrade hatch-pip-compile

If you have hatch installed with pip then you'd have to just do a vanilla pip install --upgrade hatch-pip-compile.

If you have hatch installed via the binary I believe you get less control over something like this and you'd have to add this to your hatch pyproject.toml (you could change this back to "hatch" after it has run once probably)

[tool.hatch.env]
requires = [
    "hatch-pip-compile>=1.11.1"
]

from hatch-pip-compile.

juftin avatar juftin commented on May 23, 2024 1

Err, it seems that I started this without fully understanding your original comment. Some points to clarify:

hatch-pip-compile runs inside the Python interpreter that is also running hatch. It accesses the virtual environments it creates but hatch-pip-compile is not installed into those virtualenvs (pip-tools / uv is installed into the virtualenvs though).

I tried uninstalling and reinstalling Hatch (with different methods: pip and binary) itself, but encountered the same issue

This one seems weird to me - maybe somehow the virtual environment that hatch lives in is getting persisted between these installs. hatch basically just runs a vanilla pip install hatch-pip-compile when it sees the tool.hatch.env table so maybe the virtualenv is never destroyed and thus never updated 🤷

Is it supposed to work automatically?

I think you're asking about whether hatch-pip-compile gets updated automatically. It doesn't 😞 - I can create an issue for this upstream in hatch. Ideally you should be able to run something like:

hatch self run-pip --upgrade hatch-pip-compile

If yes, when does it happen?

I believe the [tool.hatch.env] section only gets installed once, the first time it's called. I'm not 100% on this. I'll try to learn more

from hatch-pip-compile.

Tobi-De avatar Tobi-De commented on May 23, 2024 1

If you have hatch installed via the binary I believe you get less control over something like this and you'd have to add this to your hatch pyproject.toml (you could change this back to "hatch" after it has run once probably)

[tool.hatch.env]
requires = [
    "hatch-pip-compile>=1.11.1"
]

This worked, currently I have hatch installed via binary, I guessed the solution you suggested for pip will also work.
Thanks

I think you're asking about whether hatch-pip-compile gets updated automatically. It doesn't 😞 - I can create an issue for > this upstream in hatch. Ideally you should be able to run something like:

I don't know if it is possible, or maybe it will slow things down, but ideally the user won't have to think about it, but trying to update everything [tool.hatch.env] everytime is probably not a good idea

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.