Skip to content

Commit

Permalink
Switch to flit
Browse files Browse the repository at this point in the history
  • Loading branch information
i80and committed Mar 21, 2019
1 parent 674867f commit 218ea98
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 368 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ parser/snooty.py
node_modules/
.coverage
htmlcov/
.venv/
snooty.tar.bz2
56 changes: 45 additions & 11 deletions Makefile
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
21 changes: 0 additions & 21 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 218ea98

Please sign in to comment.