Publishing Guide
CityLearn is published on PyPI as citylearn and imports as citylearn.
Release Owner
Default release owner: @calofonseca.
Version Bump
Update
citylearn/__init__.py.Update releases.md.
Update affected reference pages when schema, actions, observations, KPIs or dataset contracts change.
Run validation from developer_guide.md.
Commit and tag.
Example:
git add citylearn/__init__.py README.md docs
git commit -m "Release v0.4.3"
git tag -a v0.4.3 -m "Release v0.4.3"
git push --follow-tags origin master
PyPI Workflow
Use the existing PyPI project named
citylearn.Confirm the GitHub
pypienvironment has validPYPI_USERNAMEandPYPI_PASSWORDsecrets.Push the release commit and tag.
Create a GitHub Release or run the
Publish Python Packageworkflow manually.Workflow
.github/workflows/pypi_deploy.ymlbuildsdist/*and uploads to PyPI.
Local Build Check
.venv/bin/python -m pip install --upgrade pip build twine
.venv/bin/python -m build
.venv/bin/python -m twine check dist/*
Release Discipline
Version type |
When to use |
|---|---|
Patch |
Additive compatible features, fixes, docs and tests. |
Minor |
New simulator capability or schema/API change. |
Major |
Broad breaking changes. |
Before publishing, make sure docs/releases.md states:
Field |
Purpose |
|---|---|
Summary |
What changed and why. |
Release owner |
GitHub tag of the person responsible for the release. |
Dataset/schema impact |
Migration risk for existing datasets and configs. |
Compatibility |
Whether algorithms/wrappers need changes. |
Validation |
Commands or simulations that passed. |
Migration notes |
User-facing actions required after upgrade. |
Release-note checklist and template
Version policy
Type |
Use when |
Example |
|---|---|---|
Patch |
Compatible fixes and additive features. |
|
Minor |
New major capability or schema/API change. |
|
Major |
Broad breaking changes. |
|
Release checklist
Update
citylearn/__init__.py.Update this file.
Update README when relevant features change.
Update affected reference pages when schema/action/observation/KPI contracts change.
Run validation:
.venv/bin/pytest -q.venv/bin/python scripts/audit/audit_entity_contract.py --strict.venv/bin/python scripts/audit/audit_physics.py
Run at least one representative smoke simulation.
Commit and tag.
Publish package when applicable.
Template
## vX.Y.Z - YYYY-MM-DD
Release owner: [@calofonseca](https://github.com/calofonseca).
### Summary
- ...
### Added
- ...
### Changed
- ...
### Fixed
- ...
### Dataset/Schema Impact
- ...
### Compatibility
- ...
### Validation
- `...`: pass
### Migration Notes
- ...