Skip to content

Commit 34acfb4

Browse files
author
Abdul Rehman
committed
test: verify python package distribution build when running make test
1 parent 1fc395f commit 34acfb4

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
SRC_DIRS = ./tutorxqueue
44

55
# Warning: These checks are not necessarily run on every PR.
6-
test: test-lint test-format test-types # Run some static checks.
6+
test: test-lint test-format test-types test-pythonpackage # Run some static checks.
77

88
test-format: ## Run code formatting tests
99
ruff format --check --diff $(SRC_DIRS)
@@ -14,6 +14,12 @@ test-lint: ## Run code linting tests
1414
test-types: ## Run type checks.
1515
mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS}
1616

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+
1723
format: ## Format code automatically
1824
ruff format ${SRC_DIRS}
1925

@@ -26,6 +32,9 @@ changelog-entry: ## Create a new changelog entry.
2632
changelog: ## Collect changelog entries in the CHANGELOG.md file.
2733
scriv collect
2834

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+
2938
ESCAPE = 
3039
help: ## Print this help
3140
@grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
- [Improvement] Migrate from pylint and black to ruff. (by @rehmansheikh222)
1+
- [Improvement] Migrate from pylint and black to ruff. (by @rehmansheikh222)
2+
- [Improvement] Test python package distribution build when running make test. (by @rehmansheikh222)

0 commit comments

Comments
 (0)