Thank you for your interest in contributing!
- Python 3.10+
- uv (fast Python package manager)
- Node.js (only if you are modifying TypeScript sources)
# Clone the repo
git clone https://github.com/gopalparashar421/lightweight-charts-python.git
cd lightweight-charts-python
# Install Python dependencies (including dev tools: pytest, ruff)
uv sync --group devHooks run automatically on every git commit and catch style issues before they reach CI.
pip install pre-commit
pre-commit installTo run hooks manually against all files:
pre-commit run --all-filesuv run python -m pytest test/ -vTests that require a live display (pywebview window) are skipped automatically in CI. To run them locally, ensure you have a display available:
uv run python -m pytest test/ -v -k "not skip"All Python code is formatted and linted with Ruff.
uv run ruff check lightweight_charts/ test/ # lint
uv run ruff format lightweight_charts/ test/ # formatThe compiled JS bundle (lightweight_charts/js/bundle.js) is committed to the repo.
Only rebuild it if you modify TypeScript sources under src/:
npm install
npm run buildDocs are built with Sphinx and hosted on Read the Docs. To build and preview them locally:
# Install docs dependencies (defined in the [docs] group in pyproject.toml)
uv sync --group docs
# Build HTML output
uv run sphinx-build -W --keep-going -b html docs/source docs/_build/html
# Open in your browser (macOS / Linux)
open docs/_build/html/index.html
# Windows
start docs/_build/html/index.htmlThe -W flag turns Sphinx warnings into errors — the same flag used in CI — so
you'll catch broken cross-references and missing toctree entries before pushing.
If you add, rename, or remove a public class or method, also update the matching
page under docs/source/reference/ and verify the build passes before opening a PR.
All pull requests must receive approval from a maintainer or repo collaborator before merging. No PR may be merged without at least one approving review from @gopalparashar421 or another listed collaborator.
Before opening a PR, you are responsible for:
- Version bump — increment the version in both
pyproject.toml(version = "...") andlightweight_charts/__version__to the appropriate next semver value. - Changelog — add an entry under the new version heading in
CHANGELOG.mdusing the Added / Changed / Fixed / Removed format. Do not leave the changelog blank.
A PR checklist is embedded in the pull request template (.github/PULL_REQUEST_TEMPLATE.md).
Releases are published to PyPI automatically by pushing a version tag:
git tag v1.0.1
git push origin v1.0.1The tag version must match pyproject.toml and lightweight_charts/__version__.