Skip to main content

RCLCO Python library

Project description

RCLCO Python Library

A Python library for RCLCO.

Installation

Install from PyPI:

pip install rclco

Or using uv:

uv pip install rclco

Development

This project uses uv for dependency management. uv is an extremely fast Python package manager written in Rust that replaces pip, poetry, pyenv, and virtualenv.

Installing uv

Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Alternative (via pip):

pip install uv

After installation, restart your terminal or run refreshenv to ensure uv is available in your PATH.

Getting Started (Full Workflow)

  1. Clone the repository:
git clone https://github.com/RCLCO-RFA/python-rclco.git
cd python-rclco
  1. Install all dependencies (including dev dependencies):
uv sync --all-extras

This command will:

  • Create a virtual environment in .venv (if it doesn't exist)
  • Install all project dependencies
  • Install the package in editable mode
  1. Activate the virtual environment (optional):

uv commands automatically use the virtual environment, but if you want to activate it manually:

# Windows PowerShell
.venv\Scripts\Activate.ps1

# Windows Command Prompt
.venv\Scripts\activate.bat

# macOS/Linux
source .venv/bin/activate

Common uv Commands

Task Command
Install all dependencies uv sync
Install with dev dependencies uv sync --all-extras
Add a new dependency uv add <package>
Add a dev dependency uv add --dev <package>
Remove a dependency uv remove <package>
Update all dependencies uv lock --upgrade then uv sync
Run a command in the venv uv run <command>
Run Python uv run python
Run tests uv run pytest

Adding Dependencies

Add a runtime dependency:

uv add requests

Add a dev-only dependency:

uv add --dev black ruff mypy

Add a dependency with version constraints:

uv add "pandas>=2.0"

After adding dependencies, the pyproject.toml and uv.lock files will be updated automatically. Commit both files to version control.

Running Tests

uv run pytest

To run with verbose output:

uv run pytest -v

Building and Publishing

This project uses tag-based versioning with hatch-vcs. The version is automatically derived from git tags — no need to manually edit version strings in code.

How Versioning Works

  • The version is determined by git tags (e.g., v0.1.2 → version 0.1.2)
  • During development, the version includes git metadata (e.g., 0.1.2.dev3+g1234567)
  • When you build from a tagged commit, you get a clean version (e.g., 0.1.2)

Creating a Release

  1. Ensure all changes are committed and pushed to main

  2. Create and push a version tag:

git tag v0.2.0
git push origin v0.2.0
  1. GitHub Actions automatically:
    • Runs all tests
    • Builds the package
    • Creates a GitHub Release with auto-generated release notes
    • Publishes to PyPI

Manual Build (for testing)

Build the package locally:

uv build

This creates distribution files in the dist/ directory.

Publish manually (if needed):

uv publish --token YOUR_PYPI_TOKEN

Setting Up PyPI Publishing (for maintainers)

To enable automatic publishing to PyPI:

  1. Create a PyPI API Token:

  2. Add the token to GitHub Secrets:

    • Go to your repo → SettingsSecrets and variablesActions
    • Click New repository secret
    • Name: PYPI_TOKEN
    • Value: paste your PyPI token
    • Click Add secret

Version Tag Format

Use semantic versioning with a v prefix:

Tag Version Description
v0.1.0 0.1.0 Initial release
v0.1.1 0.1.1 Patch release (bug fixes)
v0.2.0 0.2.0 Minor release (new features)
v1.0.0 1.0.0 Major release (breaking changes)

Development Workflow Summary

1. Clone repo          → git clone ... && cd python-rclco
2. Install deps        → uv sync --all-extras
3. Make changes        → edit code
4. Add dependencies    → uv add <package> or uv add --dev <package>
5. Run tests           → uv run pytest
6. Commit changes      → git add . && git commit -m "..."
7. Push to branch      → git push origin feature-branch
8. Open PR             → merge to main after review
9. Create release      → git tag v0.2.0 && git push origin v0.2.0

License

See LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rclco-0.1.4.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rclco-0.1.4-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file rclco-0.1.4.tar.gz.

File metadata

  • Download URL: rclco-0.1.4.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for rclco-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d04a8c078a1d73e95c993505722be31f3dbfc4c88602d2992fd716ebfbaa25f7
MD5 740288878583939c5e9b5ebbbe18b96e
BLAKE2b-256 efb45f2ed629a392fcdace4736cbcd3c7108b41b69a061b3ac5a084f54ddbf28

See more details on using hashes here.

File details

Details for the file rclco-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: rclco-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for rclco-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9d0eda4f9703467e60d163d8206144b9c4213d349b0d0dcf88b269a960686695
MD5 b1feacbcaae51a04e0a40058cda1e6f4
BLAKE2b-256 3d16768a51f589f3eee603caa9b4aabb8d083395b3c68e528806d9b44bae1eb7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page