From 76e4cde8c66cbff1da93b003cb5343506968b481 Mon Sep 17 00:00:00 2001 From: Matthias Barde Date: Tue, 14 May 2024 16:59:51 +0200 Subject: [PATCH 1/5] fix Makefile in backend --- backend/.pre-commit-config.yaml | 94 +++++++++++++++++++++++++++++++ backend/Makefile | 2 + backend/src/plone/edu/__init__.py | 1 - 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 backend/.pre-commit-config.yaml diff --git a/backend/.pre-commit-config.yaml b/backend/.pre-commit-config.yaml new file mode 100644 index 0000000..f13d059 --- /dev/null +++ b/backend/.pre-commit-config.yaml @@ -0,0 +1,94 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# See the inline comments on how to expand/tweak this configuration file +ci: + autofix_prs: false + autoupdate_schedule: monthly + +repos: +- repo: https://github.com/asottile/pyupgrade + rev: v3.15.0 + hooks: + - id: pyupgrade + args: [--py38-plus] +- repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort +- repo: https://github.com/psf/black + rev: 23.10.1 + hooks: + - id: black +- repo: https://github.com/collective/zpretty + rev: 3.1.0 + hooks: + - id: zpretty + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# zpretty_extra_lines = """ +# _your own configuration lines_ +# """ +## +- repo: https://github.com/PyCQA/flake8 + rev: 6.1.0 + hooks: + - id: flake8 + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# flake8_extra_lines = """ +# _your own configuration lines_ +# """ +## +- repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + additional_dependencies: + - tomli + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# codespell_extra_lines = """ +# _your own configuration lines_ +# """ +## +- repo: https://github.com/mgedmin/check-manifest + rev: "0.49" + hooks: + - id: check-manifest +- repo: https://github.com/regebro/pyroma + rev: "4.2" + hooks: + - id: pyroma +- repo: https://github.com/mgedmin/check-python-versions + rev: "0.22.0" + hooks: + - id: check-python-versions + args: ['--only', 'setup.py,pyproject.toml'] +- repo: https://github.com/collective/i18ndude + rev: "6.1.0" + hooks: + - id: i18ndude + + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# i18ndude_extra_lines = """ +# _your own configuration lines_ +# """ +## + + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/backend/Makefile b/backend/Makefile index a61b562..4c429ab 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -8,6 +8,8 @@ SHELL:=bash MAKEFLAGS+=--warn-undefined-variables MAKEFLAGS+=--no-builtin-rules +CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + # We like colors # From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects RED=`tput setaf 1` diff --git a/backend/src/plone/edu/__init__.py b/backend/src/plone/edu/__init__.py index 9000961..26a0f20 100644 --- a/backend/src/plone/edu/__init__.py +++ b/backend/src/plone/edu/__init__.py @@ -4,7 +4,6 @@ from plone.app.dexterity.textindexer import utils from zope.i18nmessageid import MessageFactory - import logging From 150ef7fe224e40f4a738d49eae643c0da528fabd Mon Sep 17 00:00:00 2001 From: Adrian Schulz Date: Wed, 15 May 2024 08:27:19 +0200 Subject: [PATCH 2/5] Added flake8-config-file (copied from kitconcept.intranet) --- backend/.flake8 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 backend/.flake8 diff --git a/backend/.flake8 b/backend/.flake8 new file mode 100644 index 0000000..1165a53 --- /dev/null +++ b/backend/.flake8 @@ -0,0 +1,22 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# See the inline comments on how to expand/tweak this configuration file +[flake8] +doctests = 1 +ignore = + # black takes care of line length + E501, + # black takes care of where to break lines + W503, + # black takes care of spaces within slicing (list[:]) + E203, + # black takes care of spaces after commas + E231, + +## +# Add extra configuration options in .meta.toml: +# [flake8] +# extra_lines = """ +# _your own configuration lines_ +# """ +## \ No newline at end of file From 24e451c12bef9b975bce9b042a3bd44722d75cd1 Mon Sep 17 00:00:00 2001 From: Adrian Schulz Date: Wed, 15 May 2024 08:28:56 +0200 Subject: [PATCH 3/5] Added version.txt to backend, so the CI tests don't fail anymore --- backend/version.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 backend/version.txt diff --git a/backend/version.txt b/backend/version.txt new file mode 100644 index 0000000..cb372c0 --- /dev/null +++ b/backend/version.txt @@ -0,0 +1 @@ +6.0.11 \ No newline at end of file From f0618f04557325333fdb75a65966795646084f5f Mon Sep 17 00:00:00 2001 From: Adrian Schulz Date: Wed, 15 May 2024 08:43:10 +0200 Subject: [PATCH 4/5] Fixed run command for tests GA (backend) --- .github/workflows/backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index d188e91..1e811e0 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -100,7 +100,7 @@ jobs: - name: Run tests run: | - pytest --disable-warnings src/plone_edu/tests + pytest --disable-warnings src/plone.edu/tests release: runs-on: ubuntu-latest From 8a2f2bc33f89de815a11364a7f04a247e3ee071a Mon Sep 17 00:00:00 2001 From: Adrian Schulz Date: Wed, 15 May 2024 08:53:20 +0200 Subject: [PATCH 5/5] Run tests from backend dir and not from package (does not have any). --- .github/workflows/backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 1e811e0..360b72f 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -100,7 +100,7 @@ jobs: - name: Run tests run: | - pytest --disable-warnings src/plone.edu/tests + pytest --disable-warnings tests release: runs-on: ubuntu-latest