-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (82 loc) · 2.35 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- coding: utf-8-unix -*-
# EDITOR must wait!
EDITOR = nano
PREFIX = /usr/local
PYTHON = python3
check:
flake8 .
flake8 . `grep -Fl '#!/usr/bin/env python3' bin/*`
clean:
rm -rf *.lprof
rm -rf *.prof
rm -rf build
rm -rf dataiter.egg-info
rm -rf dist
rm -rf doc/_build
rm -rf doc/comparison/comparison.html
rm -rf validation/*.csv
rm -rf __pycache__
rm -rf */__pycache__
rm -rf */*/__pycache__
rm -rf .pytest_cache
rm -rf */.pytest_cache
rm -rf */*/.pytest_cache
doc:
$(MAKE) SPHINXBUILD=../venv/bin/sphinx-build -C doc clean html
doc-check:
PYTHONPATH=. doc/check.py
doc-open:
xdg-open doc/_build/html/index.html
doc-watch:
watchexec -e py,rst --workdir doc $(MAKE) SPHINXBUILD=../venv/bin/sphinx-build html
install:
pip3 install --break-system-packages .
# Non-essential scripts, not installed by default.
# Note that these don't go through setuptools rewriting,
# instead they just do a plain unspecified dataiter import.
install-cli:
mkdir -p $(PREFIX)/bin
for X in `ls bin | grep di-`; do \
cp -fv bin/$$X $(PREFIX)/bin && \
chmod +x $(PREFIX)/bin/$$X; \
done
# Interactive!
publish:
$(MAKE) clean
python3 -m build
test -s dist/dataiter-*-py3-none-any.whl
test -s dist/dataiter-*.tar.gz
ls -l dist
@printf "Press Enter to upload or Ctrl+C to abort: "; read _
twine upload dist/*
sudo pip3 uninstall --break-system-packages -y dataiter || true
sudo pip3 uninstall --break-system-packages -y dataiter || true
sudo pip3 install --break-system-packages -U dataiter
$(MAKE) test-installed
# Interactive!
release:
$(MAKE) check doc-check test validate clean
@echo "BUMP VERSION NUMBERS"
$(EDITOR) dataiter/__init__.py
$(EDITOR) benchmark-versions.sh
@echo "ADD RELEASE NOTES"
$(EDITOR) NEWS.md
sudo $(MAKE) install clean
$(MAKE) test-installed
tools/release
test:
py.test .
test-installed:
cd && python3 -c "import dataiter; dataiter.DataFrame()"
cd && python3 -c "import dataiter; dataiter.ListOfDicts()"
validate:
cd validation && DATAITER_USE_NUMBA=false ./validate-df.sh
cd validation && DATAITER_USE_NUMBA=true ./validate-df.sh
cd validation && ./validate-ld.sh
venv:
rm -rf venv
$(PYTHON) -m venv venv
. venv/bin/activate && \
pip install -U pip setuptools wheel && \
pip install -r requirements.txt
.PHONY: check clean doc doc-check doc-open doc-watch install install-cli publish release test test-installed validate venv