forked from peteromallet/desloppify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (57 loc) · 2.12 KB
/
Makefile
File metadata and controls
70 lines (57 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.PHONY: \
ci \
ci-fast \
lint \
typecheck \
arch \
ci-contracts \
integration-roslyn \
tests \
tests-full \
package-smoke \
install-ci-tools \
install-full-tools
PIP := python -m pip
LINT_IMPORTS := $(shell python -c "import pathlib,sys; print(pathlib.Path(sys.executable).with_name('lint-imports'))")
IMPORTLINTER_CONFIG ?= .github/importlinter.ini
PYTEST_XML ?=
PYTEST_XML_FLAG := $(if $(PYTEST_XML),--junitxml=$(PYTEST_XML),)
install-ci-tools:
$(PIP) install --upgrade pip
$(PIP) install -e . pytest mypy ruff import-linter build twine pyyaml
install-full-tools:
$(PIP) install --upgrade pip
$(PIP) install -e ".[full]" pytest ruff
lint: install-ci-tools
ruff check . --select E9,F63,F7,F82
typecheck: install-ci-tools
python -m mypy
arch: install-ci-tools
@if [ ! -f "$(IMPORTLINTER_CONFIG)" ]; then \
echo "Missing $(IMPORTLINTER_CONFIG). Add import contracts before running arch gate."; \
exit 1; \
fi
$(LINT_IMPORTS) --config $(IMPORTLINTER_CONFIG)
ci-contracts: install-ci-tools
pytest -q desloppify/tests/ci/test_ci_contracts.py
pytest -q desloppify/tests/commands/test_lifecycle_transitions.py -k "assessment_then_score_when_no_review_followup"
integration-roslyn: install-ci-tools
pytest -q desloppify/tests/lang/csharp/test_csharp_deps.py -k "roslyn"
tests: install-ci-tools
pytest -q $(PYTEST_XML_FLAG)
tests-full: install-full-tools
pytest -q $(PYTEST_XML_FLAG)
package-smoke: install-ci-tools
rm -rf dist .pkg-smoke
python -m build
twine check dist/*
python -m venv .pkg-smoke
. .pkg-smoke/bin/activate && \
python -m pip install --upgrade pip && \
WHEEL=$$(ls -t dist/desloppify-*.whl | head -n 1) && \
python -m pip install "$$WHEEL[full]" && \
python -c "import importlib.metadata as m,sys; extras=set(m.metadata('desloppify').get_all('Provides-Extra') or []); required={'full','treesitter','python-security','scorecard'}; missing=required-extras; print('missing extras metadata:', sorted(missing)) if missing else None; sys.exit(1 if missing else 0)" && \
desloppify --help > /dev/null
rm -rf .pkg-smoke
ci-fast: lint typecheck arch ci-contracts tests
ci: ci-fast tests-full package-smoke