Skip to content

Commit

Permalink
Generating documentation form the metadata schema (#6)
Browse files Browse the repository at this point in the history
* docs from schema

* tables with summary feature

* faq page 404 links fixed

* template update

* disabled template check

---------

Co-authored-by: Karoline Mauer <karoline.mauer@dzne.de>
  • Loading branch information
sbilge and mauerk authored Aug 22, 2024
1 parent d95d211 commit 3da36fb
Show file tree
Hide file tree
Showing 51 changed files with 3,528 additions and 16 deletions.
16 changes: 16 additions & 0 deletions .deprecated_files
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# List of all deprecated files and directories that
# should not exist any more in this repo.
# This list is similar to the `./mandatory_files`,
# however, the entries here will be removed if they
# still exist.

.devcontainer/library-scripts/docker-in-docker-debian.sh
.devcontainer/library-scripts

.github/workflows/check_mandatory_and_static_files.yaml
.github/workflows/dev_cd.yaml

scripts/check_mandatory_and_static_files.py
scripts/update_static_files.py

docs
4 changes: 4 additions & 0 deletions .deprecated_files_ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Optional list of files which are actually deprecated in the template
# but are still allowed to be used in the current repository

docs
3 changes: 3 additions & 0 deletions .devcontainer/.dev_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please only mention the non-default settings here:

language: Greek
19 changes: 19 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bookworm

ENV PYTHONUNBUFFERED 1

# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
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

# [Option] Install Node.js
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

# Copy install and launcher script to bin:
COPY ./dev_install /bin
COPY ./dev_launcher /bin

CMD ["sleep", "infinity"]
11 changes: 11 additions & 0 deletions .devcontainer/dev_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# install service in dev container

cd /workspace

# Install requirements
pip install --upgrade -r requirements.txt

# install pre-commit hooks to git
pip install --upgrade pre-commit
pre-commit install
5 changes: 5 additions & 0 deletions .devcontainer/dev_launcher
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# adapt to package name
cd /workspace
mkdocs serve
28 changes: 28 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3'

services:
app:
build:
context: .
dockerfile: ./Dockerfile
args:
# [Choice] Python version: 3, 3.8, 3.7, 3.6
VARIANT: 3.9
# [Choice] Install Node.js
INSTALL_NODE: "true"
NODE_VERSION: "lts/*"
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
USER_UID: 1000
USER_GID: 1000

init: true
privileged: true

volumes:
- ..:/workspace:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Uncomment the next line to use a non-root user for all processes.
user: vscode
14 changes: 14 additions & 0 deletions .devcontainer/license_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Top-most EditorConfig file.
root = true

# For all files ...
[*]

# Unix-style LF newlines.
end_of_line = lf

# Force a newline at the end of the file.
insert_final_newline = true

# Use UTF-8.
charset = utf-8
21 changes: 21 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; Copyright 2021 - 2023 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");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.

[flake8]
ignore = E, W
# ignore all style checks from pycodestyle
# as they are already checked by black
exclude = .git,__pycache__,build,dist
max-complexity = 10
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# CRLF line endings cause problems in Docker, so we force git
# to check in and out using only LF line endings.

*.cfg text eol=lf
*.ini text eol=lf
*.json text eol=lf
*.md text eol=lf
*.py text eol=lf
*.txt text eol=lf
*.yaml text eol=lf
*.yml text eol=lf

.editorconfig text eol=lf
.flake8 text eol=lf
.pylintrc text eol=lf

.git* text eol=lf
*_files text eol=lf
*_files_ignore text eol=lf

**/dev_* text eol=lf
**/Dockerfile text eol=lf
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
.ruff_cache/
prof/

# Translations
Expand Down Expand Up @@ -132,6 +133,12 @@ dmypy.json
# ignore VS Code settings:
.vscode/

# key stores
*.key
*.rnd
.keystore
.ssl/

# desktop settings and thumbnails
.DS_Store
desktop.ini
Expand Down
28 changes: 28 additions & 0 deletions .mandatory_files
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# List of all mandatory files and directories that
# have to exist in this repo.
# This list is similar to the `./static_files`,
# however, the entries here are just checked for
# existence, their content is not evaluated and
# may differ from that of the template repository.

.devcontainer/dev_launcher
.devcontainer/devcontainer.json
.devcontainer/docker-compose.yml
.devcontainer/Dockerfile

tests/__init__.py
tests/fixtures/__init__.py

scripts/script_utils/fastapi_app_location.py

Dockerfile
config_schema.json
example_config.yaml
LICENSE
README.md
setup.py
setup.cfg
requirements-dev.txt

.description.md
.design.md
19 changes: 19 additions & 0 deletions .mandatory_files_ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Optional list of files which are actually mandatory in the template
# but are allowed to be removed in the current repository


docs/README.md
example_data
tests/__init__.py
tests/fixtures/__init__.py
scripts/script_utils/fastapi_app_location.py
Dockerfile
config_schema.json
example_config.yaml
README.md
setup.py
setup.cfg
requirements-dev.txt

.description.md
.design.md
12 changes: 12 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Global options:

[mypy]
disable_error_code = import
show_error_codes = True
exclude = (?x)(
build/lib/
)
warn_redundant_casts = True
warn_unused_ignores = True
check_untyped_defs = True
no_site_packages = False
67 changes: 67 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: '.*\.json|example_config.yaml'
- id: check-added-large-files
- id: check-ast
- id: check-json
exclude: devcontainer.json
- id: pretty-format-json
args: [--autofix]
exclude: devcontainer.json|config_schema.json
- id: check-merge-conflict
- id: check-symlinks
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-docstring-first
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: mixed-line-ending
args: [--fix=lf]
- id: no-commit-to-branch
args: [--branch, dev, --branch, int, --branch, main]
- id: debug-statements
- id: debug-statements
- id: debug-statements
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: [--profile, black]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.0
hooks:
- id: mypy
args: [--no-warn-unused-ignores]
- repo: https://github.com/PyCQA/pylint
rev: v2.16.4
hooks:
- id: pylint
args: [--disable=E0401]
exclude: tests|.devcontainer
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args: [--config, .flake8]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
exclude: tests|.devcontainer|scripts
Loading

0 comments on commit 3da36fb

Please sign in to comment.