Skip to content

Commit

Permalink
Merge 233711e into b6de231
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Dec 29, 2020
2 parents b6de231 + 233711e commit b068684
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 32 deletions.
45 changes: 18 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# Project settings
PROJECT := Pomace
PACKAGE := pomace
REPOSITORY := jacebrowning/pomace

# Project paths
PACKAGES := $(PACKAGE) tests
CONFIG := $(wildcard *.py)
MODULES := $(wildcard $(PACKAGE)/*.py)

# Virtual environment paths
VIRTUAL_ENV ?= .venv

# MAIN TASKS ##################################################################

.PHONY: all
Expand Down Expand Up @@ -39,6 +29,7 @@ doctor: ## Confirm system dependencies are available

# PROJECT DEPENDENCIES ########################################################

VIRTUAL_ENV ?= .venv
DEPENDENCIES := $(VIRTUAL_ENV)/.poetry-$(shell bin/checksum pyproject.toml poetry.lock)

.PHONY: install
Expand All @@ -62,18 +53,18 @@ endif

.PHONY: format
format: install
poetry run isort $(PACKAGES) notebooks
poetry run black $(PACKAGES) notebooks
poetry run isort $(PACKAGE) tests notebooks
poetry run black $(PACKAGE) tests notebooks
@ echo

.PHONY: check
check: install format ## Run formaters, linters, and static analysis
ifdef CI
git diff --exit-code
endif
poetry run mypy $(PACKAGES) --config-file=.mypy.ini
poetry run pylint $(PACKAGES) --rcfile=.pylint.ini
poetry run pydocstyle $(PACKAGES) $(CONFIG)
poetry run mypy $(PACKAGE) tests --config-file=.mypy.ini
poetry run pylint $(PACKAGE) tests --rcfile=.pylint.ini
poetry run pydocstyle $(PACKAGE) tests

# TESTS #######################################################################

Expand All @@ -94,21 +85,21 @@ test-unit: install
@ ( mv $(FAILURES) $(FAILURES).bak || true ) > /dev/null 2>&1
poetry run pytest $(PACKAGE) $(PYTEST_OPTIONS)
@ ( mv $(FAILURES).bak $(FAILURES) || true ) > /dev/null 2>&1
poetry run coveragespace $(REPOSITORY) unit
poetry run coveragespace set unit

.PHONY: test-int
test-int: install
@ if test -e $(FAILURES); then poetry run pytest tests $(PYTEST_RERUN_OPTIONS); fi
@ rm -rf $(FAILURES)
poetry run pytest tests $(PYTEST_OPTIONS)
poetry run coveragespace $(REPOSITORY) integration
poetry run coveragespace set integration

.PHONY: test-all
test-all: install
@ if test -e $(FAILURES); then poetry run pytest $(PACKAGES) $(PYTEST_RERUN_OPTIONS); fi
@ if test -e $(FAILURES); then poetry run pytest $(PACKAGE) tests $(PYTEST_RERUN_OPTIONS); fi
@ rm -rf $(FAILURES)
poetry run pytest $(PACKAGES) $(PYTEST_OPTIONS)
poetry run coveragespace $(REPOSITORY) overall
poetry run pytest $(PACKAGE) tests $(PYTEST_OPTIONS)
poetry run coveragespace set overall

.PHONY: read-coverage
read-coverage:
Expand Down Expand Up @@ -150,7 +141,7 @@ mkdocs-serve: mkdocs
# BUILD #######################################################################

DIST_FILES := dist/*.tar.gz dist/*.whl
EXE_FILES := dist/$(PROJECT).*
EXE_FILES := dist/$(PACKAGE).*

.PHONY: dist
dist: install $(DIST_FILES)
Expand All @@ -160,20 +151,20 @@ $(DIST_FILES): $(MODULES) pyproject.toml

.PHONY: exe
exe: install $(EXE_FILES)
$(EXE_FILES): $(MODULES) $(PROJECT).spec
$(EXE_FILES): $(MODULES) $(PACKAGE).spec
# For framework/shared support: https://github.com/yyuu/pyenv/wiki
poetry run pyinstaller $(PROJECT).spec --noconfirm --clean
poetry run pyinstaller $(PACKAGE).spec --noconfirm --clean

$(PROJECT).spec:
poetry run pyi-makespec $(PACKAGE)/__main__.py --onefile --windowed --name=$(PROJECT)
$(PACKAGE).spec:
poetry run pyi-makespec $(PACKAGE)/__main__.py --onefile --windowed --name=$(PACKAGE)

# RELEASE #####################################################################

.PHONY: upload
upload: dist ## Upload the current version to PyPI
git diff --name-only --exit-code
poetry publish
bin/open https://pypi.org/project/$(PROJECT)
bin/open https://pypi.org/project/$(PACKAGE)

# CLEANUP #####################################################################

Expand All @@ -186,7 +177,7 @@ clean-all: clean

.PHONY: .clean-install
.clean-install:
find $(PACKAGES) -name '__pycache__' -delete
find $(PACKAGE) tests -name '__pycache__' -delete
rm -rf *.egg-info

.PHONY: .clean-test
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pytest-random = "*"
freezegun = "*"

# Reports
coveragespace = "=4.0a2"
coveragespace = "=4.0a3"

# Documentation
mkdocs = "^1.0"
Expand Down

0 comments on commit b068684

Please sign in to comment.