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

Upgrade schemapack to 2.0.0-alpha3 in 'schemapack' branch #67

Merged
merged 12 commits into from
May 14, 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
26 changes: 8 additions & 18 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-bullseye

ENV PYTHONUNBUFFERED 1

Expand All @@ -7,23 +7,13 @@ ARG USER_UID=1000
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

# Copy install script
COPY ./dev_install /bin
# [Option] Install Node.js
ARG INSTALL_NODE="true"
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

# Install secondary Python version
USER vscode
RUN <<EOF
curl -sS https://pyenv.run | /bin/sh
INIT_PYENV='
export PYENV_ROOT="$HOME/.pyenv"
[ -d "$PYENV_ROOT/bin" ] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
'
echo "$INIT_PYENV" >> ~/.profile
echo "$INIT_PYENV" >> ~/.bashrc
. ~/.profile
pyenv install --skip-existing 3.12
pyenv global system 3.12
EOF
# Copy install and launcher script to bin:
COPY ./dev_install /bin
COPY ./dev_launcher /bin

CMD ["sleep", "infinity"]
4 changes: 4 additions & 0 deletions .devcontainer/dev_launcher
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

echo "The dev_launcher for this project is not implemented." >&2
exit 1
3 changes: 1 addition & 2 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 @@ -23,7 +22,7 @@
"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_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: 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/action@v3.0.1
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
34 changes: 8 additions & 26 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,34 @@
name: Tests
name: Run test suite and measure coverage

on: push

jobs:
tests:
name: Tests
name: Run test suite

runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4

- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install tox plugin
id: install-tox-gh-actions
run: |
pip install --disable-pip-version-check "tox-gh-actions>=3.2,<4"
uses: ghga-de/gh-action-common@v6

- name: Run tests with Python ${{ matrix.python-version }}
- name: Run tests
id: pytest
if: ${{ matrix.python-version != '3.12' }}
run: |
export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}"

tox

- name: Run tests with Python ${{ matrix.python-version }} measuring coverage
id: pytest-coverage
if: ${{ matrix.python-version == '3.12' }}
run: |
export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}"

tox -- --cov="${{ steps.common.outputs.PACKAGE_NAME }}" --cov-report=xml
pytest \
--cov="${{ steps.common.outputs.PACKAGE_NAME }}" \
--cov-report=xml \
tests

- name: Upload coverage to coveralls
id: coveralls
if: ${{ matrix.python-version == '3.12' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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]
Expand Down
2 changes: 1 addition & 1 deletion .pyproject_generation/pyproject_custom.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name = "metldata"
version = "1.0.0"
description = "metldata - A framework for handling metadata based on ETL, CQRS, and event sourcing."
dependencies = [
"schemapack<=1.0.0, <2.0.0"
"schemapack == 2.0.0-alpha.3"
]

[project.urls]
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 = "contact@ghga.de" },
]
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
1 change: 0 additions & 1 deletion .template/mandatory_files_ignore.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Optional list of files which are actually mandatory in the template
# but are allowed to be removed in the current repository

.devcontainer/dev_launcher

.github/workflows/cd.yaml
.github/workflows/dev_cd.yaml
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
3 changes: 0 additions & 3 deletions .template/static_files_ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
.github/workflows/check_openapi_spec.yaml
.github/workflows/check_readme.yaml
.github/workflows/cd.yaml
.github/workflows/tests.yaml
.github/workflows/ci_release.yaml
.github/workflows/ci_workflow_dispatch.yaml

Expand All @@ -16,7 +15,5 @@ scripts/update_all.py

example_data/README.md

.devcontainer/Dockerfile
.devcontainer/dev_install
.readme_generation/README.md
.readme_generation/readme_template.md
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