Metadata-Version: 2.4
Name: cpm-tool
Version: 0.1.0
Summary: A tiny custom package manager wrapper for Python projects (venv + pip-tools automation)
Author-email: Your Name <you@example.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/cpm-tool
Project-URL: Issues, https://github.com/yourusername/cpm-tool/issues
Keywords: pip,pip-tools,venv,requirements,package-manager
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pip-tools>=7.0
Dynamic: license-file

# 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

```bash
pip install cpm-tool
```

## Usage

```bash
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

```bash
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)

1. Bump the `version` in `pyproject.toml`.
2. Build the distribution:
   ```bash
   pip install build twine
   python -m build
   ```
   This produces `dist/cpm_tool-<version>-py3-none-any.whl` and a `.tar.gz`.
3. (Recommended) Upload to TestPyPI first:
   ```bash
   twine upload --repository testpypi dist/*
   pip install --index-url https://test.pypi.org/simple/ cpm-tool
   ```
4. Upload for real:
   ```bash
   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:
1. Create the project on PyPI once (do the manual first upload above).
2. Go to your project on pypi.org → **Publishing** → **Add a new publisher**.
3. Fill in: GitHub owner, repository name (`cpm-tool`), workflow filename
   (`publish.yml`), and environment name (`pypi`).

Then, for every future release:
```bash
git tag v0.1.1
git push origin v0.1.1
```
GitHub Actions builds the package and publishes it automatically.

## License

MIT
