diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a3be4194..7eb17e2d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/vscode/devcontainers/python:3.9-bullseye +FROM mcr.microsoft.com/devcontainers/python:1-3.12-bookworm ENV PYTHONUNBUFFERED 1 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c49da2b5..b9b990e5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,5 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/python-3-postgres -// Update the VARIANT arg in docker-compose.yml to pick a Python version: 3, 3.8, 3.7, 3.6 { "name": "${localWorkspaceFolderBasename}", "dockerComposeFile": "docker-compose.yml", @@ -20,13 +19,10 @@ "python.languageServer": "Pylance", "python.analysis.typeCheckingMode": "basic", "python.testing.pytestPath": "/usr/local/py-utils/bin/pytest", - "python.testing.pytestArgs": [ - "--profile" - ], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, "editor.formatOnSave": true, "editor.renderWhitespace": "all", @@ -75,4 +71,4 @@ // details can be found here: https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} } -} +} \ No newline at end of file diff --git a/.devcontainer/license_header.txt b/.devcontainer/license_header.txt index 5757817f..3e70646f 100644 --- a/.devcontainer/license_header.txt +++ b/.devcontainer/license_header.txt @@ -1,4 +1,4 @@ -Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln +Copyright 2021 - 2024 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln for the German Human Genome-Phenome Archive (GHGA) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/.github/workflows/check_config_docs.yaml b/.github/workflows/check_config_docs.yaml index bb88b574..b2d08c8e 100644 --- a/.github/workflows/check_config_docs.yaml +++ b/.github/workflows/check_config_docs.yaml @@ -1,17 +1,24 @@ -name: Check if the config schema and the example are up to date. +name: Check if the config schema and the example are up to date on: push jobs: static-code-analysis: + name: Check config schema and example + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 + - name: Checkout repository + id: checkout + uses: actions/checkout@v4 - - id: common - uses: ghga-de/gh-action-common@v4 + - name: Common steps + id: common + uses: ghga-de/gh-action-common@v6 - name: Check config docs + id: check-config-docs run: | export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}" diff --git a/.github/workflows/check_pyproject.yaml b/.github/workflows/check_pyproject.yaml index d929c799..0c7abdc6 100644 --- a/.github/workflows/check_pyproject.yaml +++ b/.github/workflows/check_pyproject.yaml @@ -1,16 +1,23 @@ -name: Check if the config schema and the example are up to date. +name: Check if pyproject.toml file is up to date on: push jobs: static-code-analysis: + name: Check pyproject file + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 + - name: Checkout repository + id: checkout + uses: actions/checkout@v4 - - id: common - uses: ghga-de/gh-action-common@v4 + - name: Common steps + id: common + uses: ghga-de/gh-action-common@v6 - name: Check pyproject.toml + id: check-pyproject run: | ./scripts/update_pyproject.py --check diff --git a/.github/workflows/check_readme.yaml b/.github/workflows/check_readme.yaml index 7414554d..5d06e3f1 100644 --- a/.github/workflows/check_readme.yaml +++ b/.github/workflows/check_readme.yaml @@ -1,16 +1,23 @@ -name: Check if the readme is up to date. +name: Check if the README file is up to date on: push jobs: static-code-analysis: + name: Check README file + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 + - name: Checkout repository + id: checkout + uses: actions/checkout@v4 - - id: common - uses: ghga-de/gh-action-common@v4 + - name: Common steps + id: common + uses: ghga-de/gh-action-common@v6 - - name: Check readme + - name: Check README + id: check-readme run: | ./scripts/update_readme.py --check diff --git a/.github/workflows/check_template_files.yaml b/.github/workflows/check_template_files.yaml index 9fb5cbf0..e6b7e608 100644 --- a/.github/workflows/check_template_files.yaml +++ b/.github/workflows/check_template_files.yaml @@ -4,14 +4,23 @@ on: push jobs: check-template-files: + name: Check template files + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v4 + - name: Checkout repository + id: checkout + uses: actions/checkout@v4 + + - name: Set up Python 3.12 + id: setup-python + uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: '3.12' + - name: Check template files + id: check-template-files run: | if [ "${{ github.event.repository.name }}" == "microservice-repository-template" ] then diff --git a/.github/workflows/ci_release.yaml b/.github/workflows/ci_release.yaml index d8547b40..4a286247 100644 --- a/.github/workflows/ci_release.yaml +++ b/.github/workflows/ci_release.yaml @@ -6,7 +6,10 @@ on: jobs: push_to_docker_hub: + name: Push to Docker Hub + runs-on: ubuntu-latest + steps: - uses: ghga-de/gh-action-ci@v1 with: diff --git a/.github/workflows/ci_workflow_dispatch.yaml b/.github/workflows/ci_workflow_dispatch.yaml index eab7d5a3..a49be97b 100644 --- a/.github/workflows/ci_workflow_dispatch.yaml +++ b/.github/workflows/ci_workflow_dispatch.yaml @@ -11,6 +11,7 @@ on: jobs: fetch-tag: + name: Fetch Tag runs-on: ubuntu-latest if: github.event_name == 'workflow_dispatch' || ( github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'build') ) || ( github.event.action == 'labeled' && github.event.label.name == 'build' ) steps: @@ -20,6 +21,7 @@ jobs: latest_tag: ${{ steps.fetch-tag.outputs.latest_tag }} push_to_docker_hub: + name: Push to Docker Hub needs: fetch-tag runs-on: ubuntu-latest steps: diff --git a/.github/workflows/static_code_analysis.yaml b/.github/workflows/static_code_analysis.yaml index 86a014df..052dfdcf 100644 --- a/.github/workflows/static_code_analysis.yaml +++ b/.github/workflows/static_code_analysis.yaml @@ -4,24 +4,36 @@ on: push jobs: static-code-analysis: - runs-on: ubuntu-latest name: Static Code Analysis + + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 + - name: Checkout repository + id: checkout + uses: actions/checkout@v4 - - id: common - uses: ghga-de/gh-action-common@v4 + - name: Common steps + id: common + uses: ghga-de/gh-action-common@v6 - - uses: pre-commit/action@v3.0.0 + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 env: SKIP: no-commit-to-branch - - name: ruff + + - name: Run ruff + id: ruff run: | ruff check --output-format=github . ruff format --check . - - name: mypy + + - name: Run mypy + id: mypy run: | mypy . + - name: Check license header and file + id: license-checker run: | - ./scripts/license_checker.py + ./scripts/check_license.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dacc9f50..56a9c199 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,19 +1,24 @@ -name: Tests +name: Run test suite and measure coverage on: push jobs: tests: + name: Run test suite + runs-on: ubuntu-latest - name: Tests steps: - - uses: actions/checkout@v3 + - name: Checkout repository + id: checkout + uses: actions/checkout@v4 - - id: common - uses: ghga-de/gh-action-common@v4 + - name: Common steps + id: common + uses: ghga-de/gh-action-common@v6 - - id: pytest + - name: Run tests + id: pytest run: | export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}" @@ -22,8 +27,8 @@ jobs: --cov-report=xml \ tests - - id: coveralls - name: Upload coverage to coveralls + - name: Upload coverage to coveralls + id: coveralls env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60c83522..63f041ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,7 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -default_language_version: - python: python3.9 - -minimum_pre_commit_version: 3.0.0 +minimum_pre_commit_version: 3.7.0 repos: - repo: local @@ -48,13 +45,13 @@ repos: - id: no-commit-to-branch args: [--branch, dev, --branch, int, --branch, main] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.3 + rev: v0.4.5 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 + rev: v1.10.0 hooks: - id: mypy args: [--no-warn-unused-ignores] diff --git a/.pyproject_generation/README.md b/.pyproject_generation/README.md index 93b988fe..4434a8ff 100644 --- a/.pyproject_generation/README.md +++ b/.pyproject_generation/README.md @@ -1,5 +1,5 @@