Registry / devops / wagon
library1.0.3pypypi✓ verified 86d ago

Wagon is a Python library and command-line tool designed to create self-contained Python Wheel-based archives. It bundles packages along with their dependencies into 'wagons' (files with a .wgn extension), simplifying their distribution and offline installation. The current stable version is 1.0.3, with an irregular release cadence focusing on stability and broader compatibility.

pip install wagon
INSTALL
IMPORT
SIG · WAGON
W
wagon
devopspythonv1.0.3
Install
2.6s avg
Import
176ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.182s · 19.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.6s · import 0.170s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

create
from wagon import create
For programmatic wagon creation.
install
from wagon import install
For programmatic wagon installation.

This quickstart demonstrates how to programmatically create a .wgn archive for a specified package (e.g., 'requests') using the `wagon.create` function. It creates the wagon in a temporary directory and then cleans up.

import os import tempfile import shutil from wagon import create # Define the package to create a wagon for package_name = "requests" # Create a temporary directory for the output wagon file output_dir = tempfile.mkdtemp() try: print(f"Creating wagon for '{package_name}' in '{output_dir}'...") # The 'create' function returns the path to the generated .wgn file created_wagon_path = create( source=package_name, output_path=output_dir, version=None, # Automatically fetches the latest version pip_args=None # Pass additional pip arguments if needed, e.g., ['--no-deps'] ) print(f"Wagon created successfully: {created_wagon_path}") print(f"You can now install it using: wagon install {created_wagon_path}") except Exception as e: print(f"An error occurred during wagon creation: {e}") finally: # Clean up the temporary directory print(f"Cleaning up temporary directory: {output_dir}") shutil.rmtree(output_dir)
wagon --version
Debug
Known issues
breakingWagon versions 0.7.0 and higher dropped official support for Python 2.6 and Python 3.3, aligning with Wheel's dependency updates.
fix
For projects requiring Python 2.6 or 3.3, use `wagon<0.7.0`. For example, `pip install 'wagon<0.7.0'`.
affects: >=0.7.0
gotchaThe metadata keys for package name and version inside a wagon archive changed from `module_name`/`module_version` to `package_name`/`package_version`.
fix
If manually parsing wagon metadata, update your code to look for `package_name` and `package_version`. Consider adding fallback logic for older wagons if necessary.
affects: <0.2.2
gotchaThe default output format for wagons changed to `tar.gz` and the file extension to `.wgn` starting from version 0.3.0. Previously, it might have been a different archive format or extension.
fix
Expect `.wgn` files by default. If you require a `zip` format, use the `--format zip` flag in the CLI or equivalent in programmatic calls.
affects: >=0.3.0
gotchaPassing arbitrary pip arguments to `create` and `install` commands consolidated. Older versions used `--wheel-args` or `--install-args`, while newer versions use a single `-a` flag.
fix
Always use the `-a` flag (e.g., `wagon create -s flask -a '--retries 5'`) for passing arbitrary pip arguments to both `create` and `install` commands, as it's supported since 0.3.0.
affects: 0.2.4 - 0.2.5
Errors
Common errors & fixes
No module named 'wagon'
The 'wagon' library is not installed in your current Python environment or virtual environment.
fix
Install the library using `pip install wagon`.
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-...
This error often occurs when attempting to create a wagon using Python 2.6 or 3.3 with Wagon versions >= 0.7.0, which no longer support these Python versions.
fix
Upgrade your Python environment to 3.4 or higher, or explicitly install an older compatible Wagon version like `pip install 'wagon<0.7.0'`.
KeyError: 'module_name'
You are attempting to parse metadata from a wagon file created with Wagon versions older than 0.2.2, but your parsing logic expects the newer `package_name` or `package_version` keys.
fix
Update your metadata parsing logic to check for `package_name` and `package_version`. If you need to support older wagons, add a fallback to `module_name` and `module_version`.
Error: No such option: --wheel-args
You are using the deprecated `--wheel-args` or `--install-args` flags for passing arbitrary pip arguments.
fix
Use the unified `-a` flag instead. For example, `wagon create -s flask -a '--retries 5'` or `wagon install <wagon_file> -a '--no-deps'`.
Upgrade
Version history
1.0.3latest on PyPI · released Nov 14, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
wagon — pip install wagon · libregistry