Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 2 additions & 3 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v7
with:
version: "0.10.4"
python-version: "3.9"
- name: Push tag for each updated package
env:
Expand All @@ -27,6 +27,5 @@ jobs:
git config --global user.name "SDK Releaser Bot"
git config --global user.email "noreply@stackit.de"

pip install poetry
scripts/cd.sh

14 changes: 6 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/checkout@v4
- name: install uv and python
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
version: "0.10.4"
python-version: ${{ matrix.python-version }}
- name: Install
run: |
pip install poetry
poetry config virtualenvs.create false
make install-dev
run: make install-dev
- name: Lint
run: make lint-services
- name: Test
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/dependency-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,26 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
- name: install uv and python
uses: astral-sh/setup-uv@v7
with:
version: "0.10.4"
python-version: "3.9"
- name: Poetry Python dependeny updater
- name: UV Python dependency updater
env:
GH_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
run: |
git config --global user.name "SDK Updater Bot"
git config --global user.email "noreply@stackit.de"

pip install poetry

pr_name=$(echo "Dependency Updates")

make update-dependencies
branch_name="dependency-updater-${{ github.run_id }}"
git checkout -b "$branch_name"

if [ -n "$(git diff --name-only)" ]; then
for file in $(git diff --name-only | grep poetry.lock); do
for file in $(git diff --name-only | grep uv.lock); do
# Extract the service for which the dependencies have been updated
dirpath=$(dirname $file)
git add "$file"
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@ SERVICES_DIR := services

install:
# install core
pip install core/
uv sync --no-dev --directory core/
# install services
@for f in $(shell ls ${SERVICES_DIR}); do pip install ${SERVICES_DIR}/$${f}; done
@for f in $(shell ls ${SERVICES_DIR}); do uv sync --no-dev --directory ${SERVICES_DIR}/$${f}; done

install-dev:
# install services
@for f in $(shell ls ${SERVICES_DIR}); do set -e;poetry install -C ${SERVICES_DIR}/$${f} --no-root;pip install -e ${SERVICES_DIR}/$${f}; done
@for f in $(shell ls ${SERVICES_DIR}); do set -e;uv sync --directory ${SERVICES_DIR}/$${f}; done
# install core. This needs to be done last or it will get overriden by the dependency installation of the services
poetry install -C core --no-root; pip install -e core
uv sync --directory core

test-services:
# test core
cd core && poetry install --with dev && pytest
cd core && uv run pytest
# test services
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f}; poetry install --with dev;sh -c 'pytest || ([ $$? = 5 ] && exit 0 || exit $$?)'; cd ../..; done
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f}; sh -c ' uv run pytest || ([ $$? = 5 ] && exit 0 || exit $$?)'; cd ../..; done

lint-services:
# lint core
cd core && poetry install --no-root --only dev &&flake8 .
cd core && uv run flake8 .
# lint examples. Use configuration from core
flake8 --toml-config core/pyproject.toml --black-config core/pyproject.toml examples;
cd core && uv run flake8 --toml-config pyproject.toml --black-config pyproject.toml ../examples;
# lint services
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f};poetry install --no-root --only dev; flake8 .; cd ../..; done
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f};uv run flake8 .; cd ../..; done
# lint versions
@./scripts/lint-versions.sh

test:
echo "Testing service ${service}"
cd ${SERVICES_DIR}/${service}; poetry install --with dev;sh -c 'pytest || ([ $$? = 5 ] && exit 0 || exit $$?)'; cd ../..;
cd ${SERVICES_DIR}/${service}; sh -c ' uv run pytest || ([ $$? = 5 ] && exit 0 || exit $$?)'; cd ../..;

lint:
echo "Linting service ${service}"
cd ${SERVICES_DIR}/${service};poetry install --no-root --only dev; flake8 .; cd ../..;
cd ${SERVICES_DIR}/${service};uv run flake8 .; cd ../..;

update-dependencies:
# lock core
cd core && poetry lock
cd core && uv lock
# lock services
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f};poetry lock; cd ../..; done
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f};uv lock; cd ../..; done
Loading