-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (40 loc) · 1.26 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
PYTHON_VERSION ?= $(shell python3.8 -c 'import sys; print(sys.executable)' 2> /dev/null)
ifeq ($(shell which "$(PYTHON_VERSION)"),)
$(error python3.8 not found, please install and try again)
endif
PYTHON_VERSION_CHECK := $(shell python -c "import sys; assert sys.version_info.major == 3 and sys.version_info.minor >= 8")
ifneq ($(shell which "$(PYTHON_VERSION_CHECK)"),)
$(error python version needs to be at least 3.8)
endif
.PHONY: all build wheel install uninstall scrape-standard test clean
# Some vars to keep track of things
BUILD := build
DIST := dist
PKG := cgm
VER := 0.9
WHEEL := $(DIST)/$(PKG)-$(VER)-py3-none-any.whl
all: wheel
build:
python setup.py build
$(WHEEL): build
python setup.py bdist_wheel
wheel: $(WHEEL)
install: build $(WHEEL)
pip install --force-reinstall $(WHEEL)
install-dev:
pip install -e .
uninstall:
pip uninstall -y cgm
utils/env:
virtualenv -p $(PYTHON_VERSION) utils/env
. utils/env/bin/activate && python -m pip install --upgrade pip
. utils/env/bin/activate && pip install -r utils/requirements.txt
scrape-standard: utils/env
. utils/env/bin/activate && ./utils/make_cgm_types.py docs/c032380e.pdf cgm/types/parsed_types.py
test:
@echo "TODO" && false
clean:
rm -rf utils/env
rm -rf build
rm -rf dist
rm -rf cgm.egg-info