Files
main/cursor-rules-cli/PUBLISHING.md
T
sanjeed5 34046a1da0 Add publishing configuration and package metadata for PyPI distribution
- 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
2025-02-28 19:43:17 +05:30

1.5 KiB

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:
    pip install build twine
    

Publishing Steps

  1. Update the version in src/__init__.py

  2. Build the package:

    python -m build
    
  3. Test the package locally:

    pip install --force-reinstall dist/cursor_rules-*.whl
    cursor-rules --help
    
  4. Upload to TestPyPI (optional):

    python -m twine upload --repository testpypi dist/*
    
  5. Install from TestPyPI (optional):

    pip install --index-url https://test.pypi.org/simple/ cursor-rules
    
  6. Upload to PyPI:

    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:

    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