From 84d024e5f2815957888484e5b970936e869d89c0 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 13 May 2025 12:57:41 -0700 Subject: [PATCH 1/6] Fix argument definition in run command to ensure proper help message display --- offsets_db_data/openrefine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offsets_db_data/openrefine.py b/offsets_db_data/openrefine.py index 237444d..c108e78 100644 --- a/offsets_db_data/openrefine.py +++ b/offsets_db_data/openrefine.py @@ -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 ), From 8ca8e4fee530e4f78b691eed89d490480c1e701f Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 13 May 2025 13:16:37 -0700 Subject: [PATCH 2/6] Add documentation for releasing a new version of offsets-db-data --- docs/index.md | 9 +++++++++ docs/releasing.md | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 docs/releasing.md diff --git a/docs/index.md b/docs/index.md index 26bf5f5..ee37579 100644 --- a/docs/index.md +++ b/docs/index.md @@ -50,6 +50,15 @@ glossary.md TERMS-OF-DATA-ACCESS.md ``` +```{toctree} +--- +maxdepth: 1 +caption: Developer guides +hidden: +--- +releasing.md +``` + ```{toctree} --- maxdepth: 2 diff --git a/docs/releasing.md b/docs/releasing.md new file mode 100644 index 0000000..68ad8cd --- /dev/null +++ b/docs/releasing.md @@ -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've been using [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` will handle the following: + +- Downloading the built artifacts from the previous steps. +- Publishing the package to PyPI using the `pypa/gh-action-pypi-publish` action. + +## 3. Verify the Release on PyPI + +After the GitHub Actions workflow completes, verify that your package is available on PyPI by visiting [PyPI](https://pypi.org/project/offsets-db-data/). From 16ec975eac705657425561b869afa10cafe2c167 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 13 May 2025 13:17:18 -0700 Subject: [PATCH 3/6] Pin typer version to 0.15.2 in requirements.txt for consistency --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 06b815c..0762cbf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,4 +12,4 @@ requests>=2.31.0 s3fs==2025.2.0 universal_pathlib>=0.1.3 numpy>=2 -typer >=0.15.2 +typer==0.15.2 From 8c0cd1cddeb8f89421f3f9a6785da8ac7118d7fa Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 13 May 2025 13:25:54 -0700 Subject: [PATCH 4/6] Update typer version constraint to allow for newer releases --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0762cbf..5851ffd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 From 6a48360fcd6843ecbbde4a9cc21a11d55616ce0a Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Tue, 13 May 2025 13:30:28 -0700 Subject: [PATCH 5/6] Improve documentation clarity in releasing.md --- docs/releasing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/releasing.md b/docs/releasing.md index 68ad8cd..32ddd9e 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -4,15 +4,15 @@ This document outlines the steps to release a new version of the offsets-db-data ## 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've been using [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. +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` will handle the following: +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` action. +- 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 your package is available on PyPI by visiting [PyPI](https://pypi.org/project/offsets-db-data/). +After the GitHub Actions workflow completes, verify that the package is available on PyPI by visiting [PyPI](https://pypi.org/project/offsets-db-data/). From f63146477f9ab0357bae96b83dbb517085b5a0c9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 14:08:46 +0000 Subject: [PATCH 6/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/data-processing.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/data-processing.md b/docs/data-processing.md index 78e65b4..8983234 100644 --- a/docs/data-processing.md +++ b/docs/data-processing.md @@ -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