-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
81 lines (57 loc) · 1.58 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# From http://peterdowns.com/posts/first-time-with-pypi.html
# To register a package on PyPiTest:
# python setup.py register -r pypitest
#
# Then to upload the actual package:
# python setup.py sdist upload -r pypitest
#
# Do the same with pypi instead of pypitest to go live
all: clean html sdist wheel
version = `./version.sh`
test-upload: # sdist
twine upload dist/pygcam-$(version).tar.gz -r testpypi
upload: pypi-upload
pypi-upload: sdist
twine upload dist/pygcam-$(version).tar.gz
clean-html:
make -C docs clean
html:
make -C docs html
pdf:
make -C docs latexpdf
clean-setup:
python setup.py clean
sdist:
python setup.py sdist
wheel:
python setup.py bdist_wheel
clean: clean-html clean-setup clean-requirements
dev:
pip install -e .
remove-pygcam:
conda env remove -n pygcam3
UNAME=$(strip $(shell uname))
ifeq ($(UNAME), Darwin)
YML_FILE=py3_pygcam_macos.yml
else ifeq ($(UNAME), Linux)
YML_FILE=py3_pygcam_linux.yml
else
# of limited use since probably no "make" cmd
YML_FILE=py3_opgee_win10.yml
endif
create-pygcam: $(YML_FILE)
conda env create -f $(YML_FILE)
install-pygcam:
bash -l -c 'conda activate pygcam3 && pip install -e .'
rebuild-pygcam: remove-pygcam create-pygcam install-pygcam
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
RQMTS := $(shell cat requirements.in)
MODS := $(subst $(SPACE),|,$(RQMTS))
EXPR := $(shell printf "^(%s)=\n" '$(MODS)')
RTD_RQMTS = rtd.requirements.txt
clean-requirements:
rm $(RTD_RQMTS)
rtd-reqs $(RTD_RQMTS): requirements.in
python -V|sed -e 's/Python /python==/' > $(RTD_RQMTS)
pip freeze | egrep '$(EXPR)' >> $(RTD_RQMTS)