Skip to content

Commit

Permalink
feature/template maintainance 20240516 (#18)
Browse files Browse the repository at this point in the history
# PR Context
- bundle of template updates from may/june 2024

# Added
- add `.web` folder to ignore files for reflex development
- add commit signing to release pipeline

# Changes
- set fixed versions in toml for renovatebot

# Removed
- drop npm support from renovate pipeline
- remove non-functional branch restriction from release pipeline

# Fixed
- fix wording of release pipeline title

---------

Signed-off-by: Nicolas Drebenstedt <897972+cutoffthetop@users.noreply.github.com>
Co-authored-by: Henning Schiebenhöfer <SchiebenhoeferH@rki.de>
  • Loading branch information
cutoffthetop and rababerladuseladim authored Jun 12, 2024
1 parent cbe768d commit 5bac2fd
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 44 deletions.
16 changes: 9 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,27 @@ __pycache__/
*.so

# Distribution / packaging
.eggs/
.installed.cfg
.pdm-build
.pdm-python
.Python
.web/
*.egg
*.egg-info/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
.pdm-python
lib/
lib64/
MANIFEST
parts/
sdist/
share/python-wheels/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- configure renovatebot for mex-template itself
- pdm release plugin as additional requirement for template packages
- github action for releasing a new version in template packages
- add `.web` folder to ignore files for reflex development
- add commit signing to release pipeline

### Changes

- harmonize git and docker ignore files
- update requirements, actions and sample dependencies
- set fixed versions in toml for renovatebot

### Deprecated

### Removed

- drop npm support from renovate pipeline
- remove non-functional branch restriction from release pipeline

### Fixed

- fix `export-all` pdm script
- fix `export-all` and `install-all` pdm scripts
- fix wording of release pipeline title

### Security

Expand Down
15 changes: 9 additions & 6 deletions mex-{{ cookiecutter.project_name }}/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@ __pycache__/
*.so

# Distribution / packaging
.eggs/
.installed.cfg
.pdm-build
.pdm-python
.Python
.web/
*.egg
*.egg-info/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
MANIFEST
parts/
sdist/
share/python-wheels/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
Expand Down
26 changes: 22 additions & 4 deletions mex-{{ cookiecutter.project_name }}/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Release

run-name: release version {% raw %}${{ inputs.version }} by @${{ github.actor }}{% endraw %}
run-name: bump {% raw %}${{ inputs.version }} version by @${{ github.actor }}{% endraw %}

on:
workflow_dispatch:
branches: ["main"]
inputs:
version:
type: choice
Expand Down Expand Up @@ -55,8 +54,27 @@ jobs:
- name: Install requirements
run: make setup

- name: Configure git
env:
{% raw %}SIGNING_KEY: ${{ secrets.SIGNING_KEY }}{% endraw %}
{% raw %}SIGNING_PUB: ${{ secrets.SIGNING_PUB }}{% endraw %}
run: |
{% raw -%}
eval "$(ssh-agent -s)"
install --directory ~/.ssh --mode 700
base64 -d <<< '${{ secrets.SIGNING_KEY }}' > ~/.ssh/mex
base64 -d <<< '${{ secrets.SIGNING_PUB }}' > ~/.ssh/mex.pub
chmod 600 ~/.ssh/*
ssh-add ~/.ssh/mex
git config --local user.email ${{ vars.MEX_BOT_EMAIL }}
git config --local user.name ${{ vars.MEX_BOT_USER }}
git config --local gpg.format ssh
git config --local user.signingkey ~/.ssh/mex.pub
git config --local commit.gpgsign true
{%- endraw %}
- name: Release new version
env:
{% raw %}GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}{% endraw %}
run: |
git config --global user.name 'RKIMetadataExchange'
git config --global user.email 'mex@rki.de'
pdm release {% raw %}${{ inputs.version }}{% endraw %}
16 changes: 9 additions & 7 deletions mex-{{ cookiecutter.project_name }}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,27 @@ __pycache__/
*.so

# Distribution / packaging
.eggs/
.installed.cfg
.pdm-build
.pdm-python
.Python
.web/
*.egg
*.egg-info/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
.pdm-python
lib/
lib64/
MANIFEST
parts/
sdist/
share/python-wheels/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
Expand Down
6 changes: 3 additions & 3 deletions mex-{{ cookiecutter.project_name }}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -28,7 +28,7 @@ repos:
- id: fix-byte-order-marker
name: byte-order
- repo: https://github.com/pdm-project/pdm
rev: 2.13.2
rev: 2.15.4
hooks:
- id: pdm-lock-check
name: pdm
Expand Down
26 changes: 13 additions & 13 deletions mex-{{ cookiecutter.project_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ urls = { Repository = "https://github.com/robert-koch-institut/mex-{{ cookiecutt
requires-python = "<3.13,>=3.11"
dependencies = []
optional-dependencies.dev = [
"black>=24.4.2",
"ipdb>=0.13.13",
"mypy>=1.10.0",
"black==24.4.2",
"ipdb==0.13.13",
"mypy==1.10.0",
"pytest-cov>=5.0.0",
"pytest-random-order>=1.1.1",
"pytest-xdist>=3.6.1",
"pytest>=8.2.0",
"ruff>=0.4.4",
"sphinx>=7.3.7",
"pytest-random-order==1.1.1",
"pytest-xdist==3.6.1",
"pytest==8.2.2",
"ruff==0.4.8",
"sphinx==7.3.7",
]

[project.scripts]
Expand All @@ -40,10 +40,10 @@ plugins = ["pydantic.mypy"]
distribution = true

[tool.pdm.scripts]
update-all = { cmd = "pdm update --group :all --update-eager --save-minimum" }
lock-all = { cmd = "pdm lock --group :all" }
install-all = { cmd = "pdm install --group :all" }
export-all = { cmd = "pdm export --group :all -f requirements" }
update-all = { cmd = "pdm update --group :all --update-all --save-compatible" }
lock-all = { cmd = "pdm lock --group :all --refresh" }
install-all = { cmd = "pdm install --group :all --no-editable --no-lock" }
export-all = { cmd = "pdm export --group :all --no-hashes -f requirements" }
apidoc = { cmd = "pdm run sphinx-apidoc -f -o docs/source mex" }
sphinx = { cmd = "pdm run sphinx-build -aE -b dirhtml docs docs/dist" }
doc = { composite = ["apidoc", "sphinx"] }
Expand Down Expand Up @@ -126,5 +126,5 @@ known-first-party = ["mex", "tests"]
convention = "google"

[build-system]
requires = ["pdm-backend>=2.3.0"]
requires = ["pdm-backend==2.3.0"]
build-backend = "pdm.backend"
1 change: 0 additions & 1 deletion mex-{{ cookiecutter.project_name }}/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"enabledManagers": [
"github-actions",
"html",
"npm",
"pep621",
"pip_requirements"
],
Expand Down
2 changes: 1 addition & 1 deletion mex-{{ cookiecutter.project_name }}/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cruft==2.15.0
mex-release @ git+https://github.com/robert-koch-institut/mex-release.git
pdm==2.15.3
pdm==2.15.4
pre-commit==3.7.1
wheel==0.43.0
1 change: 0 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"enabledManagers": [
"github-actions",
"html",
"npm",
"pep621",
"pip_requirements"
],
Expand Down

0 comments on commit 5bac2fd

Please sign in to comment.