ventwig
Vendors source directories from a git repository into your project — as plain files, not as a submodule or package dependency.
Problem
If you maintain several small CLI tools that share configuration and logging boilerplate, the options are:
- Add a runtime PyPI dependency on that boilerplate — which anyone forking the tool has to explain
- Copy the files by hand — which drifts
ventwig is a third option: a dev-time tool that clones a canonical upstream repo, copies a designated subdirectory into your project tree, and tracks a content hash so it can detect if the local copy has been hand-edited since the last sync.
Install
pip install ventwig
ventwig is a dev-time tool. Do not list it in [project.dependencies].
Configure
In your project's pyproject.toml:
[[tool.ventwig.sources]]
name = "appkit"
local_path = "src/mypackage/_vendor/appkit"
upstream = "https://github.com/you/appkit.git"
upstream_path = "src/appkit" # optional — defaults to repo root
ref = "main" # branch name or tag
Multiple [[tool.ventwig.sources]] entries are allowed. ventwig requires the consuming project to be inside a git working tree.
Global options
These keys live in [tool.ventwig] (not inside a source block):
[tool.ventwig]
create_parent_package_markers = true # default; see below
Use
ventwig sync # sync all configured sources
ventwig sync appkit # sync one source by name
ventwig sync --dry-run # preview changes without writing anything
ventwig sync --force # overwrite even if local content has drifted
ventwig sync --add-runtime-dependencies # also add missing upstream deps (see below)
ventwig status # show sync state for all sources
ventwig status appkit # show sync state for one source
After a successful sync, ventwig writes .ventwig.lock alongside your pyproject.toml. Commit it — it records the synced commit hash and a content tree hash used for drift detection on the next sync.
Package discovery and __init__.py markers
When vendoring into a src/ layout project that uses setuptools' normal package discovery, every intermediate directory in the vendored path must be a Python package (i.e., contain __init__.py). For example, given:
local_path = "src/mypackage/_vendor/appkit"
After sync, src/mypackage/_vendor/appkit/__init__.py exists (it came from upstream), but src/mypackage/_vendor/__init__.py does not — which causes setuptools to silently skip the vendored code during pip install.
By default, ventwig creates any missing __init__.py files in parent directories, walking up from local_path until it reaches a directory that already has one. To disable this behavior:
[tool.ventwig]
create_parent_package_markers = false
Runtime dependency checking
When syncing, ventwig reads the upstream package's [project.dependencies] and compares them against the downstream project's declared dependencies. Any upstream runtime dependency that is absent downstream is reported as a warning:
Warning: upstream runtime deps missing from downstream project:
- structlog>=21.0
Tip: re-run with --add-runtime-dependencies to add them automatically.
To have ventwig add the missing dependencies directly to your pyproject.toml:
ventwig sync --add-runtime-dependencies
This uses tomlkit to edit the file in place, so comments and formatting are preserved. Dependency version specifiers are copied verbatim from upstream; review them before committing. If the upstream has no pyproject.toml or declares no runtime dependencies, this step is silently skipped.
What it is not
- Not a package manager. It vendors files, not installed packages.
- Not bidirectional. Edits always happen upstream; ventwig only pulls.
- Not
git subtreeorgit submodule. The vendored directory is plain tracked content with no git history coupling.
Metadata
Release files for ventwig 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ventwig-0.2.0.tar.gz | 52.1 kB | Without provenance | Details for ventwig-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ventwig-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ventwig-0.2.0-py3-none-any.whl |
Total release size: 64.6 kB
Release files / ventwig-0.2.0.tar.gz
| Download URL | ventwig-0.2.0.tar.gz |
|---|---|
| Size | 52.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b04914cc960746497497e9072c7e9e876be4b8bc7290783b1c7de5b428393d6
|
|
BLAKE2b-256 checksum How to use checksums |
60c2a29037ff76ba6d8e4379b59651b849a69b21062f7f09a247cb104f4bcc7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / ventwig-0.2.0-py3-none-any.whl
| Download URL | ventwig-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc2aaa53b8b143ee878be37546a61deb417e738be6d269b3950b661821fff102
|
|
BLAKE2b-256 checksum How to use checksums |
8a3a6f99122e27fe7919c011c4804ba35074f0d4b8e20b6a7834e04a6759bb4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for ventwig 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.