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

Does or will hatch solve the dependency solving in any meaningful way? #217

Closed
cozyGalvinism opened this issue Apr 28, 2022 · 4 comments
Closed

Comments

@cozyGalvinism
Copy link

Heya, I just heard about this project and it looks good on paper, though one thing that always stings in Python project management is the solving of dependencies due to PyPi's lack of enforcement for metadata on packages.

How will (or if already in place, how does) hatch solve this problem? Poetry faces this issue as well as Pipenv, yet both rely on PyPi so much, it actually hurts to set up a Python project that has only a handful of these packages without metadata, since the dependency resolution process can take up hours.

Thank you in advance!

@ofek
Copy link
Collaborator

ofek commented Apr 28, 2022

Hey thanks!

Locking/resolving support is temporarily blocked https://ofek.dev/hatch/latest/meta/faq/#libraries-vs-applications

@Hnasar
Copy link
Contributor

Hnasar commented Apr 29, 2022

@cozyGalvinism I'd suggest using both Hatch and PDM simultaneously if you have the need for it! Like Hatch, PDM works fine with standard PEP 621 metadata in pyproject.toml. For example, without changing anything in your existing project using Hatch, you should be able to do:

pdm config python.use_venv True
python3 -m venv venv
venv/bin/activate
pdm lock  # generate a pdm.lock with dependencies for the first time
pdm add example  # add an example new dependency, and run dependency resolver
git add pdm.lock && git commit -am "Use pdm to lock dependencies"

and then on a different machine you can install the exact locked dependencies with:

pdm sync --no-editable

(Also, PDM's dependency resolver is much faster than Poetry's.)

@ofek, Just to explain my experiences: I had considered using Hatch a few months ago, but locking dependencies was a critical feature. I found that https://github.com/pdm-project/pdm had both locking and support for the latest standards. So that's what I've been using. It works really well!

But today I realized my need for Hatch! Compared to PDM, Hatch has much better support for dynamic package builds including custom VCS versioning, and renaming/moving files during the build process. I spent several days fighting with setuptools and various PDM hook scripts and was so relieved to find that Hatch has support for these things. Thank you for developing this!!

@ofek
Copy link
Collaborator

ofek commented Apr 29, 2022

Thanks for the kind words, I'm very glad Hatch is helpful to you!

@ofek
Copy link
Collaborator

ofek commented Apr 29, 2022

Closing for 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

No branches or pull requests

3 participants