Skip to content

Commit

Permalink
Feature/mx-1347 link cruft template (#61)
Browse files Browse the repository at this point in the history
# Added
- cruft template link

# Changes
- harmonized boilerplate
  • Loading branch information
cutoffthetop authored Jan 17, 2024
1 parent 00e095a commit c456e8d
Show file tree
Hide file tree
Showing 20 changed files with 216 additions and 215 deletions.
14 changes: 14 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"checkout": null,
"commit": "fb8fdbbc28f15d99939d22915b49348150d1d534",
"context": {
"cookiecutter": {
"project_name": "common",
"short_summary": "Common library for MEx python projects.",
"long_summary": "The `mex-common` library is a software development toolkit that is used by multiple components within the MEx project. It contains utilities for building pipelines like a common commandline interface, logging and configuration setup. It also provides common auxiliary connectors that can be used to fetch data from external services and a re-usable implementation of the MEx metadata schema as pydantic models.",
"_template": "https://github.com/robert-koch-institut/mex-template"
}
},
"directory": null,
"template": "https://github.com/robert-koch-institut/mex-template"
}
34 changes: 13 additions & 21 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
# Ticket Number
<!--- Number of the ticket of this PR. -->
# PR Context
<!-- Additional info for the reviewer -->

# Uncovered Acceptance Criteria
<!--- Acceptance criteria that you did not cover and why you did not cover them. -->

# Open Questions
<!--- Questions that you have. -->
# Added
<!-- New features and interfaces -->

# Changes
<!-- Changes in existing functionality -->

## Added
<!--- For new features. -->

## Changes
<!--- For changes in existing functionality. -->

## Deprecated
<!--- For soon-to-be removed features. -->
# Deprecated
<!-- Soon-to-be removed features -->

## Removed
<!--- For now removed features. -->
# Removed
<!-- Definitely removed features -->

## Fixed
<!--- For any bug fixes. -->
# Fixed
<!-- Fixed bugs -->

## Security
<!--- In case of fixed vulnerabilities. -->
# Security
<!-- Fixed vulnerabilities -->
42 changes: 42 additions & 0 deletions .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Cookiecutter

on:
push:
branches: ["main"]
workflow_dispatch:

env:
PIP_NO_OPTION: on
PIP_NO_CLEAN: on
PIP_PREFER_BINARY: on

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Cache requirements
uses: actions/cache@v3
env:
cache-name: cache-requirements
with:
path: ~/.cache/pip
key: ${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ env.cache-name }}-
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install requirements
run: make setup

- name: Check template
run: cruft check
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
cache-name: cache-poetry
with:
path: ~/.cache/pip
key: ${{ env.cache-name }}-${{ hashFiles('**/poetry.lock') }}
key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ env.cache-name }}-
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ jobs:
restore-keys: |
${{ env.cache-name }}-
- name: Cache poetry
uses: actions/cache@v3
env:
cache-name: cache-poetry
with:
path: ~/.cache/pip
key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ env.cache-name }}-
- name: Setup python
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cache-name: cache-poetry
with:
path: ~/.cache/pip
key: ${{ env.cache-name }}-${{ hashFiles('**/poetry.lock') }}
key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ env.cache-name }}-
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ MANIFEST
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
# Testing / coverage reports
htmlcov/
.tox/
.nox/
Expand All @@ -54,7 +54,7 @@ pytestdebug.log
*.mo
*.pot

# Scrapy stuff:
# Scrapy stuff
.scrapy

# Sphinx documentation
Expand All @@ -75,7 +75,7 @@ ipython_config.py
# pyenv
.python-version

# PEP 582; used by e.g. pyflow
# PEP 582
__pypackages__/

# Celery stuff
Expand Down
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.1.13
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -17,6 +17,7 @@ repos:
- id: pretty-format-json
name: json
args: [--autofix]
exclude: .cruft.json
- id: check-yaml
name: yaml
- repo: https://github.com/python-poetry/poetry
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- cruft template link

### Changes

- harmonized boilerplate

### Deprecated

### Removed
Expand Down Expand Up @@ -43,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- tests for `mex.common.types.PathWrapper`
- method `is_relative` to `mex.common.types.PathWrapper` to check whether the path is
- method `is_relative` to `mex.common.types.PathWrapper` to check whether the path is
relative

### Changes
Expand All @@ -52,7 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- nesting of `mex.common.types.PathWrapper` on instantiation
- nesting of `mex.common.types.PathWrapper` on instantiation

## [0.18.0] - 2023-12-20

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Robert Koch-Institut
Copyright (c) 2024 Robert Koch-Institut

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all test setup hooks install pytest linter build docs
.PHONY: all test setup hooks install linter pytest wheel docs
all: install test
test: linter pytest

Expand Down Expand Up @@ -28,7 +28,7 @@ pytest:
@ echo running unit tests; \
poetry run pytest -m "not integration"; \

build:
wheel:
# build the python package
@ echo building wheel; \
poetry build --no-interaction --format wheel; \
Expand All @@ -37,4 +37,4 @@ docs:
# use sphinx to auto-generate html docs from code
@ echo generating api docs; \
poetry run sphinx-apidoc -f -o docs/source mex; \
poetry run sphinx-build -b dirhtml docs docs/dist; \
poetry run sphinx-build -aE -b dirhtml docs docs/dist; \
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Via MEx, metadata will be made findable, accessible and shareable, as well as av
for further research. The goal is to get an overview of what research data is available,
understand its context, and know what needs to be considered for subsequent use.

RKI cooperated with D4L data4life gGmbH for a pilot phase where the vision of a
FAIR metadata catalog was explored and concepts and prototypes were developed.
The partnership has ended with the successful conclusion of the pilot phase.

After an internal launch, the metadata will also be made publicly available and thus be
available to external researchers as well as the interested (professional) public to
find research data from the RKI.
Expand All @@ -33,15 +37,15 @@ data Findable, Accessible, Interoperable and Reusable.
## package

The `mex-common` library is a software development toolkit that is used by multiple
components within the MEx project. It contains utilities for building pipelines
like a common commandline interface, logging and configuration setup. It also provides
common auxiliary connectors that can be used to fetch data from external services and
a re-usable implementation of the MEx metadata schema as pydantic models.
components within the MEx project. It contains utilities for building pipelines like a
common commandline interface, logging and configuration setup. It also provides common
auxiliary connectors that can be used to fetch data from external services and a
re-usable implementation of the MEx metadata schema as pydantic models.

## license

This package is licensed under the [MIT license](/LICENSE). Other components of the
MEx project will be released under the same license in the future.
This package is licensed under the [MIT license](/LICENSE). All other software
components of the MEx project are open-sourced under the same license as well.

## development

Expand All @@ -66,11 +70,20 @@ MEx project will be released under the same license in the future.
- or run manually
- linter checks via `pre-commit run --all-files`
- all tests via `poetry run pytest`
- just unit tests via `poetry run pytest -m "not integration"`

### updating dependencies

- update boilerplate files with `cruft update`
- update global dependencies in `requirements.txt` manually
- update git hooks with `pre-commit autoupdate`
- show outdated dependencies with `poetry show --outdated`
- update dependencies in poetry using `poetry update --lock`
- update github actions manually in `.github\workflows\default.yml`
- update github actions manually in `.github/workflows/*.yml`

### creating release

- update version, eg `poetry version minor`
- commit update `git commit --message "..." pyproject.toml`
- create a tag `git tag ...`
- push `git push --follow-tags`
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Supported Versions

This python package is currently in pre-release state. That means changes can
This software package is currently in pre-release state. That means changes can
occur frequently and only the latest released version will be supported with
security and bug fixes. It is therefore not recommended to use this package in
productive environments.

## Reporting a Vulnerability

If you discover a vulnerability, please contact the author team directly via
[email](pyproject.toml). Pull-requests with proposed solutions are explicitly
[email](mailto:[email protected]). Pull-requests with proposed solutions are explicitly
welcomed as well.
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# sphinx configuration

html_theme = "sphinx_book_theme"
extensions = ["sphinx.ext.napoleon"]
html_theme = "alabaster"
napoleon_google_docstring = True
napoleon_include_init_with_doc = True
napoleon_include_private_with_doc = True
project = "mex-common"
templates_path = ["."]
7 changes: 5 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
mex-common
==========
Documentation
=============

Common library for MEx python projects.

.. toctree::
:maxdepth: 2
:glob:

source/*
18 changes: 18 additions & 0 deletions docs/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends '!layout.html' %}

{% block footer %}
<div class="footer">
<a href="https://www.rki.de/DE/Content/Forsch/MEx/MEx_inhalt.html" rel="nofollow">
MEx Project
</a> |
<a href="https://www.rki.de/DE/Service/Impressum/impressum_node.html" rel="nofollow">
RKI Imprint
</a> |
<a href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" rel="nofollow">
GitHub Privacy
</a> |
<a href="https://docs.github.com/en/site-policy/privacy-policies/github-cookies" rel="nofollow">
GitHub Cookies
</a>
</div>
{% endblock %}
6 changes: 3 additions & 3 deletions mex.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ echo linting all files
pre-commit run --all-files
if %errorlevel% neq 0 exit /b %errorlevel%

@REM run the pytest test suite with all unit tests
@REM run the pytest test suite with unit and integration tests
echo running all tests
poetry run pytest
exit /b %errorlevel%
Expand All @@ -41,7 +41,7 @@ exit /b %errorlevel%
:docs
@REM use sphinx to auto-generate html docs from code
echo generating api docs
poetry run sphinx-apidoc -f -o docs/source mex
poetry run sphinx-apidoc -f -o docs\source mex
if %errorlevel% neq 0 exit /b %errorlevel%
poetry run sphinx-build -b dirhtml docs docs/dist
poetry run sphinx-build -aE -b dirhtml docs docs\dist
exit /b %errorlevel%
Loading

0 comments on commit c456e8d

Please sign in to comment.