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

Update from template #17

Merged
merged 1 commit into from
Apr 30, 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-bullseye

ENV PYTHONUNBUFFERED 1

Expand Down
6 changes: 1 addition & 5 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.12, 3.11, 3.10, 3.9
{
"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
4 changes: 1 addition & 3 deletions .github/workflows/check_config_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ jobs:

- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
with:
python-version: '3.12'
uses: ghga-de/gh-action-common@v6

- name: Check config docs
id: check-config-docs
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/check_openapi_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ jobs:

- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
with:
python-version: '3.12'
uses: ghga-de/gh-action-common@v6

- name: Check openapi.yaml
id: check-openapi-docs
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/check_pyproject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ jobs:

- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
with:
python-version: '3.12'
uses: ghga-de/gh-action-common@v6

- name: Check pyproject.toml
id: check-pyproject
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/check_readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ jobs:

- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
with:
python-version: '3.12'
uses: ghga-de/gh-action-common@v6

- name: Check README
id: check-readme
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static_code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
uses: ghga-de/gh-action-common@v6

- name: Run pre-commit
uses: pre-commit/[email protected]
Expand All @@ -36,4 +36,4 @@ jobs:
- name: Check license header and file
id: license-checker
run: |
./scripts/license_checker.py
./scripts/check_license.py
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
uses: ghga-de/gh-action-common@v6

- name: Run tests
id: pytest
Expand Down
9 changes: 3 additions & 6 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,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.4.1
rev: v0.4.2
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]
15 changes: 7 additions & 8 deletions .pyproject_generation/pyproject_template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ readme = "README.md"
authors = [
{ name = "German Human Genome Phenome Archive (GHGA)", email = "[email protected]" },
]
requires-python = ">=3.9"
requires-python = ">=3.12"
license = { text = "Apache 2.0" }
classifiers = [
"Development Status :: 1 - Planning",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
Expand All @@ -35,7 +33,7 @@ exclude = [
]
line-length = 88
src = ["src", "tests", "examples", "scripts"]
target-version = "py39"
target-version = "py312"

[tool.ruff.lint]
fixable = [
Expand All @@ -60,6 +58,7 @@ ignore = [
"D107", # missing docstring in __init__
"D206", # indent-with-spaces (for formatter)
"D300", # triple-single-quotes (for formatter)
"UP040", # type statement (not yet supported by mypy)
]
select = [
"C90", # McCabe Complexity
Expand Down Expand Up @@ -105,7 +104,7 @@ asyncio_mode = "strict"

[tool.coverage.paths]
source = [
"src",
"/workspace/src",
"**/lib/python*/site-packages",
"src",
"/workspace/src",
"**/lib/python*/site-packages",
]
1 change: 1 addition & 0 deletions .template/deprecated_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.github/workflows/cd.yaml

scripts/check_mandatory_and_static_files.py
scripts/license_checker.py
scripts/update_static_files.py

docs
Expand Down
2 changes: 1 addition & 1 deletion .template/static_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ scripts/script_utils/cli.py

scripts/__init__.py
scripts/update_all.py
scripts/license_checker.py
scripts/check_license.py
scripts/get_package_name.py
scripts/update_config_docs.py
scripts/update_template_files.py
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

## creating building container
FROM python:3.10.9-slim-bullseye AS builder
FROM python:3.12-slim-bookworm AS builder
# update and install dependencies
RUN apt update
RUN apt upgrade -y
Expand All @@ -26,7 +26,7 @@ WORKDIR /service
RUN python -m build

# creating running container
FROM python:3.10.9-slim-bullseye
FROM python:3.12-slim-bookworm
# update and install dependencies
RUN apt update
RUN apt upgrade -y
Expand Down
11 changes: 5 additions & 6 deletions lock/requirements-dev-template.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# common requirements for development and testing of services

pytest>=8.1
pytest-asyncio>=0.23
pytest>=8.2
pytest-asyncio>=0.23.6
pytest-cov>=5
snakeviz>=2.2
logot>=1.3

pre-commit>=3.7

mypy>=1.9
mypy>=1.10
mypy-extensions>=1.0

ruff>=0.3
ruff>=0.4

click>=8.1
typer>=0.12
Expand All @@ -27,7 +27,6 @@ jsonschema2md>=1.1
setuptools>=69.5

# required since switch to pyproject.toml and pip-tools
tomli>=2.0.1
tomli_w>=1.0

uv>=0.1.31
uv>=0.1.39
Loading