From 21bb3e950710f4b060596272f9ab5cc029fa1f20 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Mon, 22 Sep 2025 16:46:19 +0200 Subject: [PATCH 1/2] dev tools improvements --- Makefile | 8 ++++---- poetry.lock | 18 +++++++++++++++++- pyproject.toml | 8 ++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0aecfa2d..077bc3e9 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ test: install-test $(POETRY) run pytest -k "not kms" test-coverage: install-test - $(POETRY) run pytest -k "not kms" --cov=gardenlinux --cov-report=xml tests/ + $(POETRY) run pytest -k "not kms" --cov=gardenlinux --cov-report=html tests/ test-coverage-ci: install-test $(POETRY) run pytest -k "not kms" --cov=gardenlinux --cov-report=xml --cov-fail-under=85 tests/ @@ -62,13 +62,13 @@ format: install-dev $(POETRY) run black --extend-exclude test-data/gardenlinux . lint: install-dev - $(POETRY) run black --check --extend-exclude test-data/gardenlinux . + $(POETRY) run black --diff --extend-exclude test-data/gardenlinux . security: install-dev @if [ "$(CI)" = "true" ]; then \ - $(POETRY) run bandit -ll -ii -r . -f json -o bandit-report.json ; \ + $(POETRY) run bandit -c pyproject.toml -ll -ii -r . -f json -o bandit-report.json ; \ else \ - $(POETRY) run bandit -r . ; \ + $(POETRY) run bandit -c pyproject.toml -r . ; \ fi docs: install-docs diff --git a/poetry.lock b/poetry.lock index ea1a24b3..57e9d68f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -624,6 +624,22 @@ files = [ {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, ] +[[package]] +name = "isort" +version = "6.0.1" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.9.0" +groups = ["dev"] +files = [ + {file = "isort-6.0.1-py3-none-any.whl", hash = "sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615"}, + {file = "isort-6.0.1.tar.gz", hash = "sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450"}, +] + +[package.extras] +colors = ["colorama"] +plugins = ["setuptools"] + [[package]] name = "jinja2" version = "3.1.6" @@ -1704,4 +1720,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = "^3.13" -content-hash = "8a14928c4c3dabdc94084f93ecd25d2f21e7ff578e562d5777a86741372a173a" +content-hash = "81373c2f607f6122a12ed354f79e307af5a9ca97bcecb916e0aad9397ee3d00d" diff --git a/pyproject.toml b/pyproject.toml index 3d5d984a..a4b20ab1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ moto = "^5.1.10" python-dotenv = "^1.1.1" pytest = "^8.4.1" pytest-cov = "^6.2.1" +isort = "^6.0.1" [tool.poetry.group.docs.dependencies] sphinx-rtd-theme = "^3.0.2" @@ -42,6 +43,13 @@ gl-s3 = "gardenlinux.s3.__main__:main" pythonpath = ["src"] norecursedirs = "test-data" +[tool.bandit] +skips = ["B101", "B404"] # allow asserts, subprocesses +exclude_dirs = ["tests"] + +[tool.isort] +known_first_party = "gardenlinux" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" From f2e30f5d14ae867af873b97038bfb7b3a7f496c3 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Mon, 22 Sep 2025 16:51:34 +0200 Subject: [PATCH 2/2] fixed poetry lock --- poetry.lock | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/poetry.lock b/poetry.lock index 689f77f2..d3c67034 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1057,23 +1057,23 @@ dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests [[package]] name = "pytest-cov" -version = "7.0.0" +version = "6.3.0" description = "Pytest plugin for measuring coverage." optional = false python-versions = ">=3.9" groups = ["dev"] files = [ - {file = "pytest_cov-7.0.0-py3-none-any.whl", hash = "sha256:3b8e9558b16cc1479da72058bdecf8073661c7f57f7d3c5f22a1c23507f2d861"}, - {file = "pytest_cov-7.0.0.tar.gz", hash = "sha256:33c97eda2e049a0c5298e91f519302a1334c26ac65c1a483d6206fd458361af1"}, + {file = "pytest_cov-6.3.0-py3-none-any.whl", hash = "sha256:440db28156d2468cafc0415b4f8e50856a0d11faefa38f30906048fe490f1749"}, + {file = "pytest_cov-6.3.0.tar.gz", hash = "sha256:35c580e7800f87ce892e687461166e1ac2bcb8fb9e13aea79032518d6e503ff2"}, ] [package.dependencies] -coverage = {version = ">=7.10.6", extras = ["toml"]} +coverage = {version = ">=7.5", extras = ["toml"]} pluggy = ">=1.2" -pytest = ">=7" +pytest = ">=6.2.5" [package.extras] -testing = ["process-tests", "pytest-xdist", "virtualenv"] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] [[package]] name = "python-dateutil" @@ -1702,5 +1702,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = "^3.13" -content-hash = "81373c2f607f6122a12ed354f79e307af5a9ca97bcecb916e0aad9397ee3d00d" - +content-hash = "7427654efae79db97f84e8ddc18b0568ee48c4d0d30293e69ef3430318c9c6c2"