gvit 1.0.0 - Now with uv support, improved logging, and many other new features
Posted by Candid-Handle4074@reddit | Python | View on Reddit | 11 comments
Hello r/Python!
A few weeks ago I shared the project I am working on, gvit, a CLI tool designed to help Python users with the development process (check the first post here).
I have recently released a new major version of the tool, and it comes with several interesting features:
- 🐍 Added
uvto the supported backends. Now:venv,conda,virtualenvanduv. - 📦 Choose your package manager to install dependencies (
uvorpip). - 🔒 Dependency validation:
commitcommand validates installed packages match declared dependencies. - 📄 Status overview:
statuscommand shows both Git and environment changes in one view. - 🍁 Git command fallback: Use
gvitfor all git commands - unknown commands automatically fallback to git. - 👉 Interactive environment management.
- 📊 Command logging: Automatic tracking of all command executions with analytics and error capture.
For a detailed walkthrough of the project, have a look at the documentation in GitHub (link below).
Links
really_not_unreal@reddit
Ok let's go over this bit by bit:
Why exactly are different backends required? PEP 517 means that any modern Python package manager can build any modern package. Just pick uv and be done with it.
What difference does it make? UV has a pip-compatible CLI already. If you have the option to use UV, why not just use it by itself?
UV and all other modern dependency management tools can already do this. In fact, in UV, the environment is synced before any command that runs code.
If you're managing your dependencies correctly, git status will show you environment changes too because all changes will be immediately part of your lock file because you used a proper tool like UV.
Why would I need this? My environment will be synced the next time I use any UV command, so why not just use git normally?
This is neat imo, but would probably be slower than just using actual commands. In particular, it just has basic operations such as opening the environment in a file explorer, not anything where a complex tui would actually help such as interactive dependency upgrades.
Is this really necessary? Can't you just read the outputs from the commands you run as you run them?
In summary, your tool doesn't really do anything that doesn't exist elsewhere. Your main use case is legacy projects that don't already have a pyproject.toml file, but in cases like that, there are already plenty of tools that migrate the project to a newer system, rather than sticking with outdated systems.
I really don't think this needs to exist.
Candid-Handle4074@reddit (OP)
Hi!
As you already said, there are many professionals using Python which might be used to a specific technology to manage virtual environments. For example, in the data science community is pretty common to use conda, that allows installing from different channels, which makes it easier for certain libraries (e.g. Tensorflow).
The same for the package manager, I agree uv is the way to go, but many people still use pip.
The interactive command to manage your environments just contains the basics by now, but it can be enhanced.
If you are already using uv you might not need to use gvit, although it adds certain features, for example:
afaik, you cannot list all the uv environments you have, as they are created inside the repository directory. gvit creates a 1to1 mapping between your environments and your projects, so you can manage both seamlessly.
Thank you for your feedback.
adtechengineer@reddit
uv will automatically sync when you call a command like uv run. You don’t need to manage your virtual envs as closely with uv as it does it for you. And it does let you import from requirements.txt, or run uv pip install -r requirements.txt.
Basically, uv eliminates a lot of the issues people have with Python and struggling to manage versions and virtual environments.
Candid-Handle4074@reddit (OP)
Yes you can install dependencies from requirements.txt as you said, but is it possible to tell uv: "Hey, the dependencies of my project are defined in requirements.txt (or any other path, such as requirements/production.txt). Track this file and, when pulling or switching to another branch, if it is modified, update my virtual environment". That was what I meant, which I'm not sure if it can be done with uv. Thanks for the info.
really_not_unreal@reddit
It's not possible because it's not a good approach to dependency management. Dependencies for all modern projects should be defined in pyproject.toml.
Mithrandir2k16@reddit
I think the idea is cool, but it's positioned a bit weirdly. This could all just be a wrapper around git-hooks right? So instead of just using pre-commit, you version configured shared hook scripts within the repo, so all you have to do is link .git/hooks to .hooks or whatever and you're off to the races. Positioning yourself as a wrapper around all of git feels a bit unnecessary for this.
Candid-Handle4074@reddit (OP)
Sure, that was one of the options I considered when starting the project. However, I wanted to add the project management layer, together with the environment management, so I ended up building the CLI. Other features I added recently would not fit in the approach you mention either. Thank you for your comment!
RedEyed__@reddit
It's finally over.
uvis the wayN-E-S-W@reddit
Why learn how to use the standard tools that everyone else uses, when you could learn to use an unnecessary wrapper that nobody else uses instead!
This one simple trick will keep you at the junior level forever! 💣
RedEyed__@reddit
Legend!
Candid-Handle4074@reddit (OP)
No tool is standard from the start, it becomes standard if it adds value to the community and it is progressively adopted. This is not a wrapper of one specific virtual environment tool, it brings multiple options together (venv, conda, virtualenv and uv for the moment) and contains many other features. Also, creating a virtual environment with conda or venv doesn't require huge amount of knowledge, so you are not missing that much. Just sharing the project if it is useful for anyone. Thank you for your comment!