Vendor internal packages from private PyPI for offline production deployments
Project description
Poetry Vendor Plugin
Vendor internal packages from private PyPI repositories for offline/air-gapped production deployments.
The Problem
You have internal Python packages hosted on a PyPI server inside your company LAN. Development machines can reach it, but production servers cannot (either air-gapped or on a different network). You need a way to bundle those internal packages as wheels into your project so production can install them without network access.
The Solution
This plugin adds poetry vendor pull — a command that downloads your configured internal packages as wheels into a vendor/ directory. You commit those wheels, and production installs from them using Poetry path dependencies.
Installation
Poetry plugins are installed into Poetry's own environment:
poetry self add poetry-vendor-plugin
Verify the plugin is loaded:
poetry self show plugins
Example
See the example/ directory for a complete, runnable project that configures one private PyPI server and two vendored packages.
Usage
1. Configure vendor packages in your project
Add to your project's pyproject.toml:
[tool.vendor]
vendor-dir = "vendor"
[tool.vendor.server]
internal = "https://internal-pypi.company.local/simple/"
[tool.vendor.packages.internal]
my-build-tools = "^1.0.0"
my-ui-elements = ">=2.0.0,<3.0.0"
2. Pull vendor packages
poetry vendor pull
This downloads wheels to vendor/:
vendor/
├── my_build_tools.whl
├── my_ui_elements.whl
└── vendor.lock
The wheel files use stable, version-less names, and vendor.lock records the resolved versions. Commit both the wheels and the lock file.
3. Use path dependencies in production
In your pyproject.toml, switch to path dependencies for production builds:
[tool.poetry.dependencies]
python = "^3.11"
requests = "^2.31"
my-build-tools = { path = "vendor/my_build_tools.whl" }
my-ui-elements = { path = "vendor/my_ui_elements.whl" }
4. List vendored packages
poetry vendor list
5. Update vendor packages
poetry vendor update # Update all
poetry vendor update -p my-build-tools # Update specific package
Commands
| Command | Description |
|---|---|
poetry vendor pull |
Download vendor packages to vendor/ |
poetry vendor pull --force |
Re-download even if already present |
poetry vendor pull --dry-run |
Preview what would be downloaded |
poetry vendor list |
Show all vendored packages with sizes |
poetry vendor update |
Force re-download all packages |
Configuration Reference
[tool.vendor]
vendor-dir = "vendor" # Directory for vendored wheels (default: "vendor")
[tool.vendor.server]
server1 = "https://..." # Named private PyPI index URL
[tool.vendor.packages.server1]
package-name = "^1.0.0" # Package name and PEP 440 version specifier
You can define multiple servers and group packages under the server they come from:
[tool.vendor.server]
internal = "https://internal-pypi.company.local/simple/"
legacy = "https://legacy-pypi.company.local/simple/"
[tool.vendor.packages.internal]
my-build-tools = "^1.0.0"
[tool.vendor.packages.legacy]
old-ui-elements = ">=1.0.0,<2.0.0"
Lock File
After running poetry vendor pull, a <vendor-dir>/vendor.lock file is created. It tracks the resolved version, source, and requested version specifier for each package. Commit this file alongside the wheels so that poetry vendor list can show accurate version information and so updates behave predictably across machines.
Requirements
- Python 3.9+
- Poetry 2.0+
License
MIT
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 poetry_vendor_plugin-0.2.1.tar.gz.
File metadata
- Download URL: poetry_vendor_plugin-0.2.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bc6366926d150b25e100bd5a084763acf5ef467d000e4839f8b155182eeab22
|
|
| MD5 |
7918b34738522bff5bd50dd1c22ba691
|
|
| BLAKE2b-256 |
6b96181a432471f4010c196dcf6b7bf753962d7df386056771edb42fd3eed528
|
File details
Details for the file poetry_vendor_plugin-0.2.1-py3-none-any.whl.
File metadata
- Download URL: poetry_vendor_plugin-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e585f3c9efdf347e328d733e931dd05bd608c717b4ce9b0a6b3ef9ea9cbbf448
|
|
| MD5 |
f432cb4c80831f868882afdca24e87e2
|
|
| BLAKE2b-256 |
d270917a7791a8ddb23b156614e5abe07187125787c459cae1703fee45ad758b
|