vnma 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.
- vnma-0.1.0/LICENSE +38 -0
- vnma-0.1.0/PKG-INFO +169 -0
- vnma-0.1.0/README.md +106 -0
- vnma-0.1.0/plan.md +243 -0
- vnma-0.1.0/pyproject.toml +41 -0
- vnma-0.1.0/setup.cfg +4 -0
- vnma-0.1.0/tests/test_archive.py +96 -0
- vnma-0.1.0/tests/test_cli.py +139 -0
- vnma-0.1.0/tests/test_config.py +120 -0
- vnma-0.1.0/tests/test_local_index.py +86 -0
- vnma-0.1.0/tests/test_models.py +127 -0
- vnma-0.1.0/tests/test_platform_tags.py +70 -0
- vnma-0.1.0/tests/test_pruner.py +110 -0
- vnma-0.1.0/tests/test_resolver.py +182 -0
- vnma-0.1.0/tests/test_runtime.py +45 -0
- vnma-0.1.0/tests/test_uninstaller.py +81 -0
- vnma-0.1.0/tests/test_visitors.py +114 -0
- vnma-0.1.0/vnma/__init__.py +3 -0
- vnma-0.1.0/vnma/__main__.py +7 -0
- vnma-0.1.0/vnma/cli.py +455 -0
- vnma-0.1.0/vnma/core/__init__.py +24 -0
- vnma-0.1.0/vnma/core/config.py +164 -0
- vnma-0.1.0/vnma/core/context.py +106 -0
- vnma-0.1.0/vnma/core/lockfile.py +84 -0
- vnma-0.1.0/vnma/core/models.py +188 -0
- vnma-0.1.0/vnma/core/package_config.py +55 -0
- vnma-0.1.0/vnma/core/platform_tags.py +136 -0
- vnma-0.1.0/vnma/pypi/__init__.py +7 -0
- vnma-0.1.0/vnma/pypi/cache.py +94 -0
- vnma-0.1.0/vnma/pypi/client.py +96 -0
- vnma-0.1.0/vnma/pypi/git.py +58 -0
- vnma-0.1.0/vnma/pypi/local_index.py +120 -0
- vnma-0.1.0/vnma/pypi/resolver.py +191 -0
- vnma-0.1.0/vnma/runtime/__init__.py +6 -0
- vnma-0.1.0/vnma/runtime/bootstrap.py +129 -0
- vnma-0.1.0/vnma/runtime/runner.py +67 -0
- vnma-0.1.0/vnma/visitors/__init__.py +30 -0
- vnma-0.1.0/vnma/visitors/artifact_visitors.py +159 -0
- vnma-0.1.0/vnma/visitors/base.py +58 -0
- vnma-0.1.0/vnma/visitors/git_visitors.py +55 -0
- vnma-0.1.0/vnma/visitors/ide_visitors.py +114 -0
- vnma-0.1.0/vnma/wheel/__init__.py +7 -0
- vnma-0.1.0/vnma/wheel/archive.py +102 -0
- vnma-0.1.0/vnma/wheel/builder.py +68 -0
- vnma-0.1.0/vnma/wheel/installer.py +136 -0
- vnma-0.1.0/vnma/wheel/pruner.py +118 -0
- vnma-0.1.0/vnma/wheel/uninstaller.py +93 -0
- vnma-0.1.0/vnma.egg-info/PKG-INFO +169 -0
- vnma-0.1.0/vnma.egg-info/SOURCES.txt +50 -0
- vnma-0.1.0/vnma.egg-info/dependency_links.txt +1 -0
- vnma-0.1.0/vnma.egg-info/entry_points.txt +2 -0
- vnma-0.1.0/vnma.egg-info/top_level.txt +1 -0
vnma-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Copyright (c) 2026, GrandKenzy / VNMA Team and Contributors.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
8
|
+
this list of conditions, and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions, and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
3. Commercial Sale Restriction:
|
|
15
|
+
Direct commercial sale or resale of this software itself, in whole or in
|
|
16
|
+
substantial part, as a standalone product or service is strictly prohibited.
|
|
17
|
+
Use, modification, and execution of this software to manage dependencies
|
|
18
|
+
within proprietary or commercial applications is fully permitted without royalty.
|
|
19
|
+
|
|
20
|
+
4. Vendor Share-Alike Distribution Requirement:
|
|
21
|
+
Any downstream distribution, vendoring bundle, fork, or sub-component derived
|
|
22
|
+
from this software must be distributed under these same license terms and include
|
|
23
|
+
a copy of this license.
|
|
24
|
+
|
|
25
|
+
5. Neither the name of the copyright holder nor the names of its contributors
|
|
26
|
+
may be used to endorse or promote products derived from this software without
|
|
27
|
+
specific prior written permission.
|
|
28
|
+
|
|
29
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
30
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
31
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
32
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
33
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
34
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
35
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
36
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
37
|
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
38
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
vnma-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vnma
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Vendor Manager for Python — hermetic, zero-venv dependency management.
|
|
5
|
+
Author: VNMA Team
|
|
6
|
+
License: Copyright (c) 2026, GrandKenzy / VNMA Team and Contributors.
|
|
7
|
+
All rights reserved.
|
|
8
|
+
|
|
9
|
+
Redistribution and use in source and binary forms, with or without
|
|
10
|
+
modification, are permitted provided that the following conditions are met:
|
|
11
|
+
|
|
12
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
13
|
+
this list of conditions, and the following disclaimer.
|
|
14
|
+
|
|
15
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
16
|
+
this list of conditions, and the following disclaimer in the documentation
|
|
17
|
+
and/or other materials provided with the distribution.
|
|
18
|
+
|
|
19
|
+
3. Commercial Sale Restriction:
|
|
20
|
+
Direct commercial sale or resale of this software itself, in whole or in
|
|
21
|
+
substantial part, as a standalone product or service is strictly prohibited.
|
|
22
|
+
Use, modification, and execution of this software to manage dependencies
|
|
23
|
+
within proprietary or commercial applications is fully permitted without royalty.
|
|
24
|
+
|
|
25
|
+
4. Vendor Share-Alike Distribution Requirement:
|
|
26
|
+
Any downstream distribution, vendoring bundle, fork, or sub-component derived
|
|
27
|
+
from this software must be distributed under these same license terms and include
|
|
28
|
+
a copy of this license.
|
|
29
|
+
|
|
30
|
+
5. Neither the name of the copyright holder nor the names of its contributors
|
|
31
|
+
may be used to endorse or promote products derived from this software without
|
|
32
|
+
specific prior written permission.
|
|
33
|
+
|
|
34
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
35
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
36
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
37
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
38
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
39
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
40
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
41
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
42
|
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
43
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
44
|
+
|
|
45
|
+
Project-URL: Homepage, https://github.com/GrandKenzy/vnma
|
|
46
|
+
Project-URL: Documentation, https://github.com/GrandKenzy/vnma/tree/main/docs
|
|
47
|
+
Project-URL: Repository, https://github.com/GrandKenzy/vnma.git
|
|
48
|
+
Project-URL: Bug Tracker, https://github.com/GrandKenzy/vnma/issues
|
|
49
|
+
Keywords: vendoring,packaging,dependencies,hermetic,pip
|
|
50
|
+
Classifier: Development Status :: 4 - Beta
|
|
51
|
+
Classifier: Intended Audience :: Developers
|
|
52
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
53
|
+
Classifier: Programming Language :: Python :: 3
|
|
54
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
55
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
56
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
57
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
58
|
+
Classifier: Operating System :: OS Independent
|
|
59
|
+
Requires-Python: >=3.11
|
|
60
|
+
Description-Content-Type: text/markdown
|
|
61
|
+
License-File: LICENSE
|
|
62
|
+
Dynamic: license-file
|
|
63
|
+
|
|
64
|
+
# VNMA (Vendor Manager)
|
|
65
|
+
|
|
66
|
+
> **Status:** Beta (v0.1.0)
|
|
67
|
+
> **Platform Support:** CPython 3.11+ (Tested on Windows and Linux)
|
|
68
|
+
|
|
69
|
+
`vnma` is a dependency and vendoring manager for Python projects. It manages project dependencies inside a local, isolated vendor directory (`vendor/` or `vendor_vnma/`) instead of creating or replicating full Python virtual environments (`venv`).
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Overview
|
|
74
|
+
|
|
75
|
+
Traditional Python development relies on virtual environments, which duplicate the interpreter executable and standard library layout. While effective for system isolation, virtual environments introduce overhead in container builds, portable deployments, and shared team workflows where only runtime libraries are required.
|
|
76
|
+
|
|
77
|
+
`vnma` addresses this by downloading, building, and extracting platform-compatible wheels directly into the project directory while maintaining runtime path isolation and native binary compatibility.
|
|
78
|
+
|
|
79
|
+
### Key Capabilities
|
|
80
|
+
|
|
81
|
+
* **Hermetic Path Isolation:** Sanitizes `sys.path` during execution to prevent accidental leakage from system or user `site-packages`.
|
|
82
|
+
* **Static O(1) Binary Resolution:** Avoids filesystem tree traversal at startup by recording precomputed dynamic link library (DLL/SO) paths during installation.
|
|
83
|
+
* **Transitive DAG Resolution:** Evaluates version constraints across dependency trees, evaluating PEP 508 environment markers and detecting version conflicts.
|
|
84
|
+
* **Explicit Configuration (`vnma_config.toml`):** Allows local packages and complex dependencies to specify exact DLL directories, entry points, and export boundaries without heuristic guesswork.
|
|
85
|
+
* **Multi-Source Support:** Installs packages from PyPI, local filesystem paths (monorepos), and remote Git repositories.
|
|
86
|
+
* **Reproducible Builds:** Emits a deterministic `vnma.lock` tracking versions, sources, and binary metadata.
|
|
87
|
+
* **Automatic IDE Configuration:** Generates configuration for Visual Studio Code (`extraPaths`) and JetBrains PyCharm (`.idea` and `.env`).
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Current Status: Beta Notice
|
|
92
|
+
|
|
93
|
+
`vnma` is currently in **Beta**. While core workflows—such as installing native packages (`pygame-ce`), complex transitive graphs (`requests`), and local source trees—have been validated, edge cases exist across different platforms, compilers, and non-standard packaging layouts.
|
|
94
|
+
|
|
95
|
+
Users are encouraged to verify builds in testing environments before deploying to critical production pipelines. See [docs/en/02-Advice/01-beta-status.md](docs/en/02-Advice/01-beta-status.md) for detailed considerations.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Quickstart
|
|
100
|
+
|
|
101
|
+
### Installation
|
|
102
|
+
|
|
103
|
+
Install `vnma` using `pip`:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pip install -e .
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Basic Commands
|
|
110
|
+
|
|
111
|
+
Initialize a project:
|
|
112
|
+
```bash
|
|
113
|
+
vnma init
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Install a package from PyPI:
|
|
117
|
+
```bash
|
|
118
|
+
vnma install requests
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Install a package from a local directory:
|
|
122
|
+
```bash
|
|
123
|
+
vnma install "C:/path/to/my-library"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Execute a script using the vendored runtime:
|
|
127
|
+
```bash
|
|
128
|
+
vnma run main.py
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
List installed packages:
|
|
132
|
+
```bash
|
|
133
|
+
vnma list
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Prune orphaned packages not declared in `vnma.toml`:
|
|
137
|
+
```bash
|
|
138
|
+
vnma prune --dry-run
|
|
139
|
+
vnma prune --yes
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Restore dependencies in offline mode:
|
|
143
|
+
```bash
|
|
144
|
+
vnma install --offline
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Documentation
|
|
150
|
+
|
|
151
|
+
Full documentation is available in the `docs/` directory:
|
|
152
|
+
|
|
153
|
+
* **Usage Guide:** [docs/en/01-Use/](docs/en/01-Use/)
|
|
154
|
+
* [01. Getting Started](docs/en/01-Use/01-getting-started.md)
|
|
155
|
+
* [02. Dependency Management](docs/en/01-Use/02-dependency-management.md)
|
|
156
|
+
* [03. Configuration Specifications](docs/en/01-Use/03-configuration-specs.md)
|
|
157
|
+
* [04. Runtime Execution Model](docs/en/01-Use/04-runtime-execution.md)
|
|
158
|
+
* [05. IDE Integration](docs/en/01-Use/05-ide-integration.md)
|
|
159
|
+
* **Design & Guidance:** [docs/en/02-Advice/](docs/en/02-Advice/)
|
|
160
|
+
* [01. Beta Status & Stability](docs/en/02-Advice/01-beta-status.md)
|
|
161
|
+
* [02. Known Limitations](docs/en/02-Advice/02-known-limitations.md)
|
|
162
|
+
* [03. Future Roadmap](docs/en/02-Advice/03-future-roadmap.md)
|
|
163
|
+
* [04. Community Vision](docs/en/02-Advice/04-community-vision.md)
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
This software is released under a modified permissive license. Commercial resale of the tool itself is prohibited, and bundled distributions must retain reciprocal licensing. See [LICENSE](LICENSE) for terms.
|
vnma-0.1.0/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# VNMA (Vendor Manager)
|
|
2
|
+
|
|
3
|
+
> **Status:** Beta (v0.1.0)
|
|
4
|
+
> **Platform Support:** CPython 3.11+ (Tested on Windows and Linux)
|
|
5
|
+
|
|
6
|
+
`vnma` is a dependency and vendoring manager for Python projects. It manages project dependencies inside a local, isolated vendor directory (`vendor/` or `vendor_vnma/`) instead of creating or replicating full Python virtual environments (`venv`).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Traditional Python development relies on virtual environments, which duplicate the interpreter executable and standard library layout. While effective for system isolation, virtual environments introduce overhead in container builds, portable deployments, and shared team workflows where only runtime libraries are required.
|
|
13
|
+
|
|
14
|
+
`vnma` addresses this by downloading, building, and extracting platform-compatible wheels directly into the project directory while maintaining runtime path isolation and native binary compatibility.
|
|
15
|
+
|
|
16
|
+
### Key Capabilities
|
|
17
|
+
|
|
18
|
+
* **Hermetic Path Isolation:** Sanitizes `sys.path` during execution to prevent accidental leakage from system or user `site-packages`.
|
|
19
|
+
* **Static O(1) Binary Resolution:** Avoids filesystem tree traversal at startup by recording precomputed dynamic link library (DLL/SO) paths during installation.
|
|
20
|
+
* **Transitive DAG Resolution:** Evaluates version constraints across dependency trees, evaluating PEP 508 environment markers and detecting version conflicts.
|
|
21
|
+
* **Explicit Configuration (`vnma_config.toml`):** Allows local packages and complex dependencies to specify exact DLL directories, entry points, and export boundaries without heuristic guesswork.
|
|
22
|
+
* **Multi-Source Support:** Installs packages from PyPI, local filesystem paths (monorepos), and remote Git repositories.
|
|
23
|
+
* **Reproducible Builds:** Emits a deterministic `vnma.lock` tracking versions, sources, and binary metadata.
|
|
24
|
+
* **Automatic IDE Configuration:** Generates configuration for Visual Studio Code (`extraPaths`) and JetBrains PyCharm (`.idea` and `.env`).
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Current Status: Beta Notice
|
|
29
|
+
|
|
30
|
+
`vnma` is currently in **Beta**. While core workflows—such as installing native packages (`pygame-ce`), complex transitive graphs (`requests`), and local source trees—have been validated, edge cases exist across different platforms, compilers, and non-standard packaging layouts.
|
|
31
|
+
|
|
32
|
+
Users are encouraged to verify builds in testing environments before deploying to critical production pipelines. See [docs/en/02-Advice/01-beta-status.md](docs/en/02-Advice/01-beta-status.md) for detailed considerations.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Quickstart
|
|
37
|
+
|
|
38
|
+
### Installation
|
|
39
|
+
|
|
40
|
+
Install `vnma` using `pip`:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install -e .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Basic Commands
|
|
47
|
+
|
|
48
|
+
Initialize a project:
|
|
49
|
+
```bash
|
|
50
|
+
vnma init
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Install a package from PyPI:
|
|
54
|
+
```bash
|
|
55
|
+
vnma install requests
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Install a package from a local directory:
|
|
59
|
+
```bash
|
|
60
|
+
vnma install "C:/path/to/my-library"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Execute a script using the vendored runtime:
|
|
64
|
+
```bash
|
|
65
|
+
vnma run main.py
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
List installed packages:
|
|
69
|
+
```bash
|
|
70
|
+
vnma list
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Prune orphaned packages not declared in `vnma.toml`:
|
|
74
|
+
```bash
|
|
75
|
+
vnma prune --dry-run
|
|
76
|
+
vnma prune --yes
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Restore dependencies in offline mode:
|
|
80
|
+
```bash
|
|
81
|
+
vnma install --offline
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
Full documentation is available in the `docs/` directory:
|
|
89
|
+
|
|
90
|
+
* **Usage Guide:** [docs/en/01-Use/](docs/en/01-Use/)
|
|
91
|
+
* [01. Getting Started](docs/en/01-Use/01-getting-started.md)
|
|
92
|
+
* [02. Dependency Management](docs/en/01-Use/02-dependency-management.md)
|
|
93
|
+
* [03. Configuration Specifications](docs/en/01-Use/03-configuration-specs.md)
|
|
94
|
+
* [04. Runtime Execution Model](docs/en/01-Use/04-runtime-execution.md)
|
|
95
|
+
* [05. IDE Integration](docs/en/01-Use/05-ide-integration.md)
|
|
96
|
+
* **Design & Guidance:** [docs/en/02-Advice/](docs/en/02-Advice/)
|
|
97
|
+
* [01. Beta Status & Stability](docs/en/02-Advice/01-beta-status.md)
|
|
98
|
+
* [02. Known Limitations](docs/en/02-Advice/02-known-limitations.md)
|
|
99
|
+
* [03. Future Roadmap](docs/en/02-Advice/03-future-roadmap.md)
|
|
100
|
+
* [04. Community Vision](docs/en/02-Advice/04-community-vision.md)
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
This software is released under a modified permissive license. Commercial resale of the tool itself is prohibited, and bundled distributions must retain reciprocal licensing. See [LICENSE](LICENSE) for terms.
|
vnma-0.1.0/plan.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# 📦 VNMA — Vendor Manager para Python
|
|
2
|
+
**Documento de Planificación y Especificación Técnica**
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 1. Visión del Proyecto
|
|
7
|
+
`vnma` (*Vendor Manager*) es una herramienta para Python diseñada para gestionar dependencias de proyectos mediante el patrón **vendoring**, eliminando la necesidad de crear y duplicar entornos virtuales completos (`venv`, copias completas de `python.exe`, librerías estándar).
|
|
8
|
+
|
|
9
|
+
Inspirado en la ergonomía de herramientas modernas como `npm`, `pnpm` o `cargo`:
|
|
10
|
+
- Las dependencias se instalan localmente en el proyecto en una carpeta aislada (`vendor/` o `vendor_vnma/`).
|
|
11
|
+
- La configuración de dependencias es declarativa vía TOML.
|
|
12
|
+
- No se suben binarios pesados al repositorio: un simple `vnma install` en cualquier máquina/arquitectura restaura las dependencias exactas y compatibles.
|
|
13
|
+
- Cero fricción con IDEs (autocompletado inmediato en VS Code y PyCharm).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Estructura de Directorios
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
mi-proyecto/
|
|
21
|
+
├── .vscode/
|
|
22
|
+
│ └── settings.json <-- Generado/actualizado por vnma (extraPaths)
|
|
23
|
+
├── .idea/
|
|
24
|
+
│ └── mi-proyecto.iml <-- Actualizado con sourceFolder vendor
|
|
25
|
+
├── vendor/ (o vendor_vnma/) <-- Ignorado en git automáticamente
|
|
26
|
+
│ ├── .vnma_meta/
|
|
27
|
+
│ │ ├── manifest.json <-- Registro de archivos por paquete (para uninstall limpio)
|
|
28
|
+
│ │ ├── python_version <-- Versión de Python con la que se compiló/instaló
|
|
29
|
+
│ │ └── .bin/ <-- Ejecutables CLI / wrappers (estilo node_modules/.bin)
|
|
30
|
+
│ ├── pygame/ <-- Código y binarios .pyd / DLLs
|
|
31
|
+
│ ├── pygame-2.5.6.dist-info/
|
|
32
|
+
│ └── __bootstrap__.py <-- Inyector de sys.path y os.add_dll_directory
|
|
33
|
+
├── .gitignore <-- vnma añade automáticamente vendor/
|
|
34
|
+
├── vnma.toml <-- Declaración de dependencias del proyecto (o pyproject.toml)
|
|
35
|
+
├── vnma.lock <-- Lockfile con versiones exactas, hashes y compatibilidad
|
|
36
|
+
├── main.py
|
|
37
|
+
└── test.py
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Reglas de selección de directorio:
|
|
41
|
+
1. Si no existe ninguna carpeta: crear `vendor/`.
|
|
42
|
+
2. Si `vendor/` existe y pertenece a otra herramienta (no contiene metadatos de vnma ni fue creado por él): usar `vendor_vnma/`.
|
|
43
|
+
3. Si el usuario lo prefiere, permitir configurarlo vía `vnma.toml` (`[tool.vnma] vendor_dir = "custom_vendor"`).
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 3. Declaración de Dependencias y Lockfile (Exportabilidad)
|
|
48
|
+
|
|
49
|
+
### A. Archivo de Configuración (`vnma.toml` o `pyproject.toml`)
|
|
50
|
+
Para permitir exportar el código sin paquetes compilados (estilo `npm install`):
|
|
51
|
+
|
|
52
|
+
```toml
|
|
53
|
+
[project]
|
|
54
|
+
name = "mi-proyecto"
|
|
55
|
+
version = "0.1.0"
|
|
56
|
+
|
|
57
|
+
[dependencies]
|
|
58
|
+
pygame = ">=2.5.0, <2.6.0"
|
|
59
|
+
requests = "^2.31.0"
|
|
60
|
+
|
|
61
|
+
[dev-dependencies]
|
|
62
|
+
pytest = "*"
|
|
63
|
+
|
|
64
|
+
[tool.vnma]
|
|
65
|
+
vendor_dir = "vendor"
|
|
66
|
+
ide_integration = ["vscode", "pycharm"]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### B. `vnma.lock` (Reproducibilidad Garantizada)
|
|
70
|
+
Guarda la versión exacta resuelta y los hashes de los Wheels para asegurar que cada máquina reconstruya el mismo árbol de dependencias:
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"version": "1.0",
|
|
74
|
+
"python_requires": ">=3.10",
|
|
75
|
+
"packages": {
|
|
76
|
+
"pygame": {
|
|
77
|
+
"version": "2.5.6",
|
|
78
|
+
"dependencies": {},
|
|
79
|
+
"hashes": ["sha256:..."]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 4. Resolución e Instalación Multiplataforma
|
|
88
|
+
|
|
89
|
+
### Flujo de `vnma install` (sin argumentos) o `vnma install .`:
|
|
90
|
+
1. Lee `vnma.toml` (o sección `[tool.vnma]` en `pyproject.toml`).
|
|
91
|
+
2. Comprueba si existe `vnma.lock`:
|
|
92
|
+
- Si existe, usa las versiones fijadas.
|
|
93
|
+
- Si no existe, resuelve el grafo de dependencias contra PyPI.
|
|
94
|
+
3. **Detección de Arquitectura y Plataforma Anfitrión**:
|
|
95
|
+
- Detecta la versión de Python (`sys.version_info`), sistema operativo (`win32`, `linux`, `darwin`) y arquitectura (`amd64`, `arm64`).
|
|
96
|
+
- Busca el Wheel óptimo (`cp311-win_amd64.whl`, `manylinux_x86_64.whl`, etc.) o fallback a sdist/pure-python si aplica.
|
|
97
|
+
4. **Caché Global de Paquetes (`~/.vnma/cache/wheels`)**:
|
|
98
|
+
- Evita volver a descargar ruedas si ya fueron bajadas anteriormente para otro proyecto.
|
|
99
|
+
5. **Extracción y Registro**:
|
|
100
|
+
- Descomprime el Wheel en `vendor/`.
|
|
101
|
+
- Lee el archivo `RECORD` dentro del `.dist-info` y guarda el mapeo en `manifest.json`.
|
|
102
|
+
6. **Guardado de versión de Python**:
|
|
103
|
+
- Escribe en `vendor/.vnma_meta/python_version` la tupla `(major, minor, micro)`.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 5. Soporte de Binarios, DLLs y Extensiones C/C++
|
|
108
|
+
|
|
109
|
+
### El desafío en Windows (Python 3.8+)
|
|
110
|
+
En Windows, Python 3.8+ ya no busca DLLs secundarias usando el `PATH` global del sistema ni carpetas relativas no registradas. Si una librería como `pygame` o `numpy` contiene DLLs empaquetadas (como `SDL2.dll` o `openblas.dll`), fallará al importarse a menos que se use `os.add_dll_directory()`.
|
|
111
|
+
|
|
112
|
+
### Solución en VNMA:
|
|
113
|
+
1. **Archivo `__bootstrap__.py` generado en `vendor/`**:
|
|
114
|
+
```python
|
|
115
|
+
import sys
|
|
116
|
+
import os
|
|
117
|
+
|
|
118
|
+
VENDOR_ROOT = os.path.dirname(os.path.abspath(__file__))
|
|
119
|
+
|
|
120
|
+
# 1. Inyectar sys.path prioritario
|
|
121
|
+
if VENDOR_ROOT not in sys.path:
|
|
122
|
+
sys.path.insert(0, VENDOR_ROOT)
|
|
123
|
+
|
|
124
|
+
# 2. Registrar directorios con DLLs en Windows
|
|
125
|
+
if sys.platform == "win32" and hasattr(os, "add_dll_directory"):
|
|
126
|
+
os.add_dll_directory(VENDOR_ROOT)
|
|
127
|
+
for root, dirs, files in os.walk(VENDOR_ROOT):
|
|
128
|
+
if any(f.lower().endswith(".dll") for f in files):
|
|
129
|
+
try:
|
|
130
|
+
os.add_dll_directory(root)
|
|
131
|
+
except OSError:
|
|
132
|
+
pass
|
|
133
|
+
```
|
|
134
|
+
2. **Métodos de Consumo por el Usuario**:
|
|
135
|
+
- **Opción A (automática con runner)**: `vnma run main.py` inyecta automáticamente el bootstrap antes de arrancar.
|
|
136
|
+
- **Opción B (código nativo sin CLI)**: Al inicio de `main.py`, el usuario solo necesita:
|
|
137
|
+
```python
|
|
138
|
+
import vendor.__bootstrap__
|
|
139
|
+
import pygame
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 6. Integración Inteligente con Git (`.gitignore`)
|
|
145
|
+
|
|
146
|
+
Al ejecutar `vnma init`, `vnma install`, o cuando se detecte un `.gitignore`:
|
|
147
|
+
1. Verifica si `.gitignore` existe en la raíz del proyecto. Si no existe, pregunta o lo crea.
|
|
148
|
+
2. Comprueba si el directorio vendor ya está ignorado (evitando duplicados mediante comprobación de regex/línea exacta).
|
|
149
|
+
3. Añade un bloque limpio y delimitado:
|
|
150
|
+
```gitignore
|
|
151
|
+
# --- VNMA (Vendor Manager) ---
|
|
152
|
+
/vendor/
|
|
153
|
+
/vendor_vnma/
|
|
154
|
+
vnma_cache/
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 7. Integración con IDEs (VS Code y PyCharm)
|
|
160
|
+
|
|
161
|
+
Para que los IDEs reconozcan los paquetes, ofrezcan autocompletado y análisis estático de tipos:
|
|
162
|
+
|
|
163
|
+
### A. Visual Studio Code
|
|
164
|
+
Actualiza o crea `.vscode/settings.json` sin borrar configuraciones existentes del usuario:
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"python.analysis.extraPaths": ["./vendor"],
|
|
168
|
+
"python.autoComplete.extraPaths": ["./vendor"]
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### B. PyCharm
|
|
173
|
+
- Detecta archivos `.idea/*.iml` y agrega `<sourceFolder url="file://$MODULE_DIR$/vendor" isTestSource="false" />`.
|
|
174
|
+
- Como salvaguarda adicional universal, crea o actualiza un archivo `.env` en la raíz del proyecto con `PYTHONPATH=./vendor`, que PyCharm carga de forma nativa en todas sus configuraciones de ejecución y consola.
|
|
175
|
+
|
|
176
|
+
### C. Generación de Stubs para Binarios (.pyd)
|
|
177
|
+
- Para paquetes compilados que no incluyan archivos `.pyi` de fábrica, `vnma` incluirá una opción `vnma stubs generate` para inspeccionar los `.pyd` y generar stubs con firmas de funciones, garantizando autocompletado perfecto.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 8. CLI y Binarios Ejecutables (`.bin` estilo `npx`)
|
|
182
|
+
|
|
183
|
+
Cuando se instalan herramientas de línea de comandos en `vendor/` (por ejemplo `black`, `flake8`, `pytest`):
|
|
184
|
+
- Los Wheels incluyen scripts en `nombre_paquete.data/scripts/` o definen `entry_points` en `entry_points.txt`.
|
|
185
|
+
- `vnma` generará wrappers ejecutables en `vendor/.vnma_meta/.bin/` (archivos `.bat` / `.cmd` en Windows y scripts bash en Unix).
|
|
186
|
+
- Comando `vnma exec <tool>`:
|
|
187
|
+
```bash
|
|
188
|
+
vnma exec pytest
|
|
189
|
+
vnma exec black .
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 9. Detección de Desajustes de Versión de Python
|
|
195
|
+
|
|
196
|
+
Si un usuario instaló `vendor/` usando Python 3.10 y luego abre el proyecto con Python 3.12 (o viceversa):
|
|
197
|
+
- Los binarios `.pyd` de Python 3.10 fallarán inmediatamente con errores Crípticos de importación (`DLL load failed: specified module could not be found`).
|
|
198
|
+
- `vnma` guarda la versión activa en `vendor/.vnma_meta/python_version`.
|
|
199
|
+
- Al ejecutar `vnma run` o invocar el bootstrap, verifica:
|
|
200
|
+
```text
|
|
201
|
+
[WARNING] 'vendor/' fue construido con Python 3.10.4, pero estás ejecutando Python 3.12.1.
|
|
202
|
+
Los paquetes con binarios compilados podrían fallar.
|
|
203
|
+
Ejecuta 'vnma install --rebuild' para reinstalar para la versión actual.
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 10. Catálogo de Comandos de `vnma`
|
|
209
|
+
|
|
210
|
+
| Comando | Descripción |
|
|
211
|
+
| :--- | :--- |
|
|
212
|
+
| `vnma init` | Crea `vnma.toml`, configura `.gitignore` y sincroniza IDEs. |
|
|
213
|
+
| `vnma install` | Instala todas las dependencias declaradas en `vnma.toml` / `vnma.lock`. |
|
|
214
|
+
| `vnma install <pkg> [flags]` | Descarga e instala un paquete específico (ej: `vnma install pygame==2.5.6`). |
|
|
215
|
+
| `vnma uninstall <pkg>` | Desinstala un paquete y elimina sus archivos según su `RECORD`. |
|
|
216
|
+
| `vnma prune` | Elimina del directorio `vendor/` cualquier paquete que no esté en `vnma.toml`. |
|
|
217
|
+
| `vnma run <script.py>` | Ejecuta un script inyectando `vendor/` y DLLs en el intérprete del sistema. |
|
|
218
|
+
| `vnma exec <binary>` | Ejecuta un CLI instalado en `vendor/` (ej: `vnma exec pytest`). |
|
|
219
|
+
| `vnma sync-ide` | Regenera configuraciones de VS Code y PyCharm. |
|
|
220
|
+
| `vnma check` | Valida compatibilidad de binarios, versiones de Python y salud de `vendor/`. |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 11. Hoja de Ruta de Implementación (Fases)
|
|
225
|
+
|
|
226
|
+
1. **Fase 1: Módulo Core y Descargador de Wheels**
|
|
227
|
+
- Lógica de detección de plataforma y tags (`packaging.tags` / `sys_tags`).
|
|
228
|
+
- Cliente de descarga PyPI con caché en disco.
|
|
229
|
+
- Extractor de Wheels y gestor de carpetas `vendor/` / `vendor_vnma/`.
|
|
230
|
+
2. **Fase 2: Desinstalador y Manifiesto**
|
|
231
|
+
- Parseo de `RECORD` e índices de metadatos.
|
|
232
|
+
- Limpieza de paquetes y dependencias no compartidas.
|
|
233
|
+
3. **Fase 3: Declaratividad (`vnma.toml` & `vnma.lock`)**
|
|
234
|
+
- Parser TOML.
|
|
235
|
+
- Comando `vnma install` estilo `npm install`.
|
|
236
|
+
4. **Fase 4: Runtime Bootstrap & Windows DLLs**
|
|
237
|
+
- Generación de `vendor/__bootstrap__.py`.
|
|
238
|
+
- Comando `vnma run`.
|
|
239
|
+
5. **Fase 5: Sincronización de Entorno (Git & IDEs)**
|
|
240
|
+
- Modificador idempotente de `.gitignore`.
|
|
241
|
+
- Modificador de `.vscode/settings.json`, `.idea/` y `.env`.
|
|
242
|
+
6. **Fase 6: CLI Definitiva y Pruebas Reales**
|
|
243
|
+
- Pruebas end-to-end con `pygame` y paquetes binarios en Windows.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vnma"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Vendor Manager for Python — hermetic, zero-venv dependency management."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "VNMA Team" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["vendoring", "packaging", "dependencies", "hermetic", "pip"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Topic :: Software Development :: Build Tools",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
]
|
|
27
|
+
dependencies = []
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/GrandKenzy/vnma"
|
|
31
|
+
Documentation = "https://github.com/GrandKenzy/vnma/tree/main/docs"
|
|
32
|
+
Repository = "https://github.com/GrandKenzy/vnma.git"
|
|
33
|
+
"Bug Tracker" = "https://github.com/GrandKenzy/vnma/issues"
|
|
34
|
+
|
|
35
|
+
[project.scripts]
|
|
36
|
+
vnma = "vnma.cli:main"
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.packages.find]
|
|
39
|
+
where = ["."]
|
|
40
|
+
include = ["vnma*"]
|
|
41
|
+
exclude = ["tests*", "docs*"]
|
vnma-0.1.0/setup.cfg
ADDED