forked from ocf/ocflib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (44 loc) · 1.48 KB
/
Copy pathMakefile
File metadata and controls
55 lines (44 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# first set COVERALLS_REPO_TOKEN=<repo token> environment variable
.PHONY: coveralls
coveralls: test
.tox/py35/bin/coveralls
venv: setup.py requirements-dev.txt
vendor/venv-update \
venv= $@ -ppython3 \
install= -r requirements-dev.txt -e .
.PHONY: install-hooks
install-hooks: venv
venv/bin/pre-commit install
.PHONY: test
test:
tox
.PHONY: release-pypi
release-pypi: clean autoversion
python3 setup.py sdist bdist_wheel
twine upload dist/*
.PHONY: builddeb
builddeb: autoversion
dpkg-buildpackage -us -uc
.PHONY: package
package: package_jessie package_stretch
.PHONY: package_%
package_%: dist
docker run -e "DIST_UID=$(shell id -u)" -e "DIST_GID=$(shell id -g)" -v $(CURDIR):/mnt:rw "docker.ocf.berkeley.edu/theocf/debian:$*" /mnt/build-in-docker "$*"
dist:
mkdir -p "$@"
.PHONY: clean
clean: autoversion
python3 setup.py clean
rm -rf dist deb_dist
# PEP440 sets terrible restrictions on public version schemes which prohibit:
# - appending a SHA
# - leading zeros before version components (e.g. "09" for September becomes "9")
# Unfortunately, PyPI enforces these restrictions.
.PHONY: autoversion
autoversion:
date +%Y.%-m.%-d.%-H.%-M > .version
rm -f debian/changelog
DEBFULLNAME="Open Computing Facility" DEBEMAIL="help@ocf.berkeley.edu" VISUAL=true \
dch -v `cat .version` -D stable --no-force-save-on-release \
--create --force-distribution --package "python-ocflib" "Package for Debian."
VISUAL=touch dch --local "~deb$(shell lsb_release -rs | cut -d . -f 1)u"