|
1 | | -.PHONY: lint run test nuitka |
| 1 | +.PHONY: help lint test clean publish |
2 | 2 |
|
3 | | -run: |
4 | | - pipenv run mypy --strict snooty |
5 | | - pipenv run python -m snooty watch source 'mongodb://localhost/test?retryWrites=true' |
| 3 | +SYSTEM_PYTHON=$(shell which python3) |
| 4 | +export SOURCE_DATE_EPOCH = $(shell date +%s) |
6 | 5 |
|
7 | | -lint: |
8 | | - pipenv run mypy --strict snooty |
9 | | - pipenv run flake8 --max-line-length=100 snooty |
| 6 | +# UNAME_S := $(shell uname -s) |
| 7 | +# ifeq ($(UNAME_S),Darwin) |
| 8 | +# export CPPFLAGS="-I/usr/local/Cellar/snappy/1.1.7_1/include/ -L/usr/local/lib" |
| 9 | +# endif |
10 | 10 |
|
11 | | -test: lint |
12 | | - pipenv run pytest --cov=snooty |
| 11 | +help: ## Show this help message |
| 12 | + @grep -E '^[a-zA-Z_.0-9-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
13 | 13 |
|
14 | | -nuitka: |
| 14 | +.venv/.EXISTS: |
| 15 | + -rm -r .venv snooty.py |
| 16 | + python3 -m virtualenv .venv |
| 17 | + . .venv/bin/activate && \ |
| 18 | + python3 -m pip install --upgrade pip && \ |
| 19 | + python3 -m pip install flit && \ |
| 20 | + flit install --deps=develop |
| 21 | + touch $@ |
| 22 | + |
| 23 | +lint: .venv/.EXISTS ## Run all linting |
| 24 | + . .venv/bin/activate && python3 -m mypy --strict snooty |
| 25 | + . .venv/bin/activate && python3 -m flake8 --max-line-length=100 snooty |
| 26 | + |
| 27 | +test: lint ## Run unit tests |
| 28 | + . .venv/bin/activate && python3 -m pytest --cov=snooty |
| 29 | + |
| 30 | +snooty.dist/.EXISTS: test |
| 31 | + -rm -rf snooty.dist |
15 | 32 | echo 'from snooty import main; main.main()' > snooty.py |
16 | | - nuitka3 --lto --standalone --python-flag=no_site --remove-output snooty.py |
| 33 | + PYTHONHOME=`pwd`/.venv python3 -m nuitka \ |
| 34 | + --standalone --python-flag=no_site --remove-output \ |
| 35 | + snooty.py |
17 | 36 | rm snooty.py |
| 37 | + touch $@ |
| 38 | + |
| 39 | +snooty.tar.bz2: snooty/rstspec.toml snooty.dist/.EXISTS ## Build a binary tarball |
| 40 | + install -m644 snooty/rstspec.toml snooty.dist |
| 41 | + tar -cjf $@ snooty.dist/ |
| 42 | + |
| 43 | +snooty.tar.bz2.asc: snooty.tar.bz2 ## Build and sign a binary tarball |
| 44 | + gpg --armor --detach-sig $^ |
| 45 | + |
| 46 | +clean: ## Remove all build artifacts |
| 47 | + -rm -r snooty.tar.bz2* snooty.py .venv |
| 48 | + -rm -rf snooty.dist |
| 49 | + |
| 50 | +publish: test ## Deploy the package to pypi |
| 51 | + SOURCE_DATE_EPOCH="$$SOURCE_DATE_EPOCH" flit publish |
0 commit comments