Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template and dependencies are updated #97

Merged
merged 4 commits into from
Jun 10, 2024
Merged
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 2 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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": {}
}
}
}
2 changes: 1 addition & 1 deletion .devcontainer/license_header.txt
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/check_config_docs.yaml
Original file line number Diff line number Diff line change
@@ -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 }}"

Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/check_pyproject.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 12 additions & 5 deletions .github/workflows/check_readme.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 13 additions & 4 deletions .github/workflows/check_template_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci_workflow_dispatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/pypi_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ jobs:
pypi-publish:
name: Publish tagged release on PyPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: '3.12'

- name: Ensure package version and tag are equal
- name: Ensure package version and tag name are equal
run: |

PKG_VER="$(grep -oP '^version = "\K[^"]+' pyproject.toml)"
TAG_VER="${GITHUB_REF##*/}"

echo "Package version is $PKG_VER" >&2
echo "Tag version is $TAG_VER" >&2
if [ "$PKG_VER" != "$TAG_VER" ]; then
Expand All @@ -45,10 +44,10 @@ jobs:
--outdir dist/
.

- name: Install the newly built package with all extras
- name: Install the newly build package with all extras
run: |
TAR_PATH="$( realpath ./dist/*.tar.gz)"
python -m \
python3 -m \
pip install \
"${TAR_PATH}[all]"

Expand All @@ -58,9 +57,8 @@ jobs:
pip install
--no-deps -r ./lock/requirements-dev.txt

- name: Run pytest on freshly installed package
- name: Run pytest on freshly install package
run: |
export GHGA_CONNECTOR_CONFIG_YAML=./.devcontainer/.dev_config.yaml
pytest .

- name: Publish distribution package to PyPI (test)
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/static_code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
- name: Run pre-commit
uses: pre-commit/[email protected]
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
21 changes: 13 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -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 }}"

Expand All @@ -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: |
Expand Down
14 changes: 3 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -48,18 +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
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
rev: v0.4.8
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]
2 changes: 1 addition & 1 deletion .pyproject_generation/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
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");
Expand Down
6 changes: 3 additions & 3 deletions .pyproject_generation/pyproject_custom.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
name = "ghga_connector"
version = "1.2.1"
version = "1.3.0"
description = "GHGA Connector - A CLI client application for interacting with the GHGA system."
dependencies = [
"typer~=0.9.0",
"typer~=0.12",
"crypt4gh>=1.6, <2",
"ghga-service-commons[api, crypt]>=3.1.1, <4",
"hexkit[s3]>=2.1.1, <3",
"hexkit[s3]>=3, <4",
"rich>=13.7.1, <14"
]

Expand Down
Loading