Skip to content

Commit 218ea98

Browse files
committed
Switch to flit
1 parent 674867f commit 218ea98

File tree

7 files changed

+92
-368
lines changed

7 files changed

+92
-368
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ parser/snooty.py
77
node_modules/
88
.coverage
99
htmlcov/
10+
.venv/
11+
snooty.tar.bz2

Makefile

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,51 @@
1-
.PHONY: lint run test nuitka
1+
.PHONY: help lint test clean publish
22

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)
65

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
1010

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}'
1313

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
1532
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
1736
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

Pipfile

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)