Skip to content

Update docs with steps to release new version of package to PyPI #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/data-processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ The harmonization process attempts to identify specific "retirement users" from
We try to standardize retirement user information across registries using the following steps:

1. **Data merging**: we combine information from four sources into a single _temporary_ field:

- `retirement_beneficiary`: note specifically designating the entity claiming a credit’s environmental benefits
- `retirement_account`: name on account from which credits were retired
- `retirement_note`: short-form text accompanying credit retirement
Expand Down
9 changes: 9 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ glossary.md
TERMS-OF-DATA-ACCESS.md
```

```{toctree}
---
maxdepth: 1
caption: Developer guides
hidden:
---
releasing.md
```

```{toctree}
---
maxdepth: 2
Expand Down
18 changes: 18 additions & 0 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Releasing a New Version of Offsets-DB-Data

This document outlines the steps to release a new version of the offsets-db-data package to PyPI. It includes updating the version number, building the package, and deploying it using GitHub Actions.

## 1. Create a GitHub Release

Go to the GitHub repository and create a new release. This can be done by navigating to the ["Releases"](https://github.com/carbonplan/offsets-db-data/releases) section and clicking on "Draft a new release." Tag the release with the version number you just updated. We use the [CalVer](https://calver.org/) for versioning, so the tag should look like `vYYYY.MM.DD` (e.g., `v2023.10.01`). Once you have filled in the tag details, click on "Generate release notes" to automatically generate the release notes based on the commits since the last release. Review and edit the notes as necessary, then publish the release.

## 2. Automated Deployment to PyPI

Once the release is published, the GitHub Actions workflow will automatically trigger the deployment to PyPI. The workflow defined in [`.github/workflows/pypi.yaml`](https://github.com/carbonplan/offsets-db-data/blob/main/.github/workflows/pypi.yaml) will handle the following:

- Downloading the built artifacts from the previous steps.
- Publishing the package to PyPI using the [`pypa/gh-action-pypi-publish`](https://github.com/pypa/gh-action-pypi-publish) action.

## 3. Verify the Release on PyPI

After the GitHub Actions workflow completes, verify that the package is available on PyPI by visiting [PyPI](https://pypi.org/project/offsets-db-data/).
2 changes: 1 addition & 1 deletion offsets_db_data/openrefine.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def install(

@app.command()
def run(
args: list[str] = typer.Argument(help='The arguments to pass to orcli.'),
args: list[str] = typer.Argument(..., help='The arguments to pass to orcli.'),
binary_path: str | None = typer.Option(
None, help='The path to the orcli binary.', show_default=True
),
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ requests>=2.31.0
s3fs==2025.2.0
universal_pathlib>=0.1.3
numpy>=2
typer >=0.15.2
typer>=0.15.2
click==8.1.8 # pin until https://github.com/fastapi/typer/discussions/1215 is resolved