-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
50 lines (42 loc) · 1.43 KB
/
Makefile
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
venv:
poetry install
.PHONY: install-hooks
install-hooks: venv
poetry run pre-commit install
# set COVERALLS_REPO_TOKEN=<repo token> environment variable to report coverage
# after running tests
.PHONY: test
test:
poetry install
poetry run pytest --cov=ocflib --cov-report=term-missing
ifneq ($(strip $(COVERALLS_REPO_TOKEN)),)
poetry run coveralls
endif
.PHONY: release-pypi
release-pypi: clean autoversion
poetry build
twine upload dist/*
.PHONY: builddeb
builddeb: autoversion
dpkg-buildpackage -us -uc
.PHONY: package
package: package_bookworm
.PHONY: package_%
package_%:
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 "$*"
.PHONY: clean
clean:
rm -rf dist deb_dist 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="[email protected]" \
dch -v `cat .version` -D stable --no-force-save-on-release \
--create --force-distribution --package "python-ocflib" "Package for Debian."
dch --local "~deb$(shell lsb_release -rs | cut -d . -f 1)u" \
"Package for $(shell lsb_release -cs)."