Automates virtual environment management for Git repositories
Project description
░██ ░██
░██
░████████ ░██ ░██ ░██░████████
░██ ░██ ░██ ░██ ░██ ░██
░██ ░██ ░██ ░██ ░██ ░██
░██ ░███ ░██░██ ░██ ░██
░█████░██ ░███ ░██ ░████
░██
░███████
Git-aware Virtual Environment Manager
Automates virtual environment management for Git repositories.
gvit is a command-line tool that automatically creates and manages virtual environments when you clone repositories. Its goal is to eliminate friction between version control and Python environment management.
🚀 Motivation
Have you ever cloned a project and had to do all this?
git clone https://github.com/someone/project.git
cd project
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
With gvit, all of that happens automatically:
gvit clone https://github.com/someone/project.git
🎉 Repository cloned, environment created, and dependencies installed!
Example
⚙️ What gvit does
- 🪄 Automatically creates a virtual environment when cloning a repo
- 📦 Installs dependencies from
requirements.txt,pyproject.toml, or custom paths - 🎯 Supports extra dependencies (dev, test, etc.) from
pyproject.tomlor separate files - 🧠 Remembers your preferences via local configuration (
~/.config/gvit/config.toml) - ⚡ Smart priority resolution: CLI options → repo config → local config → defaults
- 🔧 Flexible configuration: per-repository (
.gvit.toml) or global settings - 🐍 Conda backend support (venv and virtualenv coming soon)
💻 Installation
pip install gvit
Or with pipx (recommended for CLI tools):
pipx install gvit
🧩 Usage
Initial Configuration
Set up your default preferences (interactive):
gvit config setup
Or specify options directly:
gvit config setup --backend conda --python 3.11 --base-deps requirements.txt
Clone a Repository
Basic clone with automatic environment creation:
gvit clone https://github.com/user/repo.git
Advanced options:
# Custom environment name
gvit clone https://github.com/user/repo.git --venv-name my-env
# Specify Python version
gvit clone https://github.com/user/repo.git --python 3.12
# Install extra dependencies from pyproject.toml
gvit clone https://github.com/user/repo.git --extra-deps dev,test
# Skip dependency installation
gvit clone https://github.com/user/repo.git --no-deps
# Force overwrite existing environment
gvit clone https://github.com/user/repo.git --force
# Verbose output
gvit clone https://github.com/user/repo.git --verbose
Configuration Management
# Add extra dependency groups to local config
gvit config add-extra-deps dev requirements-dev.txt
gvit config add-extra-deps test requirements-test.txt
# Remove extra dependency groups
gvit config remove-extra-deps dev
# Show current configuration
gvit config show
🧠 How it works
- Clones the repository using standard
git clone - Detects repository name from URL (handles
.gitsuffix correctly) - Creates virtual environment using your preferred backend:
- Currently:
conda - Coming soon:
venv,virtualenv
- Currently:
- Resolves dependencies with priority system:
- CLI arguments (highest priority)
- Repository config (
.gvit.toml) - Local config (
~/.config/gvit/config.toml) - Default values (lowest priority)
- Installs dependencies from:
pyproject.toml(with optional extras support)requirements.txtor custom paths- Multiple dependency groups (base, dev, test, etc.)
- Validates and handles conflicts:
- Detects existing environments
- Offers options: rename, overwrite, or abort
- Auto-generates unique names if needed
⚙️ Configuration
Local Configuration
Global preferences: ~/.config/gvit/config.toml
[gvit]
backend = "conda"
python = "3.11"
[deps]
base = "requirements.txt"
dev = "requirements-dev.txt"
test = "requirements-test.txt"
[backends.conda]
path = "/path/to/conda" # Optional: custom conda path
Repository Configuration
Per-project settings: .gvit.toml (in repository root)
[gvit]
python = "3.12" # Override Python version for this project
[deps]
base = "requirements.txt"
dev = "requirements-dev.txt"
internal = "requirements-internal.txt"
Or use pyproject.toml (tool section):
[tool.gvit]
python = "3.12"
[tool.gvit.deps]
base = "pyproject.toml"
🧱 Architecture
gvit/
├── src/gvit/
│ ├── cli.py # CLI entry point (Typer app)
│ ├── commands/
│ │ ├── clone.py # Clone command logic
│ │ └── config.py # Config management commands
│ ├── backends/
│ │ └── conda.py # Conda backend implementation
│ ├── utils/
│ │ ├── exceptions.py # Custom exceptions
│ │ ├── utils.py # Helper functions
│ │ ├── validators.py # Input validation
│ │ ├── globals.py # Constants and defaults
│ │ └── schemas.py # Type definitions
│ └── __init__.py
└── pyproject.toml # Project metadata
🧭 Roadmap
Current Release (v0.0.3)
| Feature | Status | Description |
|---|---|---|
| Clone command | ✅ | Full repository cloning with environment setup |
| Conda backend | ✅ | Complete conda integration |
| Config management | ✅ | setup, add-extra-deps, remove-extra-deps, show |
| Dependency resolution | ✅ | Priority-based resolution (CLI > repo > local > default) |
| pyproject.toml support | ✅ | Install base + optional dependencies (extras) |
| Requirements.txt support | ✅ | Standard pip requirements files |
| Custom dependency paths | ✅ | Flexible path specification via config or CLI |
| Environment validation | ✅ | Detect conflicts, offer resolution options |
Next Releases
| Version | Status | Description |
|---|---|---|
| 0.1.0 | 🔧 In Progress | Add pull and checkout commands with smart dependency sync |
| 0.2.0 | 📋 Planned | Support for venv and virtualenv backends |
| 0.3.0 | 📋 Planned | Environment persistence and metadata tracking |
| 0.4.0 | 📋 Planned | Shell integration and aliases |
| 1.0.0 | 🎯 Goal | Stable release with all core features |
🧑💻 Example Workflows
First Time Setup
# Install gvit
pipx install gvit
# Configure defaults
gvit config setup --backend conda --python 3.11
# Add common dependency groups
gvit config add-extra-deps dev requirements-dev.txt
gvit config add-extra-deps test requirements-test.txt
Standard Project
# Clone with base dependencies
gvit clone https://github.com/user/project.git
# Activate environment
conda activate project
Project with Extra Dependencies
# Clone and install dev dependencies
gvit clone https://github.com/user/project.git --extra-deps dev
# Or multiple groups
gvit clone https://github.com/user/project.git --extra-deps dev,test
# Activate
conda activate project
Project with pyproject.toml
# Install base dependencies from pyproject.toml
gvit clone https://github.com/user/project.git
# Install with optional dependencies defined in [project.optional-dependencies]
gvit clone https://github.com/user/project.git --extra-deps dev,test
Custom Configuration
# Override everything from CLI
gvit clone https://github.com/user/project.git \
--venv-name custom-env \
--python 3.12 \
--backend conda \
--base-deps requirements/prod.txt \
--extra-deps dev:requirements/dev.txt,test:requirements/test.txt \
--verbose
🤝 Contributing
Contributions are welcome! Areas we'd love help with:
- Additional backends (venv, virtualenv, pyenv)
pullandcheckoutcommands- Cross-platform testing
- Documentation improvements
Open an issue or submit a pull request on GitHub.
⚖️ License
MIT © 2025
⭐ Vision
“One repo, its own environment — without thinking about it.”
The goal of gvit is to eliminate the need to manually create or update virtual environments. Git and Python should work together seamlessly — this tool makes it possible.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gvit-0.0.3.tar.gz.
File metadata
- Download URL: gvit-0.0.3.tar.gz
- Upload date:
- Size: 168.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b3d9d89333e252e3667c771e1243d8ea8e4604796cf4591b3115fd5c55bb2b5
|
|
| MD5 |
a76b8f73c5dacb2fe9296ff469e5d2ab
|
|
| BLAKE2b-256 |
a656ead068763bc01ab9f78645de17a007706dbe807f05b7ce03d439224e9d4b
|
File details
Details for the file gvit-0.0.3-py3-none-any.whl.
File metadata
- Download URL: gvit-0.0.3-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c5498cf54cfa55d4b3d04b5d75efe2a44393d476722b3be3740833ac9cd21a2
|
|
| MD5 |
f4b730558f1ec8d2ba60f83524f0d709
|
|
| BLAKE2b-256 |
8ebe8c4b307fe8d9790085ebef35c0716943aa9aaa4487c832ede02ca548d111
|