-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
57 lines (43 loc) · 1.13 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
51
52
53
54
55
56
57
PYTHON= python3
BUILD= $(PYTHON) -m build
PDM= $(PYTHON) -m pdm
TWINE= $(PYTHON) -m twine
VERSION= $(shell $(PDM) show --version)
DIST_ENV= SOURCE_DATE_EPOCH=`git log -1 --pretty=%ct`
DIST_FILES= dist/*-$(VERSION).tar.gz
-include Makefile.local
## ======================================================================
.PHONY: default
default: dist
.PHONY: clean
clean:
$(RM) -r .venv .pdm-* .pytest* __pycache__ build dist pdm.lock src/*/_version.py src/*.egg-info
find src tests -name __pycache__ -exec $(RM) -r {} +
find src -name "*.so" -exec $(RM) {} +
.PHONY: test
test:
$(PDM) install
$(PDM) run pytest
## ======================================================================
.PHONY: dist
dist:
$(BUILD) .
.PHONY: dist-source
dist-source:
$(DIST_ENV) \
$(BUILD) --sdist .
.PHONY: dist-wheel
dist-wheel:
$(DIST_ENV) \
$(BUILD) --wheel .
.PHONY: dist-check
dist-check:
$(TWINE) check --strict dist/*
.PHONY: dist-upload
dist-upload:
$(RM) dist/*.whl
$(PDM) publish --no-build --repository pypi-nkf
.PHONY: dist-upload-test
dist-upload-test:
$(RM) dist/*.whl
$(PDM) publish --no-build --repository test-pypi-nkf