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

Bump cookiecutter template to af56c8 #196

Merged
merged 3 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/robert-koch-institut/mex-template",
"commit": "fca460e90134ef8c10f54d491aa80891509b1b6c",
"commit": "af56c8fa17144906e94518391acc9795d5f2dc89",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,7 @@ jobs:
SIGNING_PUB: ${{ secrets.SIGNING_PUB }}
run: |
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
pdm setup-commit-signing

- name: Update template
env:
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,7 @@ jobs:
SIGNING_PUB: ${{ secrets.SIGNING_PUB }}
run: |
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
pdm setup-commit-signing

- name: Release new version
id: release
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
rev: v0.7.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Backend server for the RKI metadata exchange.
[![open-code](https://github.com/robert-koch-institut/mex-backend/actions/workflows/open-code.yml/badge.svg)](https://gitlab.opencode.de/robert-koch-institut/mex/mex-backend)
[![testing](https://github.com/robert-koch-institut/mex-backend/actions/workflows/testing.yml/badge.svg)](https://github.com/robert-koch-institut/mex-backend/actions/workflows/testing.yml)

## project
## Project

The Metadata Exchange (MEx) project is committed to improve the retrieval of RKI
research data and projects. How? By focusing on metadata: instead of providing the
Expand Down Expand Up @@ -39,27 +39,28 @@ data Findable, Accessible, Interoperable and Reusable.
**Contact** \
For more information, please feel free to email us at [[email protected]](mailto:[email protected]).

### Publisher of this document
### Publisher

**Robert Koch-Institut** \
Nordufer 20 \
13353 Berlin \
Germany

## package
## Package

The `mex-backend` package is a multi-purpose backend application with an HTTP-API. It
provides endpoints to ingest data from ETL-pipelines, for a metadata editor application,
and for publishing pipelines to extract standardized data for use in upstream frontend
applications.

## license
## License

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
## Development

### installation
### Installation

- on unix, consider using pyenv https://github.com/pyenv/pyenv
- get pyenv `curl https://pyenv.run | bash`
Expand All @@ -72,32 +73,32 @@ components of the MEx project are open-sourced under the same license as well.
- switch version `pyenv global 3.11`
- run `.\mex.bat install`

### linting and testing
### Linting and testing

- run all linters with `pdm lint`
- run only unit tests with `pdm unit`
- run unit and integration tests with `pdm test`

### updating dependencies
### Updating dependencies

- update boilerplate files with `cruft update`
- update global requirements in `requirements.txt` manually
- update git hooks with `pre-commit autoupdate`
- update package dependencies using `pdm update-all`
- update github actions in `.github/workflows/*.yml` manually

### creating release
### Creating release

- run `pdm release RULE` to release a new version where RULE determines which part of
the version to update and is one of `major`, `minor`, `patch`.

### container workflow
### Container workflow

- build image with `make image`
- run directly using docker `make run`
- start with docker compose `make start`

## commands
## Commands

- run `pdm run {command} --help` to print instructions
- run `pdm run {command} --debug` for interactive debugging
Expand Down
8 changes: 4 additions & 4 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 60 additions & 54 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ license = { file = "LICENSE" }
urls = { Repository = "https://github.com/robert-koch-institut/mex-backend" }
requires-python = ">=3.11,<3.13"
dependencies = [
"fastapi>=0.115.4,<1",
"httpx>=0.27.2,<1",
"jinja2>=3.1.4,<4",
"fastapi>=0.115,<1",
"httpx>=0.27,<1",
"jinja2>=3,<4",
"mex-common @ git+https://github.com/robert-koch-institut/[email protected]",
"neo4j>=5.24.0,<6",
"pydantic>=2.9.1,<3",
"starlette>=0.41.2,<1",
"uvicorn[standard]>=0.30.6,<1",
"neo4j>=5,<6",
"pydantic>=2,<3",
"starlette>=0.41,<1",
"uvicorn[standard]>=0.30,<1",
]
optional-dependencies.dev = [
"black>=24,<25",
"ipdb>=0.13.13,<1",
"mypy>=1.11.2,<2",
"ipdb>=0.13,<1",
"mypy>=1,<2",
"pytest-cov>=6,<7",
"pytest-random-order>=1.1.1,<2",
"pytest>=8.3.3,<9",
"ruff>=0.6.5,<1",
"sphinx>=8.0.2,<9",
"types-pytz>=2024.1.0,<2025",
"pytest-random-order>=1,<2",
"pytest>=8,<9",
"ruff>=0.6,<1",
"sphinx>=8,<9",
"types-pytz>=2024,<2024.2",
]

[project.scripts]
Expand Down Expand Up @@ -90,51 +90,57 @@ docstring-code-format = true

[tool.ruff.lint]
ignore = [
"D100", # Allow missing module docstring for brevity
"D104", # Allow missing package docstring for brevity
"D106", # Allow missing nested class docstring (eg pydantic Config)
"D203", # Disallow blank line before class docstring (inverse of D211)
"D213", # Disallow multi-line docstring starting at second line (inverse of D212)
"D406", # Allow section name ending with newline (google style compat)
"D407", # Allow missing dashed underline after section (google style compat)
"D413", # Allow missing blank line after last section (google style compat)
"N805", # Allow first argument of a method to be non-self (pydantic compat)
"N815", # Allow mixedCase variables in class scope (model compat)
"RUF012", # Allow mutable class attributes (pydantic compat)
]
select = [
"A", # Flake8 builtin shaddow
"B", # BugBear bug and issue finder
"C90", # McCabe complexity checker
"D", # Python docstring style checker
"E", # Python code style errors
"ERA", # Commented-out code detector
"F", # Pyflakes passive python checker
"I", # Isort import utility
"N", # Pep8 naming conventions
"PERF", # Lint performance anti-patterns
"RET", # Flake8 return statement checker
"RUF", # Ruff-specific rules
"S", # Bandit automated security testing
"T10", # Flake8 debug statement checker
"T20", # Flake8 print statement checker
"UP", # PyUpgrade syntax recommender
"W", # Python code style warnings
"AIR", # Disable airflow specific rules (we are not using airflow)
"ANN", # Disable all annotations checks (handled by mypy)
"COM", # Disable flake8-commas checks (let ruff format handle that)
"CPY", # Disable copyright notice checks (we have LICENSE files)
"D100", # Allow missing module docstring (for brevity and speed)
"D104", # Allow missing package docstring (for brevity and speed)
"D203", # Disallow blank line before class docstring (inverse of D211)
"D213", # Disallow multi-line docstring starting at second line (inverse of D212)
"D406", # Allow section name ending with newline (google style compat)
"D407", # Allow missing dashed underline after section (google style compat)
"D413", # Allow missing blank line after last section (google style compat)
"DJ", # Disable django specific checks (we are not using django)
"FBT", # Disable boolean type hint checks (for more flexibility)
"FIX", # Allow committing with open TODOs (don't punish committers)
"ISC001", # Disable checks for implicitly concatenated strings (formatter compat)
"N805", # Allow first argument of a method to be non-self (pydantic compat)
"N815", # Allow mixedCase variables in class scope (model compat)
"PTH123", # Allow using builtin open method (simpler than pathlib)
"RUF012", # Allow mutable class attributes (pydantic compat)
"SIM108", # Allow explicit if-else instead of ternary (easier to read)
"TD003", # Allow TODOs without ticket link (don't punish TODO writers)
"TRY003", # Allow long exception message at the raise site (for pydantic)
]
select = ["ALL"]

[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"D101", # Allow missing docstring in public class for tests
"D102", # Allow missing docstring in public method for tests
"D103", # Allow missing docstring in public function for tests
"D107", # Allow missing docstring in `__init__` for tests
"E501", # Allow line too long in tests
"N807", # Allow mocking `__init__` for tests
"S101", # Allow use of `assert` in tests
"docs/**" = [
"INP001", # Docs folder does not need to be a package
]
"**/main.py" = [
"N803", # Allow dromedaryCase query parameters
"scripts/**" = [
"INP001", # Scripts folder does not need to be a package
]
"tests/**" = [
"ARG005", # Allow unused lambda arguments for mocking
"D101", # Allow missing docstring in public class
"D102", # Allow missing docstring in public method
"D103", # Allow missing docstring in public function
"D107", # Allow missing docstring in `__init__`
"E501", # Allow longer lines with test data
"ISC", # Allow implicitly concatenated strings
"N807", # Allow mocking `__init__`
"PLR0915", # Allow functions with many statements
"PLR2004", # Allow comparing with static values
"PT004", # Allow public fixtures without returns
"PT013", # Allow more flexible pytest imports
"S101", # Allow use of `assert` in tests
"SLF", # Allow private member access
]

[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"reflex" = "rx"

[tool.ruff.lint.isort]
known-first-party = ["mex", "tests"]
Expand Down
Loading