mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-28 05:32:54 +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
1.5 KiB
1.5 KiB
Publishing to PyPI
This document provides instructions for publishing the cursor-rules package to PyPI.
Prerequisites
- Create a PyPI account at https://pypi.org/account/register/
- Generate an API token at https://pypi.org/manage/account/token/
- Install required tools:
pip install build twine
Publishing Steps
-
Update the version in
src/__init__.py -
Build the package:
python -m build -
Test the package locally:
pip install --force-reinstall dist/cursor_rules-*.whl cursor-rules --help -
Upload to TestPyPI (optional):
python -m twine upload --repository testpypi dist/* -
Install from TestPyPI (optional):
pip install --index-url https://test.pypi.org/simple/ cursor-rules -
Upload to PyPI:
python -m twine upload dist/*
Using API Tokens
When using twine, you can either:
-
Create a
.pypircfile 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 -
Or provide credentials via environment variables:
export TWINE_USERNAME=__token__ export TWINE_PASSWORD=your_pypi_token -
Or enter them when prompted by twine.
Updating the Package
- Make your changes
- Update the version in
src/__init__.py - Rebuild and upload following the steps above