diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c0fa1a9..8ee69e56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,9 @@ jobs: - uses: actions/checkout@v4 - uses: softprops/action-gh-release@v2 with: + body: | + Revised release notes are available in the [documentation](https://powerplantmatching.readthedocs.io/en/latest/release-notes.html). + append_body: true generate_release_notes: true publish: @@ -44,40 +47,35 @@ jobs: update-dataset: name: Update powerplants.csv in repository + needs: [build] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - ref: master - - - name: Fetch all history for all tags and branches (necessary for setuptools_scm) - run: git fetch --prune --unshallow + fetch-depth: 0 # Needed for setuptools_scm - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.12 - name: Install package run: | - python -m pip install --upgrade pip - pip install .[dev] - + python -m pip install uv + uv pip install --system "$(ls dist/*.whl)[dev]" + - name: Create dataset run: | import powerplantmatching as pm df = pm.powerplants(update=True) df.to_csv("powerplants.csv", index_label="id") shell: python - - - name: Commit and push changes - run: | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git checkout master - git pull origin master - git add powerplants.csv - git commit -m '[github-actions.ci] auto update `powerplants.csv`' || exit 0 - git push origin master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + commit-message: '[github-actions.ci] auto update `powerplants.csv`' + title: 'Update `powerplants.csv`' + body: 'This PR updates the `powerplants.csv` dataset after a new release.' + branch: 'auto-update-powerplants-csv' + base: 'master' diff --git a/pyproject.toml b/pyproject.toml index 4074de50..9e27ed82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,13 @@ version_scheme = "post-release" [tool.setuptools.packages.find] include = ["powerplantmatching"] +# Pytest settings + +[tool.pytest.ini_options] +filterwarnings = [ + "error::FutureWarning", # Raise all FutureWarnings as errors +] + # Formatter and linter settings [tool.ruff] @@ -85,9 +92,3 @@ select = [ 'NPY', # numpy ] -# Pytest settings - -[tool.pytest.ini_options] -filterwarnings = [ - "error::FutureWarning", # Raise all FutureWarnings as errors -]