Replies: 3 comments 4 replies
-
Hey there! For applications you would want to skip installation and also define dependencies for the environment itself rather than reusing that field meant for libraries/installable projects. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. Adding the dependencies to environment works, but I think it reduces the usefulness of the standard project file. For example, pip-tools uses the project dependencies to generate a requirements.txt. If the dependencies are moved to the environment, then tools dependent on the standard no longer work. It also removes the documentation advantage of separating development dependencies from project dependencies. I found this example of someone using Hatch as a Django project tool: https://github.com/oliverandrich/django-hatch-startproject/blob/main/pyproject.toml. This is a more complex version of what I was trying to do. Hatch is great for documenting dependencies, matrix testing, and collecting development scripts together. It looks like this scenario used to work, but it no longer does. If there was some config to say "I have no files to package" or "please install my project dependencies" that would be super useful. |
Beta Was this translation helpful? Give feedback.
-
Just wanted to add a quick follow up. It turns out that the |
Beta Was this translation helpful? Give feedback.
-
I have used hatch successfully in the past to build libraries, but I had the idea that maybe I could use it to purely manage my virtual environment for projects that don't need a build step (e.g. a Django project or just a one-off script).
I often just want to track a list of dependencies and/or target a Python version that is newer than the one offered by my Linux distribution.
So I tried this for my pyproject.toml file:
It almost works. If I run
hatch env shell
it installs the Python version I want and then errors out on the build step. If I run the command again, it syncs the dependencies and I have everything I need.I tried adding
skip-install = true
to the default env config, but then the dependencies are never installed.Does it make sense to support this use case? Maybe add an
install-dependencies = true
flag to go with theskip-install = true
?Beta Was this translation helpful? Give feedback.
All reactions