Skip to content
Draft
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
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Setup enviroment
- name: Setup environment
run: uv sync --extra dev
- run: |
sudo apt-get install cpanminus html-xml-utils xmlstarlet
Expand All @@ -36,8 +36,9 @@ jobs:
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Setup environment
run: uv sync --extra dev
- name: Static checks
run: |
git config --global --add safe.directory .
uv sync --extra dev
uv run make checkstyle
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ test-unit: test-bash test-python
test-bash: $(BPAN)
"${PROVE}" -r $(if $v,-v )$(test)

.PHONY: test-python
test-python:
py.test tests

Expand All @@ -58,8 +59,10 @@ test-yaml:
@which yamllint >/dev/null 2>&1 || echo "Command 'yamllint' not found, can not execute YAML syntax checks"
yamllint --strict $$(git ls-files "*.yml" "*.yaml" ":!external/")

.PHONY: checkstyle-python
checkstyle-python: check-ruff check-conventions check-ty
check-ruff:

@which ruff >/dev/null 2>&1 || echo "Command 'ruff' not found, can not execute python style checks"
@if [ -n "$(PY_FILES)" ]; then ruff format --check $(PY_FILES) && ruff check $(PY_FILES); fi

Expand All @@ -85,11 +88,14 @@ test-gitlint: ## Run commit message checks using gitlint
BASE=$$(git merge-base --independent $$BASES | head -n 1); \
gitlint --commits "$$BASE..HEAD"

.PHONY: test-with-coverage
test-with-coverage:
pytest --cov=src/os-autoinst-scripts tests/

.PHONY: tidy
tidy: ## Format code and fix linting issues
ruff format $(PY_FILES)
ruff check --fix $(PY_FILES)

update-deps:
tools/update-deps --cpanfile cpanfile --specfile dist/rpm/os-autoinst-scripts-deps.spec

Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ packages = []

[project.optional-dependencies]
dev = [
"ty",
"pytest",
"pytest-cov",
"pytest-mock",
Expand All @@ -50,6 +51,13 @@ fail_under = 100
show_missing = true
skip_covered = true

[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools.packages]
find = {}

[tool.ruff]
line-length = 120
preview = true
Expand Down Expand Up @@ -159,3 +167,9 @@ unresolved-import = "ignore"

[tool.ty.terminal]
error-on-warning = true

[tool.pyright]
include = ["src", "tests", "*.py"]

[tool.pytest.ini_options]
pythonpath = "src"
Loading