Skip to content

Commit

Permalink
Update hexkit and other dependencies (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito authored Jul 10, 2024
1 parent ac4acb9 commit 8d91843
Show file tree
Hide file tree
Showing 40 changed files with 1,906 additions and 1,412 deletions.
4 changes: 2 additions & 2 deletions .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 All @@ -8,7 +8,7 @@ ARG USER_GID=$USER_UID
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then groupmod --gid $USER_GID vscode && usermod --uid $USER_UID --gid $USER_GID vscode; fi

# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG INSTALL_NODE="false"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

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.5.1
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.1
hooks:
- id: mypy
args: [--no-warn-unused-ignores]
8 changes: 4 additions & 4 deletions .pyproject_generation/pyproject_custom.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "wps"
version = "2.0.2"
version = "2.0.3"
description = "Work Package Service"
dependencies = [
"ghga-event-schemas~=3.1.0",
"ghga-service-commons[api,auth,crypt]>=3.1.3",
"hexkit[akafka,mongodb]>=3.0.0",
"ghga-event-schemas~=3.3.1",
"ghga-service-commons[api,auth,crypt]>=3.1.5",
"hexkit[akafka,mongodb]>=3.3.0",
"httpx>=0.27",
"typer>=0.12",
]
Expand Down
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
4 changes: 3 additions & 1 deletion .template/static_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@

scripts/script_utils/__init__.py
scripts/script_utils/cli.py
scripts/script_utils/deps.py
scripts/script_utils/lock_deps.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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ We recommend using the provided Docker container.

A pre-build version is available at [docker hub](https://hub.docker.com/repository/docker/ghga/work-package-service):
```bash
docker pull ghga/work-package-service:2.0.2
docker pull ghga/work-package-service:2.0.3
```

Or you can build the container yourself from the [`./Dockerfile`](./Dockerfile):
```bash
# Execute in the repo's root dir:
docker build -t ghga/work-package-service:2.0.2 .
docker build -t ghga/work-package-service:2.0.3 .
```

For production-ready deployment, we recommend using Kubernetes, however,
for simple use cases, you could execute the service using docker
on a single server:
```bash
# The entrypoint is preconfigured:
docker run -p 8080:8080 ghga/work-package-service:2.0.2 --help
docker run -p 8080:8080 ghga/work-package-service:2.0.3 --help
```

If you prefer not to use containers, you may install the service from source:
Expand Down Expand Up @@ -118,6 +118,8 @@ The service requires the following configuration parameters:
```


- **`log_traceback`** *(boolean)*: Whether to include exception tracebacks in log messages. Default: `true`.

- **`datasets_collection`** *(string)*: The name of the database collection for datasets. Default: `"datasets"`.

- **`work_packages_collection`** *(string)*: The name of the database collection for work packages. Default: `"workPackages"`.
Expand Down
6 changes: 6 additions & 0 deletions config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
],
"title": "Log Format"
},
"log_traceback": {
"default": true,
"description": "Whether to include exception tracebacks in log messages.",
"title": "Log Traceback",
"type": "boolean"
},
"datasets_collection": {
"default": "datasets",
"description": "The name of the database collection for datasets",
Expand Down
1 change: 1 addition & 0 deletions example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ kafka_ssl_keyfile: ''
kafka_ssl_password: ''
log_format: null
log_level: INFO
log_traceback: true
openapi_url: /openapi.json
port: 8080
service_instance_id: wps_1
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.7
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.2.13
Loading

0 comments on commit 8d91843

Please sign in to comment.