File tree 19 files changed +163
-23
lines changed
mex-{{ cookiecutter.project_name }}
19 files changed +163
-23
lines changed Original file line number Diff line number Diff line change
1
+ name : Linting
2
+
3
+ on :
4
+ push :
5
+ branches : ["main"]
6
+ tags : ["**"]
7
+ pull_request :
8
+ types :
9
+ - opened
10
+ - reopened
11
+ - synchronize
12
+ workflow_dispatch :
13
+
14
+ env :
15
+ PDM_CHECK_UPDATE : False
16
+ PIP_DISABLE_PIP_VERSION_CHECK : on
17
+ PIP_NO_CLEAN : on
18
+ PIP_NO_INPUT : on
19
+ PIP_PREFER_BINARY : on
20
+
21
+ concurrency :
22
+ group : ${{ github.workflow }}-${{ github.ref }}
23
+ cancel-in-progress : true
24
+
25
+ jobs :
26
+ lint :
27
+ runs-on : ubuntu-latest
28
+ timeout-minutes : 10
29
+ steps :
30
+ - name : Checkout repo
31
+ uses : actions/checkout@v4
32
+ with :
33
+ fetch-depth : 1
34
+
35
+ - name : Cache requirements
36
+ uses : actions/cache@v4
37
+ env :
38
+ cache-name : cache-requirements
39
+ with :
40
+ path : ~/.cache/pip
41
+ key : ${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
42
+ restore-keys : |
43
+ ${{ env.cache-name }}-
44
+
45
+ - name : Setup python
46
+ uses : actions/setup-python@v5
47
+ with :
48
+ python-version : 3.11
49
+
50
+ - name : Install requirements
51
+ run : make install
52
+
53
+ - name : Run linters
54
+ run : make linter
Original file line number Diff line number Diff line change 22
22
fetch-depth : 1
23
23
24
24
- name : Run renovatebot
25
- uses : renovatebot/github-action@v41.0.13
25
+ uses : renovatebot/github-action@v41.0.14
26
26
env :
27
27
RENOVATE_GIT_PRIVATE_KEY : ${{ secrets.GPG_SIGNING_KEY }}
28
28
RENOVATE_REPOSITORIES : " robert-koch-institut/mex-template"
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ downloads/
22
22
eggs /
23
23
lib /
24
24
lib64 /
25
+ locked-requirements.txt
25
26
MANIFEST
26
27
parts /
27
28
sdist /
@@ -49,7 +50,7 @@ coverage.xml
49
50
test * .jpeg
50
51
test * .png
51
52
* .cover
52
- * .py ,cover
53
+ * ,cover
53
54
.hypothesis /
54
55
.pytest_cache /
55
56
cover /
@@ -84,7 +85,7 @@ ipython_config.py
84
85
__pypackages__ /
85
86
86
87
# Celery stuff
87
- celerybeat-schedule
88
+ celerybeat-schedule. *
88
89
celerybeat.pid
89
90
90
91
# Environments
@@ -126,10 +127,14 @@ dmypy.json
126
127
assets /external /
127
128
.web
128
129
129
- # Default exports
130
+ # MEx specific
131
+ .aws /
132
+ .invenio.private
130
133
* .ndjson
131
134
data /
132
135
identity.csv
136
+ logs /
137
+ payload
133
138
schema.json
134
139
tmp * /
135
140
work /
Original file line number Diff line number Diff line change
1
+ fail_fast : false
2
+ default_language_version :
3
+ python : python3.11
4
+ repos :
5
+ - repo : https://github.com/pre-commit/pre-commit-hooks
6
+ rev : v5.0.0
7
+ hooks :
8
+ - id : pretty-format-json
9
+ name : json
10
+ args : [--autofix, --indent=4, --no-ensure-ascii]
11
+ exclude : cookiecutter.json
12
+ - id : end-of-file-fixer
13
+ name : eof
14
+ - id : trailing-whitespace
15
+ name : whitespaces
16
+ - id : fix-byte-order-marker
17
+ name : byte-order
Original file line number Diff line number Diff line change @@ -9,14 +9,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
### Added
11
11
12
+ - add pre-commit hooks and linting CI workflow
13
+
12
14
### Changes
13
15
16
+ - update gitignores with ` locked-requirements.txt ` and invenio-specifics
17
+ - update versions in requirements.txt, pyproject.toml and pre-commit
18
+
14
19
### Deprecated
15
20
16
21
### Removed
17
22
18
23
### Fixed
19
24
25
+ - fix project page link on documentation pages
26
+ - use proper git tag for building containers in CI
27
+
20
28
### Security
21
29
22
30
## [ 0.4.0] - 2025-02-18
Original file line number Diff line number Diff line change 1
- .PHONY : all setup
2
- all : setup
3
-
4
- LATEST = $(shell git describe --tags $(shell git rev-list --tags --max-count=1) )
5
- PWD = $(shell pwd)
1
+ .PHONY : all setup hooks install linter
2
+ all : install linter
6
3
7
4
setup :
8
5
# install meta requirements system-wide
9
6
@ echo installing requirements; \
10
7
pip --disable-pip-version-check install --force-reinstall -r requirements.txt; \
8
+
9
+ hooks :
10
+ # install pre-commit hooks when not in CI
11
+ @ if [ -z " $$ CI" ]; then \
12
+ pre-commit install; \
13
+ fi ; \
14
+
15
+ install : setup hooks
16
+ # install packages from lock file in local virtual environment
17
+ @ echo installing package; \
18
+ pdm install; \
19
+
20
+ linter :
21
+ # run the linter hooks from pre-commit on all files
22
+ @ echo linting all files; \
23
+ pre-commit run --all-files; \
Original file line number Diff line number Diff line change 2
2
3
3
Cookiecutter template for MEx python projects.
4
4
5
+ [ ![ cookiecutter] ( https://github.com/robert-koch-institut/mex-template/actions/workflows/cookiecutter.yml/badge.svg )] ( https://github.com/robert-koch-institut/mex-template )
6
+ [ ![ cve-scan ] ( https://github.com/robert-koch-institut/mex-template/actions/workflows/cve-scan.yml/badge.svg )] ( https://github.com/robert-koch-institut/mex-template/actions/workflows/cve-scan.yml )
7
+ [ ![ linting] ( https://github.com/robert-koch-institut/mex-template/actions/workflows/linting.yml/badge.svg )] ( https://github.com/robert-koch-institut/mex-template/actions/workflows/linting.yml )
5
8
[ ![ open-code] ( https://github.com/robert-koch-institut/mex-template/actions/workflows/open-code.yml/badge.svg )] ( https://gitlab.opencode.de/robert-koch-institut/mex/mex-template )
6
9
7
10
## Project
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ coverage.xml
50
50
test * .jpeg
51
51
test * .png
52
52
* .cover
53
- * .py ,cover
53
+ * ,cover
54
54
.hypothesis /
55
55
.pytest_cache /
56
56
cover /
@@ -84,7 +84,7 @@ ipython_config.py
84
84
__pypackages__ /
85
85
86
86
# Celery stuff
87
- celerybeat-schedule
87
+ celerybeat-schedule. *
88
88
celerybeat.pid
89
89
90
90
# Environments
@@ -122,10 +122,14 @@ dmypy.json
122
122
assets /external /
123
123
.web
124
124
125
- # Default exports
125
+ # MEx specific
126
+ .aws /
127
+ .invenio.private
126
128
* .ndjson
127
129
data /
128
130
identity.csv
131
+ logs /
132
+ payload
129
133
schema.json
130
134
tmp * /
131
135
work /
@@ -149,6 +153,7 @@ work/
149
153
Makefile
150
154
mex.bat
151
155
* .lock
156
+ Pipfile
152
157
poetry.toml
153
158
pytest.ini
154
159
requirements.txt
Original file line number Diff line number Diff line change 88
88
uses : actions/checkout@v4
89
89
with :
90
90
fetch-depth : 1
91
+ {% raw %}ref: ${{ needs.release.outputs.tag }}{% endraw %}
91
92
92
93
- name : Cache requirements
93
94
uses : actions/cache@v4
Original file line number Diff line number Diff line change 22
22
fetch-depth : 1
23
23
24
24
- name : Run renovatebot
25
- uses : renovatebot/github-action@v41.0.13
25
+ uses : renovatebot/github-action@v41.0.14
26
26
env :
27
27
RENOVATE_GIT_PRIVATE_KEY : {% raw %}${{ secrets.GPG_SIGNING_KEY }}{% endraw %}
28
28
RENOVATE_REPOSITORIES : " robert-koch-institut/mex-{{ cookiecutter.project_name }}"
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ downloads/
22
22
eggs /
23
23
lib /
24
24
lib64 /
25
+ locked-requirements.txt
25
26
MANIFEST
26
27
parts /
27
28
sdist /
@@ -49,7 +50,7 @@ coverage.xml
49
50
test * .jpeg
50
51
test * .png
51
52
* .cover
52
- * .py ,cover
53
+ * ,cover
53
54
.hypothesis /
54
55
.pytest_cache /
55
56
cover /
@@ -84,7 +85,7 @@ ipython_config.py
84
85
__pypackages__ /
85
86
86
87
# Celery stuff
87
- celerybeat-schedule
88
+ celerybeat-schedule. *
88
89
celerybeat.pid
89
90
90
91
# Environments
@@ -126,10 +127,14 @@ dmypy.json
126
127
assets /external /
127
128
.web
128
129
129
- # Default exports
130
+ # MEx specific
131
+ .aws /
132
+ .invenio.private
130
133
* .ndjson
131
134
data /
132
135
identity.csv
136
+ logs /
137
+ payload
133
138
schema.json
134
139
tmp * /
135
140
work /
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ default_language_version:
3
3
python : python3.11
4
4
repos :
5
5
- repo : https://github.com/astral-sh/ruff-pre-commit
6
- rev : v0.9.6
6
+ rev : v0.9.10
7
7
hooks :
8
8
- id : ruff
9
9
args : [--fix, --exit-non-zero-on-fix]
25
25
- id : fix-byte-order-marker
26
26
name : byte-order
27
27
- repo : https://github.com/pdm-project/pdm
28
- rev : 2.22.3
28
+ rev : 2.22.4
29
29
hooks :
30
30
- id : pdm-lock-check
31
31
name : pdm
Original file line number Diff line number Diff line change 3
3
4
4
{% block footer %}
5
5
< div class ="footer ">
6
- < a href ="https://www.rki.de/DE/Content/Forsch/ MEx/MEx_inhalt .html " rel ="nofollow ">
6
+ < a href ="https://www.rki.de/DE/Aktuelles/Publikationen/Forschungsdaten/ MEx/metadata-exchange-plattform-mex-node .html " rel ="nofollow ">
7
7
MEx Project
8
8
</ a > |
9
9
< a href ="https://www.rki.de/DE/Service/Impressum/impressum_node.html " rel ="nofollow ">
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ dependencies = []
11
11
optional-dependencies.dev = [
12
12
" ipdb>=0.13,<1" ,
13
13
" mypy>=1,<2" ,
14
- " pytest-cov>=5,<6 " ,
14
+ " pytest-cov>=6,<7 " ,
15
15
" pytest-random-order>=1,<2" ,
16
16
" pytest-xdist>=3,<4" ,
17
17
" pytest>=8,<9" ,
Original file line number Diff line number Diff line change 1
1
cruft == 2.16.0
2
2
mex-release == 0.3.0
3
- pdm == 2.22.3
3
+ pdm == 2.22.4
4
4
pre-commit == 4.1.0
Original file line number Diff line number Diff line change 3
3
set target = %1
4
4
5
5
if " %target% " == " install" goto install
6
+ if " %target% " == " test" goto test
6
7
echo invalid argument %target%
7
8
exit /b 1
8
9
@@ -12,3 +13,21 @@ exit /b 1
12
13
echo installing requirements
13
14
pip --disable-pip-version-check install --force-reinstall -r requirements.txt
14
15
if %errorlevel% neq 0 exit /b %errorlevel%
16
+
17
+ @ REM install pre-commit hooks when not in CI
18
+ if " %CI% " == " " (
19
+ pre-commit install
20
+ if %errorlevel% neq 0 exit /b %errorlevel%
21
+ )
22
+
23
+ @ REM install packages from lock file in local virtual environment
24
+ echo installing package
25
+ pdm install
26
+ exit /b %errorlevel%
27
+
28
+
29
+ :test
30
+ @ REM run the linter hooks from pre-commit on all files
31
+ echo linting all files
32
+ pre-commit run --all-files
33
+ exit /b %errorlevel%
Original file line number Diff line number Diff line change @@ -9,4 +9,3 @@ urls = { Repository = "https://github.com/robert-koch-institut/mex-template" }
9
9
requires-python = " >=3.11,<3.13"
10
10
dependencies = []
11
11
optional-dependencies.dev = []
12
-
Original file line number Diff line number Diff line change 1
1
cruft == 2.16.0
2
2
mex-release == 0.3.0
3
- pdm == 2.22.3
3
+ pdm == 2.22.4
4
4
pre-commit == 4.1.0
You can’t perform that action at this time.
0 commit comments