Skip to content

Commit

Permalink
test: ensure template is copied before testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jannismain committed Sep 21, 2023
1 parent 080b584 commit 7148b05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
hooks:
- id: pytest
name: pytest
entry: pytest -n auto -m "not slow"
entry: make test
language: system
pass_filenames: false
files: "^template/"
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ spellcheck-dump: ## save all flagged words to project terms dictionary

.PHONY: test
PYTEST_ARGS?=
test: ## run tests quickly
test: ## run some tests
test: build-clean copy-template
pytest ${PYTEST_ARGS} -m "not slow"
test-all: ## run all tests
test-all: build-clean copy-template
pytest ${PYTEST_ARGS}


.PHONY: build install-build
.PHONY: build install-build copy-template build-clean
PKGNAME=init_python_project
PKGDIR=src/${PKGNAME}
BUILDDIR?=build/dist
Expand All @@ -123,7 +125,7 @@ copy-template:
@cp -r ${TEMPLATE_SRC} ${TEMPLATE_DEST}
@cp copier.yaml ${PKGDIR}/.
build-clean: ## remove build artifacts
rm -rf ${BUILDDIR} ${PKGDIR}/template ${PKGDIR}/copier.yaml
@rm -rf ${BUILDDIR} ${PKGDIR}/template ${PKGDIR}/copier.yaml


.PHONY: help
Expand Down

0 comments on commit 7148b05

Please sign in to comment.