|
1 | 1 | .DEFAULT_GOAL := help |
2 | 2 | .PHONY: docs |
3 | 3 | SRC_DIRS = ./tutorxqueue |
4 | | -BLACK_OPTS = --exclude templates ${SRC_DIRS} |
5 | 4 |
|
6 | 5 | # Warning: These checks are not necessarily run on every PR. |
7 | | -test: test-lint test-types test-format # Run some static checks. |
| 6 | +test: test-lint test-format test-types test-pythonpackage # Run some static checks. |
8 | 7 |
|
9 | 8 | test-format: ## Run code formatting tests |
10 | | - black --check --diff $(BLACK_OPTS) |
| 9 | + ruff format --check --diff $(SRC_DIRS) |
11 | 10 |
|
12 | 11 | test-lint: ## Run code linting tests |
13 | | - pylint --errors-only --enable=unused-import,unused-argument --ignore=templates --ignore=docs/_ext ${SRC_DIRS} |
| 12 | + ruff check ${SRC_DIRS} |
14 | 13 |
|
15 | 14 | test-types: ## Run type checks. |
16 | 15 | mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS} |
17 | 16 |
|
| 17 | +build-pythonpackage: ## Build the "tutor-xqueue" python package for upload to pypi |
| 18 | + python -m build --sdist |
| 19 | + |
| 20 | +test-pythonpackage: build-pythonpackage ## Test that package can be uploaded to pypi |
| 21 | + twine check dist/tutor_xqueue-$(shell make version).tar.gz |
| 22 | + |
18 | 23 | format: ## Format code automatically |
19 | | - black $(BLACK_OPTS) |
| 24 | + ruff format ${SRC_DIRS} |
20 | 25 |
|
21 | | -isort: ## Sort imports. This target is not mandatory because the output may be incompatible with black formatting. Provided for convenience purposes. |
22 | | - isort --skip=templates ${SRC_DIRS} |
| 26 | +fix-lint: ## Fix lint errors automatically |
| 27 | + ruff check --fix ${SRC_DIRS} |
23 | 28 |
|
24 | 29 | changelog-entry: ## Create a new changelog entry. |
25 | 30 | scriv create |
26 | 31 |
|
27 | 32 | changelog: ## Collect changelog entries in the CHANGELOG.md file. |
28 | 33 | scriv collect |
29 | 34 |
|
| 35 | +version: ## Print the current tutor-xqueue version |
| 36 | + @python -c 'import io, os; about = {}; exec(io.open(os.path.join("tutorxqueue", "__about__.py"), "rt", encoding="utf-8").read(), about); print(about["__version__"])' |
| 37 | + |
30 | 38 | ESCAPE = |
31 | 39 | help: ## Print this help |
32 | 40 | @grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \ |
|
0 commit comments