mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-27 21:22:55 +08:00
- Add .pypirc for PyPI and TestPyPI token configuration - Create MANIFEST.in to include necessary files for package distribution - Add PUBLISHING.md with detailed instructions for package publishing - Update pyproject.toml for build system configuration - Update README.md with PyPI installation instructions - Bump version to 0.4.0 in __init__.py - Include rules.json in package source for distribution
77 lines
1.5 KiB
Markdown
77 lines
1.5 KiB
Markdown
# Publishing to PyPI
|
|
|
|
This document provides instructions for publishing the `cursor-rules` package to PyPI.
|
|
|
|
## Prerequisites
|
|
|
|
1. Create a PyPI account at https://pypi.org/account/register/
|
|
2. Generate an API token at https://pypi.org/manage/account/token/
|
|
3. Install required tools:
|
|
```bash
|
|
pip install build twine
|
|
```
|
|
|
|
## Publishing Steps
|
|
|
|
1. Update the version in `src/__init__.py`
|
|
|
|
2. Build the package:
|
|
```bash
|
|
python -m build
|
|
```
|
|
|
|
3. Test the package locally:
|
|
```bash
|
|
pip install --force-reinstall dist/cursor_rules-*.whl
|
|
cursor-rules --help
|
|
```
|
|
|
|
4. Upload to TestPyPI (optional):
|
|
```bash
|
|
python -m twine upload --repository testpypi dist/*
|
|
```
|
|
|
|
5. Install from TestPyPI (optional):
|
|
```bash
|
|
pip install --index-url https://test.pypi.org/simple/ cursor-rules
|
|
```
|
|
|
|
6. Upload to PyPI:
|
|
```bash
|
|
python -m twine upload dist/*
|
|
```
|
|
|
|
## Using API Tokens
|
|
|
|
When using twine, you can either:
|
|
|
|
1. Create a `.pypirc` file in your home directory:
|
|
```
|
|
[distutils]
|
|
index-servers =
|
|
pypi
|
|
testpypi
|
|
|
|
[pypi]
|
|
username = __token__
|
|
password = your_pypi_token
|
|
|
|
[testpypi]
|
|
repository = https://test.pypi.org/legacy/
|
|
username = __token__
|
|
password = your_testpypi_token
|
|
```
|
|
|
|
2. Or provide credentials via environment variables:
|
|
```bash
|
|
export TWINE_USERNAME=__token__
|
|
export TWINE_PASSWORD=your_pypi_token
|
|
```
|
|
|
|
3. Or enter them when prompted by twine.
|
|
|
|
## Updating the Package
|
|
|
|
1. Make your changes
|
|
2. Update the version in `src/__init__.py`
|
|
3. Rebuild and upload following the steps above |