vvenv 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vvenv-0.1.0/LICENSE +21 -0
- vvenv-0.1.0/PKG-INFO +270 -0
- vvenv-0.1.0/README.md +239 -0
- vvenv-0.1.0/pyproject.toml +67 -0
- vvenv-0.1.0/setup.cfg +4 -0
- vvenv-0.1.0/src/venvy/__init__.py +9 -0
- vvenv-0.1.0/src/venvy/cli.py +253 -0
- vvenv-0.1.0/src/venvy/commands/__init__.py +1 -0
- vvenv-0.1.0/src/venvy/commands/create.py +114 -0
- vvenv-0.1.0/src/venvy/commands/create_cmd.py +78 -0
- vvenv-0.1.0/src/venvy/commands/info.py +68 -0
- vvenv-0.1.0/src/venvy/commands/pip_cmd.py +73 -0
- vvenv-0.1.0/src/venvy/commands/requirements.py +159 -0
- vvenv-0.1.0/src/venvy/commands/shell_cmd.py +100 -0
- vvenv-0.1.0/src/venvy/commands/shell_init.py +124 -0
- vvenv-0.1.0/src/venvy/commands/status_cmd.py +61 -0
- vvenv-0.1.0/src/venvy/core/__init__.py +1 -0
- vvenv-0.1.0/src/venvy/core/config.py +79 -0
- vvenv-0.1.0/src/venvy/core/pip_hook.py +139 -0
- vvenv-0.1.0/src/venvy/core/pip_interceptor.py +65 -0
- vvenv-0.1.0/src/venvy/core/pip_wrapper.py +183 -0
- vvenv-0.1.0/src/venvy/core/requirements.py +119 -0
- vvenv-0.1.0/src/venvy/core/requirements_manager.py +160 -0
- vvenv-0.1.0/src/venvy/core/venv.py +167 -0
- vvenv-0.1.0/src/venvy/core/venv_manager.py +180 -0
- vvenv-0.1.0/src/venvy/py.typed +0 -0
- vvenv-0.1.0/src/venvy/utils/__init__.py +1 -0
- vvenv-0.1.0/src/venvy/utils/console.py +17 -0
- vvenv-0.1.0/src/venvy/utils/platform_utils.py +125 -0
- vvenv-0.1.0/src/venvy/utils/shell.py +197 -0
- vvenv-0.1.0/src/vvenv.egg-info/PKG-INFO +270 -0
- vvenv-0.1.0/src/vvenv.egg-info/SOURCES.txt +36 -0
- vvenv-0.1.0/src/vvenv.egg-info/dependency_links.txt +1 -0
- vvenv-0.1.0/src/vvenv.egg-info/entry_points.txt +2 -0
- vvenv-0.1.0/src/vvenv.egg-info/requires.txt +10 -0
- vvenv-0.1.0/src/vvenv.egg-info/top_level.txt +1 -0
- vvenv-0.1.0/tests/test_config.py +49 -0
- vvenv-0.1.0/tests/test_requirements.py +43 -0
vvenv-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 venvy contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
vvenv-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vvenv
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Smart Python virtual environment manager — like package.json but for Python
|
|
5
|
+
Author: venvy contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/yourorg/venvy
|
|
8
|
+
Project-URL: Repository, https://github.com/yourorg/venvy
|
|
9
|
+
Project-URL: Issues, https://github.com/yourorg/venvy/issues
|
|
10
|
+
Keywords: venv,virtualenv,pip,requirements,cli,dev-tools
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Classifier: Topic :: System :: Installation/Setup
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: typer>=0.9.0
|
|
22
|
+
Requires-Dist: rich>=13.0.0
|
|
23
|
+
Requires-Dist: watchdog>=3.0.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
27
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
29
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# venvy 🐍
|
|
33
|
+
|
|
34
|
+
> **Smart Python virtual environment manager — like `package.json` for Python.**
|
|
35
|
+
|
|
36
|
+
venvy takes the pain out of managing Python virtual environments and `requirements.txt`. It works cross-platform (Windows + macOS/Linux) and integrates seamlessly into your shell so that `pip install` automatically tracks packages.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
| Feature | Description |
|
|
43
|
+
|---------|-------------|
|
|
44
|
+
| `venvy create venv` | Interactively create & configure a venv |
|
|
45
|
+
| `venvy pip install <pkg>` | Install + auto-add to requirements |
|
|
46
|
+
| `venvy pip uninstall <pkg>` | Uninstall + auto-remove from requirements |
|
|
47
|
+
| `venvy status` | Show venv & requirements info |
|
|
48
|
+
| `venvy sync` | Install all packages from requirements |
|
|
49
|
+
| `venvy list` | List tracked packages |
|
|
50
|
+
| Shell integration | `venvy +` / `venvy -` for activate/deactivate |
|
|
51
|
+
| Existing venv support | Works with any venv, not just venvy-created ones |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Recommended: install globally with pipx
|
|
59
|
+
pipx install venvy
|
|
60
|
+
|
|
61
|
+
# Or with pip (global)
|
|
62
|
+
pip install venvy
|
|
63
|
+
|
|
64
|
+
# Or with pip --user
|
|
65
|
+
pip install --user venvy
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
### 1. Initialize a project
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
cd my-project
|
|
76
|
+
venvy create venv
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
You'll be asked:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
venvy — virtual environment setup
|
|
83
|
+
────────────────────────────────────────
|
|
84
|
+
[1/2] Install ipykernel (for Jupyter notebook support)? [y/N]: n
|
|
85
|
+
[2/2] Requirements file name [requirements.txt]:
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
venvy then:
|
|
89
|
+
- Creates `.venv/`
|
|
90
|
+
- Upgrades pip
|
|
91
|
+
- Installs ipykernel (if chosen)
|
|
92
|
+
- Installs existing requirements (if any)
|
|
93
|
+
- Saves config to `.venvy/config.json`
|
|
94
|
+
|
|
95
|
+
### 2. Activate / deactivate
|
|
96
|
+
|
|
97
|
+
**Without shell integration (always works):**
|
|
98
|
+
```bash
|
|
99
|
+
# macOS / Linux
|
|
100
|
+
source .venv/bin/activate
|
|
101
|
+
|
|
102
|
+
# Windows (cmd)
|
|
103
|
+
.venv\Scripts\activate.bat
|
|
104
|
+
|
|
105
|
+
# Windows (PowerShell)
|
|
106
|
+
.venv\Scripts\Activate.ps1
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**With shell integration (recommended):**
|
|
110
|
+
```bash
|
|
111
|
+
# Set up once:
|
|
112
|
+
echo 'eval "$(venvy shell-init)"' >> ~/.bashrc # or ~/.zshrc
|
|
113
|
+
source ~/.bashrc
|
|
114
|
+
|
|
115
|
+
# Then use anywhere:
|
|
116
|
+
venvy + # activate
|
|
117
|
+
venvy - # deactivate
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 3. Install packages (auto-tracked)
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# With venvy (always works):
|
|
124
|
+
venvy pip install requests httpx
|
|
125
|
+
|
|
126
|
+
# With shell integration, plain pip works too:
|
|
127
|
+
pip install requests httpx
|
|
128
|
+
# → automatically added to requirements.txt!
|
|
129
|
+
|
|
130
|
+
pip uninstall requests
|
|
131
|
+
# → automatically removed from requirements.txt!
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 4. Clone a project and restore dependencies
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
git clone https://github.com/user/project
|
|
138
|
+
cd project
|
|
139
|
+
venvy create venv # installs from existing requirements.txt
|
|
140
|
+
# or:
|
|
141
|
+
venvy sync # if venv already exists
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Shell Integration (Recommended)
|
|
147
|
+
|
|
148
|
+
Add to your `~/.bashrc` or `~/.zshrc`:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
eval "$(venvy shell-init)"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Restart your terminal. Now:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
venvy + # activates the venv (like npm run)
|
|
158
|
+
venvy - # deactivates the venv
|
|
159
|
+
|
|
160
|
+
pip install <pkg> # auto-updates requirements.txt ✓
|
|
161
|
+
pip uninstall <pkg> # auto-removes from requirements.txt ✓
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Windows (PowerShell)
|
|
165
|
+
|
|
166
|
+
Add to your `$PROFILE`:
|
|
167
|
+
|
|
168
|
+
```powershell
|
|
169
|
+
venvy shell-init | Invoke-Expression
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Commands Reference
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
venvy create venv [options] Create virtual environment
|
|
178
|
+
--name -n Venv directory name (default: .venv)
|
|
179
|
+
--requirements -r Requirements file name
|
|
180
|
+
--ipykernel Pre-select ipykernel
|
|
181
|
+
--yes -y Skip prompts, use defaults
|
|
182
|
+
|
|
183
|
+
venvy pip install <packages> Install & track packages
|
|
184
|
+
--upgrade -U Upgrade packages
|
|
185
|
+
|
|
186
|
+
venvy pip uninstall <packages> Uninstall & untrack packages
|
|
187
|
+
--yes -y Skip confirmation
|
|
188
|
+
|
|
189
|
+
venvy status Show environment info
|
|
190
|
+
venvy list List tracked packages
|
|
191
|
+
venvy sync Install all requirements
|
|
192
|
+
|
|
193
|
+
venvy shell-init Print shell integration script
|
|
194
|
+
venvy + Activation hint / activate (shell integration)
|
|
195
|
+
venvy - Deactivation hint / deactivate (shell integration)
|
|
196
|
+
|
|
197
|
+
venvy --version Show version
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Project Structure
|
|
203
|
+
|
|
204
|
+
After `venvy create venv`:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
my-project/
|
|
208
|
+
├── .venv/ ← virtual environment
|
|
209
|
+
├── .venvy/
|
|
210
|
+
│ └── config.json ← venvy project config
|
|
211
|
+
├── requirements.txt ← auto-managed!
|
|
212
|
+
└── your code...
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### `.venvy/config.json` example
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"venv_name": ".venv",
|
|
220
|
+
"requirements_file": "requirements.txt",
|
|
221
|
+
"install_ipykernel": false
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Add `.venvy/` to your `.gitignore` or commit it — your choice. Commit `requirements.txt` always.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Using an Existing Venv
|
|
230
|
+
|
|
231
|
+
venvy works with any existing virtual environment — it doesn't need to have created it. As long as:
|
|
232
|
+
|
|
233
|
+
1. The venv is active (`$VIRTUAL_ENV` is set), **or**
|
|
234
|
+
2. A `.venv`, `venv`, `env`, or `.env` directory exists in the project
|
|
235
|
+
|
|
236
|
+
venvy will find it and manage `requirements.txt` accordingly.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Philosophy
|
|
241
|
+
|
|
242
|
+
venvy brings `package.json`-style dependency management to Python:
|
|
243
|
+
|
|
244
|
+
| npm / Node | venvy / Python |
|
|
245
|
+
|------------|----------------|
|
|
246
|
+
| `npm init` | `venvy create venv` |
|
|
247
|
+
| `npm install <pkg>` | `venvy pip install <pkg>` |
|
|
248
|
+
| `npm uninstall <pkg>` | `venvy pip uninstall <pkg>` |
|
|
249
|
+
| `npm install` (restore) | `venvy sync` |
|
|
250
|
+
| `package.json` | `requirements.txt` |
|
|
251
|
+
| `node_modules/` | `.venv/` |
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Development
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
git clone https://github.com/yourorg/venvy
|
|
259
|
+
cd venvy
|
|
260
|
+
python -m venv .venv
|
|
261
|
+
source .venv/bin/activate
|
|
262
|
+
pip install -e ".[dev]"
|
|
263
|
+
pytest
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## License
|
|
269
|
+
|
|
270
|
+
MIT
|
vvenv-0.1.0/README.md
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# venvy 🐍
|
|
2
|
+
|
|
3
|
+
> **Smart Python virtual environment manager — like `package.json` for Python.**
|
|
4
|
+
|
|
5
|
+
venvy takes the pain out of managing Python virtual environments and `requirements.txt`. It works cross-platform (Windows + macOS/Linux) and integrates seamlessly into your shell so that `pip install` automatically tracks packages.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
| Feature | Description |
|
|
12
|
+
|---------|-------------|
|
|
13
|
+
| `venvy create venv` | Interactively create & configure a venv |
|
|
14
|
+
| `venvy pip install <pkg>` | Install + auto-add to requirements |
|
|
15
|
+
| `venvy pip uninstall <pkg>` | Uninstall + auto-remove from requirements |
|
|
16
|
+
| `venvy status` | Show venv & requirements info |
|
|
17
|
+
| `venvy sync` | Install all packages from requirements |
|
|
18
|
+
| `venvy list` | List tracked packages |
|
|
19
|
+
| Shell integration | `venvy +` / `venvy -` for activate/deactivate |
|
|
20
|
+
| Existing venv support | Works with any venv, not just venvy-created ones |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Recommended: install globally with pipx
|
|
28
|
+
pipx install venvy
|
|
29
|
+
|
|
30
|
+
# Or with pip (global)
|
|
31
|
+
pip install venvy
|
|
32
|
+
|
|
33
|
+
# Or with pip --user
|
|
34
|
+
pip install --user venvy
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### 1. Initialize a project
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cd my-project
|
|
45
|
+
venvy create venv
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
You'll be asked:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
venvy — virtual environment setup
|
|
52
|
+
────────────────────────────────────────
|
|
53
|
+
[1/2] Install ipykernel (for Jupyter notebook support)? [y/N]: n
|
|
54
|
+
[2/2] Requirements file name [requirements.txt]:
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
venvy then:
|
|
58
|
+
- Creates `.venv/`
|
|
59
|
+
- Upgrades pip
|
|
60
|
+
- Installs ipykernel (if chosen)
|
|
61
|
+
- Installs existing requirements (if any)
|
|
62
|
+
- Saves config to `.venvy/config.json`
|
|
63
|
+
|
|
64
|
+
### 2. Activate / deactivate
|
|
65
|
+
|
|
66
|
+
**Without shell integration (always works):**
|
|
67
|
+
```bash
|
|
68
|
+
# macOS / Linux
|
|
69
|
+
source .venv/bin/activate
|
|
70
|
+
|
|
71
|
+
# Windows (cmd)
|
|
72
|
+
.venv\Scripts\activate.bat
|
|
73
|
+
|
|
74
|
+
# Windows (PowerShell)
|
|
75
|
+
.venv\Scripts\Activate.ps1
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**With shell integration (recommended):**
|
|
79
|
+
```bash
|
|
80
|
+
# Set up once:
|
|
81
|
+
echo 'eval "$(venvy shell-init)"' >> ~/.bashrc # or ~/.zshrc
|
|
82
|
+
source ~/.bashrc
|
|
83
|
+
|
|
84
|
+
# Then use anywhere:
|
|
85
|
+
venvy + # activate
|
|
86
|
+
venvy - # deactivate
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 3. Install packages (auto-tracked)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# With venvy (always works):
|
|
93
|
+
venvy pip install requests httpx
|
|
94
|
+
|
|
95
|
+
# With shell integration, plain pip works too:
|
|
96
|
+
pip install requests httpx
|
|
97
|
+
# → automatically added to requirements.txt!
|
|
98
|
+
|
|
99
|
+
pip uninstall requests
|
|
100
|
+
# → automatically removed from requirements.txt!
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 4. Clone a project and restore dependencies
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git clone https://github.com/user/project
|
|
107
|
+
cd project
|
|
108
|
+
venvy create venv # installs from existing requirements.txt
|
|
109
|
+
# or:
|
|
110
|
+
venvy sync # if venv already exists
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Shell Integration (Recommended)
|
|
116
|
+
|
|
117
|
+
Add to your `~/.bashrc` or `~/.zshrc`:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
eval "$(venvy shell-init)"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Restart your terminal. Now:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
venvy + # activates the venv (like npm run)
|
|
127
|
+
venvy - # deactivates the venv
|
|
128
|
+
|
|
129
|
+
pip install <pkg> # auto-updates requirements.txt ✓
|
|
130
|
+
pip uninstall <pkg> # auto-removes from requirements.txt ✓
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Windows (PowerShell)
|
|
134
|
+
|
|
135
|
+
Add to your `$PROFILE`:
|
|
136
|
+
|
|
137
|
+
```powershell
|
|
138
|
+
venvy shell-init | Invoke-Expression
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Commands Reference
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
venvy create venv [options] Create virtual environment
|
|
147
|
+
--name -n Venv directory name (default: .venv)
|
|
148
|
+
--requirements -r Requirements file name
|
|
149
|
+
--ipykernel Pre-select ipykernel
|
|
150
|
+
--yes -y Skip prompts, use defaults
|
|
151
|
+
|
|
152
|
+
venvy pip install <packages> Install & track packages
|
|
153
|
+
--upgrade -U Upgrade packages
|
|
154
|
+
|
|
155
|
+
venvy pip uninstall <packages> Uninstall & untrack packages
|
|
156
|
+
--yes -y Skip confirmation
|
|
157
|
+
|
|
158
|
+
venvy status Show environment info
|
|
159
|
+
venvy list List tracked packages
|
|
160
|
+
venvy sync Install all requirements
|
|
161
|
+
|
|
162
|
+
venvy shell-init Print shell integration script
|
|
163
|
+
venvy + Activation hint / activate (shell integration)
|
|
164
|
+
venvy - Deactivation hint / deactivate (shell integration)
|
|
165
|
+
|
|
166
|
+
venvy --version Show version
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Project Structure
|
|
172
|
+
|
|
173
|
+
After `venvy create venv`:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
my-project/
|
|
177
|
+
├── .venv/ ← virtual environment
|
|
178
|
+
├── .venvy/
|
|
179
|
+
│ └── config.json ← venvy project config
|
|
180
|
+
├── requirements.txt ← auto-managed!
|
|
181
|
+
└── your code...
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### `.venvy/config.json` example
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"venv_name": ".venv",
|
|
189
|
+
"requirements_file": "requirements.txt",
|
|
190
|
+
"install_ipykernel": false
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Add `.venvy/` to your `.gitignore` or commit it — your choice. Commit `requirements.txt` always.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Using an Existing Venv
|
|
199
|
+
|
|
200
|
+
venvy works with any existing virtual environment — it doesn't need to have created it. As long as:
|
|
201
|
+
|
|
202
|
+
1. The venv is active (`$VIRTUAL_ENV` is set), **or**
|
|
203
|
+
2. A `.venv`, `venv`, `env`, or `.env` directory exists in the project
|
|
204
|
+
|
|
205
|
+
venvy will find it and manage `requirements.txt` accordingly.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Philosophy
|
|
210
|
+
|
|
211
|
+
venvy brings `package.json`-style dependency management to Python:
|
|
212
|
+
|
|
213
|
+
| npm / Node | venvy / Python |
|
|
214
|
+
|------------|----------------|
|
|
215
|
+
| `npm init` | `venvy create venv` |
|
|
216
|
+
| `npm install <pkg>` | `venvy pip install <pkg>` |
|
|
217
|
+
| `npm uninstall <pkg>` | `venvy pip uninstall <pkg>` |
|
|
218
|
+
| `npm install` (restore) | `venvy sync` |
|
|
219
|
+
| `package.json` | `requirements.txt` |
|
|
220
|
+
| `node_modules/` | `.venv/` |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Development
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
git clone https://github.com/yourorg/venvy
|
|
228
|
+
cd venvy
|
|
229
|
+
python -m venv .venv
|
|
230
|
+
source .venv/bin/activate
|
|
231
|
+
pip install -e ".[dev]"
|
|
232
|
+
pytest
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vvenv"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Smart Python virtual environment manager — like package.json but for Python"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
authors = [{ name = "venvy contributors" }]
|
|
12
|
+
requires-python = ">=3.8"
|
|
13
|
+
keywords = ["venv", "virtualenv", "pip", "requirements", "cli", "dev-tools"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
21
|
+
"Topic :: System :: Installation/Setup",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"typer>=0.9.0",
|
|
25
|
+
"rich>=13.0.0",
|
|
26
|
+
"watchdog>=3.0.0",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
dev = [
|
|
31
|
+
"pytest>=7.0",
|
|
32
|
+
"pytest-cov>=4.0",
|
|
33
|
+
"black>=23.0",
|
|
34
|
+
"ruff>=0.1.0",
|
|
35
|
+
"mypy>=1.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
venvy = "venvy.cli:app"
|
|
40
|
+
|
|
41
|
+
[project.urls]
|
|
42
|
+
Homepage = "https://github.com/yourorg/venvy"
|
|
43
|
+
Repository = "https://github.com/yourorg/venvy"
|
|
44
|
+
Issues = "https://github.com/yourorg/venvy/issues"
|
|
45
|
+
|
|
46
|
+
[tool.setuptools.packages.find]
|
|
47
|
+
where = ["src"]
|
|
48
|
+
|
|
49
|
+
[tool.setuptools.package-data]
|
|
50
|
+
venvy = ["py.typed"]
|
|
51
|
+
|
|
52
|
+
[tool.black]
|
|
53
|
+
line-length = 88
|
|
54
|
+
target-version = ["py38", "py39", "py310", "py311", "py312"]
|
|
55
|
+
|
|
56
|
+
[tool.ruff]
|
|
57
|
+
line-length = 88
|
|
58
|
+
select = ["E", "W", "F", "I", "UP", "B", "SIM"]
|
|
59
|
+
ignore = ["E501"]
|
|
60
|
+
target-version = "py38"
|
|
61
|
+
|
|
62
|
+
[tool.mypy]
|
|
63
|
+
python_version = "3.8"
|
|
64
|
+
strict = true
|
|
65
|
+
|
|
66
|
+
[tool.pytest.ini_options]
|
|
67
|
+
testpaths = ["tests"]
|
vvenv-0.1.0/setup.cfg
ADDED