-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
92 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ parser/snooty.py | |
node_modules/ | ||
.coverage | ||
htmlcov/ | ||
.venv/ | ||
snooty.tar.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,51 @@ | ||
.PHONY: lint run test nuitka | ||
.PHONY: help lint test clean publish | ||
|
||
run: | ||
pipenv run mypy --strict snooty | ||
pipenv run python -m snooty watch source 'mongodb://localhost/test?retryWrites=true' | ||
SYSTEM_PYTHON=$(shell which python3) | ||
export SOURCE_DATE_EPOCH = $(shell date +%s) | ||
|
||
lint: | ||
pipenv run mypy --strict snooty | ||
pipenv run flake8 --max-line-length=100 snooty | ||
# UNAME_S := $(shell uname -s) | ||
# ifeq ($(UNAME_S),Darwin) | ||
# export CPPFLAGS="-I/usr/local/Cellar/snappy/1.1.7_1/include/ -L/usr/local/lib" | ||
# endif | ||
|
||
test: lint | ||
pipenv run pytest --cov=snooty | ||
help: ## Show this help message | ||
@grep -E '^[a-zA-Z_.0-9-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' | ||
|
||
nuitka: | ||
.venv/.EXISTS: | ||
-rm -r .venv snooty.py | ||
python3 -m virtualenv .venv | ||
. .venv/bin/activate && \ | ||
python3 -m pip install --upgrade pip && \ | ||
python3 -m pip install flit && \ | ||
flit install --deps=develop | ||
touch $@ | ||
|
||
lint: .venv/.EXISTS ## Run all linting | ||
. .venv/bin/activate && python3 -m mypy --strict snooty | ||
. .venv/bin/activate && python3 -m flake8 --max-line-length=100 snooty | ||
|
||
test: lint ## Run unit tests | ||
. .venv/bin/activate && python3 -m pytest --cov=snooty | ||
|
||
snooty.dist/.EXISTS: test | ||
-rm -rf snooty.dist | ||
echo 'from snooty import main; main.main()' > snooty.py | ||
nuitka3 --lto --standalone --python-flag=no_site --remove-output snooty.py | ||
PYTHONHOME=`pwd`/.venv python3 -m nuitka \ | ||
--standalone --python-flag=no_site --remove-output \ | ||
snooty.py | ||
rm snooty.py | ||
touch $@ | ||
|
||
snooty.tar.bz2: snooty/rstspec.toml snooty.dist/.EXISTS ## Build a binary tarball | ||
install -m644 snooty/rstspec.toml snooty.dist | ||
tar -cjf $@ snooty.dist/ | ||
|
||
snooty.tar.bz2.asc: snooty.tar.bz2 ## Build and sign a binary tarball | ||
gpg --armor --detach-sig $^ | ||
|
||
clean: ## Remove all build artifacts | ||
-rm -r snooty.tar.bz2* snooty.py .venv | ||
-rm -rf snooty.dist | ||
|
||
publish: test ## Deploy the package to pypi | ||
SOURCE_DATE_EPOCH="$$SOURCE_DATE_EPOCH" flit publish |
Oops, something went wrong.