Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions .pre-commit-config.ruff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.5
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.5
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
args: [ --allow-multiple-documents ]
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: mixed-line-ending
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.18.2'
hooks:
- id: mypy
args: [--strict, --ignore-missing-imports, --check-untyped-defs]
additional_dependencies:
- types-PyYAML
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ help:
@echo " install - Install the package and dependencies"
@echo " install-dev - Install the package and dev dependencies"
@echo " test - Run tests"
@echo " format - Format code with black"
@echo " format - Format code with ruff"
@echo " lint - Run linting checks"
@echo " security - Run security checks with bandit"
@echo " docs - Build the documentation"
Expand Down Expand Up @@ -59,24 +59,19 @@ test-trace: install-test
$(POETRY) run pytest -k "not kms" -vvv --log-cli-level=DEBUG

format: install-dev
$(POETRY) run black --extend-exclude test-data/gardenlinux .
$(POETRY) run -c .pre-commit-config.ruff.yaml --all-files

lint: install-dev
@echo
@echo "------------------------------------------------------------------------------------------------------------------------"
@echo "--// BLACK //-----------------------------------------------------------------------------------------------------------"
@echo "------------------------------------------------------------------------------------------------------------------------"
$(POETRY) run black --diff --extend-exclude test-data/gardenlinux .
@echo
@echo "------------------------------------------------------------------------------------------------------------------------"
@echo "--// ISORT //-----------------------------------------------------------------------------------------------------------"
@echo "------------------------------------------------------------------------------------------------------------------------"
$(POETRY) run isort --check-only .
@echo
@echo "------------------------------------------------------------------------------------------------------------------------"
@echo "--// PYRIGHT //---------------------------------------------------------------------------------------------------------"
@echo "--// PRE-COMMIT //------------------------------------------------------------------------------------------------------"
@echo "------------------------------------------------------------------------------------------------------------------------"
$(POETRY) run pyright
$(POETRY) run pre-commit run --all-files

security: install-dev
@if [ "$(CI)" = "true" ]; then \
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

10 changes: 5 additions & 5 deletions hack/print_feature_extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

search_and_print_directories() {
local pattern="$1"
local base_pattern="${pattern%%.*}"
local base_pattern="${pattern%%.*}"

while IFS= read -r file; do
dir=$(dirname "$file" | sed 's|^\./||')

suffix="${file##*/}"
suffix="${suffix#"$base_pattern"}"
suffix="${suffix#"$base_pattern"}"

echo "('$dir', '$suffix'),"
done < <(find . -type f -name "$pattern" | sort -u)
}
Expand Down
683 changes: 326 additions & 357 deletions poetry.lock

Large diffs are not rendered by default.

28 changes: 7 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ packages = [{ include = "gardenlinux", from = "src" }]
[tool.poetry.dependencies]
python = ">=3.13"
apt-repo = "^0.5"
boto3 = "^1.40.57"
click = "^8.2.1"
cryptography = "^46.0.1"
boto3 = "^1.40.74"
click = "^8.3.1"
cryptography = "^46.0.3"
jsonschema = "^4.25.1"
networkx = "^3.5"
oras = "^0.2.38"
Expand All @@ -23,14 +23,13 @@ gitpython = "^3.1.45"

[tool.poetry.group.dev.dependencies]
bandit = "^1.8.6"
black = "^25.1.0"
moto = "^5.1.12"
python-dotenv = "^1.1.1"
pytest = "^9.0.0"
moto = "^5.1.16"
pre-commit = "^4.4.0"
python-dotenv = "^1.2.1"
pytest = "^8.4.1"
pytest-cov = "^7.0.0"
isort = "^7.0.0"
requests-mock = "^1.12.1"
pyright = "^1.1.403"

[tool.poetry.group.docs.dependencies]
sphinx-rtd-theme = "^3.0.2"
Expand All @@ -53,19 +52,6 @@ line_length = 120
known_first_party = ["gardenlinux"]
skip = ["test-data", ".venv", "**/__pycache", ".pytest-cache", "hack"]

[tool.pyright]
typeCheckingMode = "strict"
venvPath = "."
venv = ".venv"
exclude = [
"test-data",
"docs",
"hack",
".venv",
".pytest-cache",
"**/__pycache",
]

[tool.bandit]
skips = ["B101", "B404"] # allow asserts, subprocesses
exclude_dirs = ["tests"]
Expand Down
27 changes: 0 additions & 27 deletions pyrightconfig.json

This file was deleted.

6 changes: 3 additions & 3 deletions src/gardenlinux/apt/debsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Debsrc:
Apache License, Version 2.0
"""

def __init__(self, deb_source, deb_version):
def __init__(self, deb_source: str, deb_version: str):
"""
Constructor __init__(Debsrc)

Expand All @@ -31,8 +31,8 @@ def __init__(self, deb_source, deb_version):
:since: 0.7.0
"""

self.deb_source: str = deb_source
self.deb_version: str = deb_version
self.deb_source = deb_source
self.deb_version = deb_version

def __repr__(self) -> str:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/gardenlinux/apt/package_repo_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from apt_repo import APTRepository


class GardenLinuxRepo(APTRepository):
class GardenLinuxRepo(APTRepository): # type: ignore[misc]
"""
Class to reflect APT based GardenLinux repositories.

Expand Down
Loading
Loading