-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
66 lines (53 loc) · 1.67 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
58
59
60
61
62
63
64
65
66
BLK = black
MAKE = make
PIP = pip3
BASEDIR = $(CURDIR)
SRCDIR = ${BASEDIR}/scatfit
help:
@echo 'Makefile for scatfit'
@echo 'Usage:'
@echo 'make black reformat the code using black code formatter'
@echo 'make build generate distribution archives'
@echo 'make clean remove temporary files'
@echo 'make install install the package locally'
@echo 'make profile profile the code'
@echo 'make test run the non-interactive regression tests'
@echo 'make testall run all regression tests'
@echo 'make uninstall uninstall the package'
@echo 'make upload upload the distribution to PyPI'
@echo 'make uploadtest upload the distribution to TestPyPI'
black:
${BLK} *.py */*.py */*/*.py
build:
python3 -m build
clean:
rm -f ${SRCDIR}/*.pyc
rm -f ${SRCDIR}/apps/*.pyc
rm -rf ${SRCDIR}/__pycache__
rm -rf ${SRCDIR}/apps/__pycache__
rm -rf ${BASEDIR}/build
rm -rf ${BASEDIR}/dist
rm -rf ${BASEDIR}/scatfit.egg-info
rm -rf ${BASEDIR}/tests/__pycache__
install:
${MAKE} clean
${MAKE} uninstall
${PIP} install .
${MAKE} clean
profile:
python3 -m cProfile -s tottime scatfit/apps/fit_frb.py extra/fake_burst_500_DM.fil 500.0 --smodel scattered_isotropic_bandintegrated --fscrunch 1024 --fast
test:
pytest --verbose -m 'not interactive'
testall:
pytest --verbose -s
uninstall:
${PIP} uninstall --yes scatfit
upload:
${MAKE} clean
${MAKE} build
python3 -m twine upload dist/*
uploadtest:
${MAKE} clean
${MAKE} build
python3 -m twine upload --repository testpypi dist/*
.PHONY: help black build clean install profile test testall uninstall upload uploadtest