Skip to content

Commit

Permalink
Update from template (#67)
Browse files Browse the repository at this point in the history
* Template upgrade

* Fix ruff edges

* Pre commit

* small fix

* Silenced mypy issues

* removed unintended duplicate

* Create explicit topics to test kafka fixture reset

* Use Agnostic* classes to solve mypy error

* Simplify 'all' package extra

* Update pypi_publish.yaml for pyproject.toml

* Add quotes around command for consistency

---------

Co-authored-by: TheByronHimes <TheByronHimes@gmail.com>
  • Loading branch information
mephenor and TheByronHimes authored Oct 2, 2023
1 parent cb585f7 commit df04920
Show file tree
Hide file tree
Showing 79 changed files with 2,572 additions and 1,184 deletions.
6 changes: 6 additions & 0 deletions .deprecated_files
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ scripts/check_mandatory_and_static_files.py
scripts/update_static_files.py

docs

setup.py
setup.cfg

.pylintrc
.flake8
8 changes: 4 additions & 4 deletions .devcontainer/dev_install
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ cd /workspace
# upgrade pip
python -m pip install --upgrade pip

# install with all extras in editable mode
pip install -e .[all]

# install or upgrade dependencies for development and testing
pip install -r requirements-dev.txt
pip install --no-deps -r requirements-dev.txt

# install the package itself in edit mode:
pip install --no-deps -e .

# install pre-commit hooks to git
pre-commit install
21 changes: 0 additions & 21 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pypi_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Verify Package Version vs Tag Version
run: |
PKG_VER="$(python setup.py -V)"
PKG_VER="$(grep -oP 'version = "\K[^"]+' pyproject.toml)"
TAG_VER="${GITHUB_REF##*/}"
echo "Package version is $PKG_VER" >&2
echo "Tag version is $TAG_VER" >&2
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/static_code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,19 @@ jobs:
- uses: actions/checkout@v3

- id: common
uses: ghga-de/gh-action-common@v2
uses: ghga-de/gh-action-common@v3

- uses: pre-commit/action@v3.0.0
env:
SKIP: no-commit-to-branch
- name: ruff
uses: chartboost/ruff-action@v1
- name: black
run: |
black --check .
- name: isort
run: |
isort --check --profile black .
- name: mypy
run: |
mypy .
- name: pylint
run: |
pylint "${{ steps.common.outputs.MAIN_SRC_DIR }}"
- name: flake8
run: |
flake8 --config .flake8
- name: bandit
run: |
bandit -r "${{ steps.common.outputs.MAIN_SRC_DIR }}"
- name: Check license header and file
run: |
./scripts/license_checker.py
2 changes: 1 addition & 1 deletion .github/workflows/unit_and_int_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3

- id: common
uses: ghga-de/gh-action-common@v2
uses: ghga-de/gh-action-common@v3

- name: Run pytest
run: |
Expand Down
1 change: 1 addition & 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
6 changes: 4 additions & 2 deletions .mandatory_files
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ Dockerfile
config_schema.json
example_config.yaml
LICENSE
pyproject.toml
README.md
setup.py
setup.cfg
requirements-dev.in
requirements-dev.txt
requirements.txt

.description.md
.design.md
.pre-commit-config.yaml
43 changes: 20 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ default_language_version:
minimum_pre_commit_version: 3.0.0

repos:
- repo: local
hooks:
- id: update-hook-revs
name: "ensure hooks are up to date"
language: python
additional_dependencies:
- "typer"
fail_fast: true
always_run: true
entry: ./scripts/update_hook_revs.py
files: '\.pre-commit-config.yaml'
args: [--check]
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand Down Expand Up @@ -36,33 +49,17 @@ repos:
- id: debug-statements
- id: debug-statements
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.9.1
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
rev: v1.5.1
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 df04920

Please sign in to comment.