Skip to content

test: verify python package distribution build when running make test #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
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
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SRC_DIRS = ./tutorcairn
BLACK_OPTS = --exclude templates ${SRC_DIRS}

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

test-format: ## Run code formatting tests
black --check --diff $(BLACK_OPTS)
Expand All @@ -15,6 +15,12 @@ test-lint: ## Run code linting tests
test-types: ## Run type checks.
mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS}

build-pythonpackage: ## Build the "tutor-cairn" python package for upload to pypi
python -m build --sdist

test-pythonpackage: build-pythonpackage ## Test that package can be uploaded to pypi
twine check dist/tutor_cairn-$(shell make version).tar.gz

format: ## Format code automatically
black $(BLACK_OPTS)

Expand All @@ -27,6 +33,9 @@ changelog-entry: ## Create a new changelog entry.
changelog: ## Collect changelog entries in the CHANGELOG.md file.
scriv collect

version: ## Print the current tutor-cairn version
@python -c 'import io, os; about = {}; exec(io.open(os.path.join("tutorcairn", "__about__.py"), "rt", encoding="utf-8").read(), about); print(about["__version__"])'

ESCAPE = 
help: ## Print this help
@grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Improvement] Test python package distribution build when running make test as well. (by @Danyal-Faheem)