From 0dea5ba7ce2d2e6441bc78baca4686c9afc4b26f Mon Sep 17 00:00:00 2001 From: jniklas03 Date: Tue, 15 Sep 2026 09:00:01 +0200 Subject: [PATCH 1/6] fix: update workflow versions --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/docs.yml | 8 ++++---- .github/workflows/release.yml | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ce1815..f338188 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v9.0.0 with: python-version: "3.13" enable-cache: true @@ -37,9 +37,9 @@ jobs: matrix: python-version: ["3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v9.0.0 with: python-version: ${{ matrix.python-version }} enable-cache: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 505c5bc..d929b55 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,9 +24,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - - uses: astral-sh/setup-uv@v5 + - uses: astral-sh/setup-uv@v9.0.0 with: python-version: "3.13" enable-cache: true @@ -39,7 +39,7 @@ jobs: - name: Upload Pages artifact if: github.ref == 'refs/heads/main' - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: site/ @@ -53,4 +53,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7e644b..d8acbdf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 fetch-tags: true - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v9.0.0 with: python-version: "3.13" - name: Build wheel and sdist From e7d73007389dfd9ffca6c018f29facfe715d4dd2 Mon Sep 17 00:00:00 2001 From: jniklas03 Date: Tue, 15 Sep 2026 09:02:35 +0200 Subject: [PATCH 2/6] fix: make release job names unique --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d8acbdf..695d145 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - "v*" jobs: - build: + build-release: runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -26,8 +26,8 @@ jobs: name: dist path: dist/ - publish: - needs: build + publish-release: + needs: build-release runs-on: ubuntu-latest timeout-minutes: 10 environment: pypi @@ -43,7 +43,7 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 github-release: - needs: publish + needs: publish-release runs-on: ubuntu-latest timeout-minutes: 10 permissions: @@ -58,4 +58,4 @@ jobs: uses: softprops/action-gh-release@v2 with: files: dist/* - generate_release_notes: true + generate_release_notes: true \ No newline at end of file From 7f393a595473c50701a1ffb5d79e68ca62ec1603 Mon Sep 17 00:00:00 2001 From: jniklas03 Date: Tue, 15 Sep 2026 09:03:02 +0200 Subject: [PATCH 3/6] feat: add PR policies for dev and main --- .github/workflows/dev_policy.yml | 24 ++++++++++++++++++++++++ .github/workflows/main_policy.yml | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/dev_policy.yml create mode 100644 .github/workflows/main_policy.yml diff --git a/.github/workflows/dev_policy.yml b/.github/workflows/dev_policy.yml new file mode 100644 index 0000000..1cba4fc --- /dev/null +++ b/.github/workflows/dev_policy.yml @@ -0,0 +1,24 @@ +name: Dev PR policy + +on: + pull_request: + branches: [dev] + +jobs: + require-feature-or-fix-source: + runs-on: ubuntu-latest + steps: + - name: Require source branch to be feature or fix + run: | + if [[ "${{ github.head_ref }}" != feature/* && "${{ github.head_ref }}" != fix/* ]]; then + echo "Pull requests into dev must come from a feature/* or fix/* branch." + echo "Actual source branch: ${{ github.head_ref }}" + exit 1 + fi + +# Assumes following Github ruleset: +# Target branch: dev +# Restrict deletions +# Require a pull request before merging +# Require status checks to pass +# Block force pushes \ No newline at end of file diff --git a/.github/workflows/main_policy.yml b/.github/workflows/main_policy.yml new file mode 100644 index 0000000..5622518 --- /dev/null +++ b/.github/workflows/main_policy.yml @@ -0,0 +1,24 @@ +name: Main PR policy + +on: + pull_request: + branches: [main] + +jobs: + require-dev-source: + runs-on: ubuntu-latest + steps: + - name: Require source branch to be dev + run: | + if [ "${{ github.head_ref }}" != "dev" ]; then + echo "Pull requests into main must come from dev." + echo "Actual source branch: ${{ github.head_ref }}" + exit 1 + fi + +# Assumes following Github ruleset: +# Target branch: main +# Restrict deletions +# Require a pull request before merging +# Require status checks to pass +# Block force pushes \ No newline at end of file From 7e74c24851f6bb5570dac606e2fa7932c1efd230 Mon Sep 17 00:00:00 2001 From: jniklas03 Date: Tue, 15 Sep 2026 09:04:30 +0200 Subject: [PATCH 4/6] feat: change CI to run on pushes to feature and fix branches and PRs to feat, fix, main, dev. Disabled caching on linting due to race condition. --- .github/workflows/ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f338188..fde8e9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,15 @@ name: CI on: push: - branches: [main, dev] + branches: + - "feature/**" + - "fix/**" pull_request: - branches: [main, dev] + branches: + - main + - dev + - "feature/**" + - "fix/**" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -21,6 +27,7 @@ jobs: with: python-version: "3.13" enable-cache: true + save-cache: false - name: Install dependencies run: uv sync --all-groups - name: Lint with ruff @@ -46,4 +53,4 @@ jobs: - name: Install dependencies run: uv sync --all-groups - name: Run tests - run: uv run pytest tests/ + run: uv run pytest tests/ \ No newline at end of file From f0cfea0b2b8c5ae5375cdbd1067f979ea2c17be8 Mon Sep 17 00:00:00 2001 From: jniklas03 Date: Tue, 15 Sep 2026 09:06:31 +0200 Subject: [PATCH 5/6] fix: make docs job names unique, feat: make docs deployment exclusive to PRs to main --- .github/workflows/docs.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d929b55..7fe0f70 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,9 +2,10 @@ name: Docs on: push: - branches: [main] + branches: + - main # only used for deplyoing docs after a PR into main pull_request: - branches: [main] + branches: [dev, main] permissions: contents: read @@ -20,7 +21,7 @@ concurrency: # 2. Source: GitHub Actions (NOT "Deploy from a branch") jobs: - build: + build-docs: runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -38,14 +39,14 @@ jobs: run: uv run mkdocs build --strict - name: Upload Pages artifact - if: github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: actions/upload-pages-artifact@v5 with: path: site/ - deploy: - needs: build - if: github.ref == 'refs/heads/main' + deploy-docs: + needs: build-docs + if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest environment: name: github-pages @@ -53,4 +54,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v5 + uses: actions/deploy-pages@v5 \ No newline at end of file From 7892ccbcf9328f51160b90dc2745713207b17962 Mon Sep 17 00:00:00 2001 From: jniklas03 Date: Tue, 15 Sep 2026 09:21:26 +0200 Subject: [PATCH 6/6] fix: correct indentation in docstring to resolve docs failing --- src/simses/converter/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simses/converter/converter.py b/src/simses/converter/converter.py index 5caa947..8d3ded3 100644 --- a/src/simses/converter/converter.py +++ b/src/simses/converter/converter.py @@ -63,7 +63,7 @@ def __init__(self, loss_model: ConverterLossModel, max_power: float, storage: An storage: Downstream storage exposing ``step(power, dt)`` and ``state.power``. Typically a :class:`Battery`. tolerance: Relative difference between requested and - actual DC power above which AC power is re-calculated + actual DC power above which AC power is re-calculated. """ self.max_power = max_power self.state = ConverterState()