Installation, Testing, & Publishing
Basic Installation
pip install monaco
Installing from Source
git clone https://github.com/scottshambaugh/monaco.git
cd monaco
uv sync --all-extras --group dev
Running Tests and Type Checking
uv run coverage run --source=monaco -m pytest && uv run coverage report -m
uv run mypy src tests/test*
Profiling
Edit the example to remove the plotting functions before profiling. Then upload the json output to speedscope.app to view the report.
uv tool install py-spy
uv run py-spy record -o election.speedscope.json --format speedscope --rate 50 -- python examples/election/election_example_monte_carlo_sim.py
Building Docs
ReadTheDocs will automatically build when the main branch is updated.
uv sync --group docs
cd docs
uv run make clean && uv run make html
Releasing a New Version and Publishing to PyPI
Update
CHANGELOG.mdUpdate the version in
pyproject.tomlUpdate and install the package
uv sync --upgrade --all-extras --group dev
Run tests, type checking, and linting locally
uv run ruff check . uv run ruff format --check . uv run coverage run --source=monaco -m pytest && uv run coverage report -m uv run mypy src tests/test*
Run plotting tests manually
Commit any changes and push up the main branch
Wait for CI tests to pass
Check that the docs are building
Create a new release, creating a new tag and including a changelog:
**Changelog**: https://github.com/scottshambaugh/monaco/blob/main/CHANGELOG.md **Full Diff**: https://github.com/scottshambaugh/monaco/compare/v0.x.x...v0.x.x
This will automatically publish the release to PyPI.