forked from has2k1/plotnine-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (56 loc) · 2.25 KB
/
Makefile
File metadata and controls
64 lines (56 loc) · 2.25 KB
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
SHELL := /bin/bash
.PHONY: clean examples tutorials
clean: clean-pyc clean-build
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
examples:
export PYDEVD_DISABLE_FILE_VALIDATION=1; \
export PYTHONWARNINGS="ignore::FutureWarning::,ignore::DeprecationWarning::"; \
clean_notebook=$$(git rev-parse --show-toplevel)/tools/clean-notebook; \
cd plotnine_examples/examples; \
for file in *.ipynb; do \
python -Xfrozen_modules=off -m jupyter nbconvert --to notebook --inplace --execute "$${file}"; \
if [[ "$$?" != "0" ]]; then \
echo "$$(tput setaf 1)$${file}$$(tput sgr0)"; \
fi; \
$$clean_notebook "$${file}" > "$${file}.$$$$" && mv "$${file}.$$$$" "$${file}"; \
done
tutorials:
export PYDEVD_DISABLE_FILE_VALIDATION=1; \
export PYTHONWARNINGS="ignore::FutureWarning::,ignore::DeprecationWarning::"; \
clean_notebook=$$(git rev-parse --show-toplevel)/tools/clean-notebook; \
cd plotnine_examples/tutorials; \
for file in *.ipynb; do \
[[ "$${file}" =~ pyqt ]] && continue; \
python -Xfrozen_modules=off -m jupyter nbconvert --to notebook --inplace --execute "$${file}"; \
if [[ "$$?" != "0" ]]; then \
echo "$$(tput setaf 1)$${file}$$(tput sgr0)"; \
fi; \
$$clean_notebook "$${file}" > "$${file}.$$$$" && mv "$${file}.$$$$" "$${file}"; \
done
changes:
export PYDEVD_DISABLE_FILE_VALIDATION=1; \
export PYTHONWARNINGS="ignore::FutureWarning::,ignore::DeprecationWarning::"; \
clean_notebook=$$(git rev-parse --show-toplevel)/tools/clean-notebook; \
files=$$(git status --porcelain | grep -E '\.ipynb$$' | sed s/^...//); \
for path in $$files; do \
DIR=$$(dirname "$${path}"); \
file=$$(basename "$${path}"); \
pushd $$DIR; \
python -Xfrozen_modules=off -m jupyter nbconvert --to notebook --inplace --execute "$${file}"; \
if [[ "$$?" != "0" ]]; then \
echo "$$(tput setaf 1)$${file}$$(tput sgr0)"; \
fi; \
$$clean_notebook "$${file}" > "$${file}.$$$$" && mv "$${file}.$$$$" "$${file}"; \
popd; \
done
all: examples tutorials