From 0ac82b4111f89c719f813f90fd5636f5e1346cf1 Mon Sep 17 00:00:00 2001 From: Paolo Lucchino Date: Mon, 25 May 2026 14:49:01 +0200 Subject: [PATCH 1/4] docs: update README to describe Release Please workflow --- README.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ec6d66e..dd12f7f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![pages-build-deployment](https://github.com/WFP-VAM/DataBridgesKnots/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/WFP-VAM/DataBridgesKnots/actions/workflows/pages/pages-build-deployment) -[![Publish to S3 PyPI](https://github.com/WFP-VAM/DataBridgesKnots/actions/workflows/publish-s3.yml/badge.svg)](https://github.com/WFP-VAM/DataBridgesKnots/actions/workflows/publish-s3.yml) +[![Release Please](https://github.com/WFP-VAM/DataBridgesKnots/actions/workflows/release-please.yml/badge.svg)](https://github.com/WFP-VAM/DataBridgesKnots/actions/workflows/release-please.yml) This Python module allows you to get data from the WFP Data Bridges API, including household survey data, market prices, exchange rates, GORP (Global Operational Response Plan) data, and food security data (IPC equivalent). It is a wrapper for the [Data Bridges API Client](https://github.com/WFP-VAM/DataBridgesAPI), providing an easier way to data analysts to get VAM and monitoring data using their language of choice (Python, R and STATA). @@ -206,13 +206,31 @@ $ make codestyle ### Commits -This project uses [Commitizen](https://commitizen-tools.github.io/commitizen/) for conventional commits. To create a properly formatted commit: +This project uses [Conventional Commits](https://www.conventionalcommits.org/). Use [Commitizen](https://commitizen-tools.github.io/commitizen/) for an interactive prompt: ```commandline $ uv run cz commit ``` -This interactive tool guides you through creating commits that follow the [Conventional Commits](https://www.conventionalcommits.org/) specification. +Commit prefixes directly control versioning — choose carefully: + +| Prefix | Example | Version bump | +|---|---|---| +| `fix:` | `fix: handle missing country code` | patch (`x.y.Z`) | +| `feat:` | `feat: add get_rpme_data endpoint` | minor (`x.Y.z`) | +| `feat!:` / `BREAKING CHANGE:` | `feat!: rename auth params` | major (`X.y.z`) | +| `chore:`, `docs:`, `ci:`, `refactor:`, `test:` | `chore: update dependencies` | no release | + +### Release process + +Releases are fully automated via [Release Please](https://github.com/googleapis/release-please-action): + +1. Conventional commits land on `main` through normal PRs +2. Release Please automatically opens a **release PR** that bumps the version in `pyproject.toml` and updates `CHANGELOG.md` +3. A maintainer reviews and merges the release PR +4. The package is automatically built and published to the S3 PyPI index + +To **manually trigger a publish** (e.g. to recover a failed release), go to **Actions → Release Please → Run workflow → main** in the GitHub UI. ## Contributing Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes. From 52cf28ece3550d07651c11385a7b0a99d45a2858 Mon Sep 17 00:00:00 2001 From: Paolo Lucchino Date: Mon, 25 May 2026 14:50:48 +0200 Subject: [PATCH 2/4] docs: add conventional commits checklist item to PR template --- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 69fd3fb..b97ce01 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -23,4 +23,5 @@ - [ ] I've updated the code style using `make codestyle`. - [ ] I've written tests for all new methods and classes that I created. -- [ ] I've written the docstring in Google format for all the methods and classes that I used. \ No newline at end of file +- [ ] I've written the docstring in Google format for all the methods and classes that I used. +- [ ] My commits follow the [Conventional Commits](https://www.conventionalcommits.org/) format (`fix:`, `feat:`, `chore:`, etc.). \ No newline at end of file From 41583abfa5b2e9129ae3e0bef9783e984b23877f Mon Sep 17 00:00:00 2001 From: Paolo Lucchino Date: Mon, 25 May 2026 14:53:29 +0200 Subject: [PATCH 3/4] ci: run Python Package GHA on all open PR commits into main --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4d49719..489a116 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,7 +1,7 @@ --- name: Python package on: - push: + pull_request: branches: - main From 7a633f8e18cc427fdae06cd975961d6c20ed9dea Mon Sep 17 00:00:00 2001 From: Paolo Lucchino Date: Mon, 25 May 2026 15:00:44 +0200 Subject: [PATCH 4/4] test: use config_from_env() in fixtures instead of yaml file --- tests/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 6ad7bd8..81d85ff 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,13 +3,13 @@ import pandas as pd import pytest -from data_bridges_knots import DataBridgesShapes +from data_bridges_knots import DataBridgesShapes, config_from_env @pytest.fixture def sample_survey_df(): """Fixture providing a sample survey dataset""" - client = DataBridgesShapes("data_bridges_api_config.yaml") + client = DataBridgesShapes(config_from_env()) df = client.get_household_survey( 4872, "full" ) # FIXME: this should read from a static file @@ -19,7 +19,7 @@ def sample_survey_df(): @pytest.fixture def sample_xlsform_df(): """Fixture providing a sample questionnaire in xlsForm""" - client = DataBridgesShapes("data_bridges_api_config.yaml") + client = DataBridgesShapes(config_from_env()) df = client.get_household_questionnaire( 1883 ) # FIXME: this should read from a static file