Lightweight automation tool designed to streamline the transition from development to distribution.
Project description
pyforge-deploy
Note: This is a personal/educational project. It is not intended to compete with established tools
pyforge-deploy is a lightweight automation CLI for Python projects, streamlining the transition from development to distribution. It automates Docker image creation, version management, and PyPI publishing with a simple, intelligent interface.
Features
- Docker Integration: Generates a project-specific Dockerfile from a Jinja2 template and detects the required Python version and dependencies.
- Version Management: Increments the project version (patch, minor, major) and verifies the new version is greater than the latest release on PyPI.
- PyPI Deployment: Builds source and wheel distributions and uploads them to PyPI or TestPyPI using token authentication.
- Dependency Detection: Scans for dependencies using pyproject.toml, requirements.txt, or import analysis.
- CLI Commands: Provides commands for building, deploying, and inspecting the project.
Installation
Available on PyPI: https://pypi.org/project/pyforge-deploy/.
pip install pyforge-deploy
Note: Docker must be installed and running for Docker-related features.
Usage
Get a list of all available commands and options:
pyforge-deploy --help
Common Commands
-
Initialize GitHub Action workflow:
pyforge-deploy init
-
Build a Docker Image:
pyforge-deploy docker-build --entry-point src/pyforge_deploy/cli.py --image-tag my-app:1.0.0
-
Deploy to PyPI (Test):
pyforge-deploy deploy-pypi --test --bump patch
-
Deploy a Specific Version:
pyforge-deploy deploy-pypi --version 2.1.0
-
Show Detected Dependencies:
pyforge-deploy show-deps -
Show Project Version:
pyforge-deploy show-version
Configuration
For PyPI publishing, provide an API token. Create a .env file in your project root:
PYPI_TOKEN=pypi-your-token-here
Or export PYPI_TOKEN as an environment variable in your shell or CI/CD system.
How It Works
- Version Engine: Resolves project version from
pyproject.toml,__about__.py, or.version_cache. Fetches latest PyPI version to avoid conflicts, writes final version tosrc/<package_name>/__about__.py. - Docker Builder: Detects dependencies and Python version, renders
Dockerfile.j2, and builds the image. - PyPI Distributor: Cleans build artifacts, runs
python -m build, uploads distributions withtwine.
Testing
Run the full test suite with:
pytest
Unit tests cover the CLI and builder components, located in the tests/ directory.
License
MIT License. See LICENSE for details..
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 pyforge_deploy-0.3.0.tar.gz.
File metadata
- Download URL: pyforge_deploy-0.3.0.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
184f030aecc1572b4163bf6b66bf25a9590d75f0078a3725624c66675a17cb9b
|
|
| MD5 |
e3498266354b3a879cb391f16322710a
|
|
| BLAKE2b-256 |
c092968538598b04968f7da27372582630c51230817de969b2d8b93e15e421ba
|
File details
Details for the file pyforge_deploy-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pyforge_deploy-0.3.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
370440bf98c822053a4c37e977e74795a909181ec5b7a1c382b4a8b6a5770a6f
|
|
| MD5 |
fa558ef646204912dd300b974a246fc7
|
|
| BLAKE2b-256 |
7aa2712a0d02b4c280f1932c9d5faffb9712cfacbb761112b1bcd9f17d21c982
|