Skip to content

Commit

Permalink
v0.1: Prep for initial testing release
Browse files Browse the repository at this point in the history
  • Loading branch information
i80and committed Mar 21, 2019
1 parent 9eff24a commit 3feed8d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ node_modules/
.coverage
htmlcov/
.venv/
snooty.tar.bz2
dist/
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
.PHONY: help lint test clean publish
.PHONY: help lint test clean flit-publish

SYSTEM_PYTHON=$(shell which python3)
PLATFORM=$(shell printf '%s_%s' "$$(uname -s | tr '[:upper:]' '[:lower:]')" "$$(uname -m)")
VERSION=$(shell $(SYSTEM_PYTHON) -c 'exec(open("snooty/__init__.py").read()); print(__version__)')
export SOURCE_DATE_EPOCH = $(shell date +%s)

# 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

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

Expand All @@ -27,25 +24,28 @@ lint: .venv/.EXISTS ## Run all linting
test: lint ## Run unit tests
. .venv/bin/activate && python3 -m pytest --cov=snooty

snooty.dist/.EXISTS: test
-rm -rf snooty.dist
dist/snooty/.EXISTS:
$(MAKE) test
-rm -rf snooty.dist dist
mkdir dist
echo 'from snooty import main; main.main()' > snooty.py
PYTHONHOME=`pwd`/.venv python3 -m nuitka \
--standalone --python-flag=no_site --remove-output \
snooty.py
--lto snooty.py
rm snooty.py
mv snooty.dist dist/snooty
touch $@

snooty.tar.bz2: snooty/rstspec.toml snooty.dist/.EXISTS ## Build a binary tarball
dist/snooty-${VERSION}-${PLATFORM}.tar.bz2: snooty/rstspec.toml dist/snooty/.EXISTS ## Build a binary tarball
install -m644 snooty/rstspec.toml snooty.dist
tar -cjf $@ snooty.dist/
tar -cjf $@ -C dist snooty

snooty.tar.bz2.asc: snooty.tar.bz2 ## Build and sign a binary tarball
dist/snooty-${VERSION}-${PLATFORM}.tar.bz2.asc: dist/snooty-${VERSION}-${PLATFORM}.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 -r snooty.tar.bz2* snooty.py .venv dist
-rm -rf snooty.dist

publish: test ## Deploy the package to pypi
flit-publish: test ## Deploy the package to pypi
SOURCE_DATE_EPOCH="$$SOURCE_DATE_EPOCH" flit publish
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ home-page = "https://github.com/mongodb/snooty-parser"
classifiers = ["License :: OSI Approved :: Apache Software License"]
requires-python = "~= 3.7"
requires = [
"pymongo[snappy,srv,tls] ~= 3.7.2",
"pymongo[srv,tls] ~= 3.7.2",
"docutils ~= 0.14",
"dnspython ~= 1.16.0",
"watchdog ~= 0.9.0",
Expand Down

0 comments on commit 3feed8d

Please sign in to comment.