A tiny custom package manager wrapper for Python projects (venv + pip-tools automation)
Project description
cpm-tool
📦 A tiny custom package manager wrapper for Python projects.
Automates venv creation, pip-tools bootstrap, and requirements.in / requirements.txt maintenance.
Installs as a single command: cpm.
Install
pip install cpm-tool
Usage
cpm requests flask # install package(s), pin them in requirements.in, recompile requirements.txt
cpm -r # or --refresh: rebuild requirements.in/.txt from the current venv
cpm -i # or --install: install everything from requirements.txt
cpm -h # or --help
cpm automatically creates a local venv/ if one doesn't exist yet, and
installs pip-tools into it the first time it's needed.
Development
git clone https://github.com/yourusername/cpm-tool.git
cd cpm-tool
python3 -m venv venv
source venv/bin/activate
pip install -e .
cpm --help
Publishing to PyPI
Manual (first release)
- Bump the
versioninpyproject.toml. - Build the distribution:
pip install build twine python -m build
This producesdist/cpm_tool-<version>-py3-none-any.whland a.tar.gz. - (Recommended) Upload to TestPyPI first:
twine upload --repository testpypi dist/* pip install --index-url https://test.pypi.org/simple/ cpm-tool
- Upload for real:
twine upload dist/*
You'll need a PyPI account and an API token (pypi.org → Account settings → API tokens).
Automated (GitHub Actions + trusted publishing)
This repo includes .github/workflows/publish.yml, which builds and publishes
automatically whenever you push a tag like v0.1.0. It uses PyPI's "trusted
publishing" (OIDC) so no API token needs to be stored in GitHub.
One-time setup on PyPI:
- Create the project on PyPI once (do the manual first upload above).
- Go to your project on pypi.org → Publishing → Add a new publisher.
- Fill in: GitHub owner, repository name (
cpm-tool), workflow filename (publish.yml), and environment name (pypi).
Then, for every future release:
git tag v0.1.1
git push origin v0.1.1
GitHub Actions builds the package and publishes it automatically.
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 cpm_tool-0.1.0.tar.gz.
File metadata
- Download URL: cpm_tool-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69224f4f09c8d8983cb3c31e717655239d8945b11beee4a8b00f27f979c10fb9
|
|
| MD5 |
f110466e936becafaf74a74ad8a40e64
|
|
| BLAKE2b-256 |
2d9e42bdd3b8fb3129f96f184026fd92964bf06d1a5ce218df1eb407b2fa9cda
|
File details
Details for the file cpm_tool-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cpm_tool-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bb097778860d1b775f68c5c039038abc143b81ec17c0692a1e766f1bfae42d8
|
|
| MD5 |
248fc667b82066ff099ddb0d70a8dca0
|
|
| BLAKE2b-256 |
cd5bc1d0eae3a9f59eab2970e5780969d17432c9aea45b8f0d81836308054623
|