Skip to content
Open
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
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,25 @@ on:
push:
branches:
- master
- auto-update-requirements
pull_request:
branches:
- master
workflow_call:
inputs:
ref:
required: false
type: string
default: ''

jobs:
lint:
name: Coding style and linting checks
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}
- run: |
sudo apt-get install python3-venv make
pip3 install --upgrade pip
Expand All @@ -31,7 +40,9 @@ jobs:
- debian:bookworm

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}
- run: |
sudo apt-get install python3-venv make
pip3 install --upgrade pip
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/update_requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: update requirements

on: workflow_dispatch

jobs:
update:
name: Update requirements
runs-on: ubuntu-24.04
permissions:
contents: write
outputs:
sha: ${{ steps.push.outputs.sha }}
changed: ${{ steps.push.outputs.changed }}
steps:
- uses: actions/checkout@v4
with:
ref: master
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
sudo apt-get install -y make
pip install --upgrade pip
- run: make update-requirements
- name: Commit and push to auto-update-requirements branch
id: push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add requirements.txt requirements-dev.txt
if git diff --cached --quiet; then
echo "No changes to commit"
echo "changed=false" >> "$GITHUB_OUTPUT"
else
make bump-version
git add bldr/VERSION
git commit --message="requirements*.txt: update requirements, bump version"
git push --force origin HEAD:auto-update-requirements
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
fi

ci:
name: CI
needs: update
if: needs.update.outputs.changed == 'true'
uses: ./.github/workflows/ci.yml
with:
ref: ${{ needs.update.outputs.sha }}

merge:
name: Push to master
needs: [update, ci]
if: always() && needs.update.outputs.changed == 'true'
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.update.outputs.sha }}
fetch-depth: 0
- name: Push to master
if: needs.ci.result == 'success'
run: git push origin HEAD:master
- name: Delete auto-update-requirements branch
if: always()
run: git push origin --delete auto-update-requirements
6 changes: 3 additions & 3 deletions bldr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from abc import abstractmethod, ABC
from pathlib import Path
from typing import Any, Dict, IO, List, Optional, Sequence, Tuple
from typing import Any, Dict, IO, Iterable, List, Optional, Sequence, Tuple


class ConfigLoaderError(Exception):
Expand Down Expand Up @@ -78,12 +78,12 @@ def __init__(self, *args: Any, **kwargs: Any):

super().__init__(*args, **kwargs)

def parse_known_args(self, args: Optional[Sequence[str]] = None, namespace=None):
def parse_known_args(self, args: Optional[Iterable[str]] = None, namespace: Any = None) -> Any:
if self.config_loader:
self.set_defaults_from_config(args)
return super().parse_known_args(args, namespace=None)

def set_defaults_from_config(self, args: Optional[Sequence[str]] = None) -> None:
def set_defaults_from_config(self, args: Optional[Iterable[str]] = None) -> None:
# make a copy here as we may adjust the paths attribute below
loader = self.config_loader.copy()

Expand Down
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docker
dockerpty
importlib_resources
charset-normalizer>=3.4.7
Loading