-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (55 loc) · 2.05 KB
/
Makefile
File metadata and controls
66 lines (55 loc) · 2.05 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
65
66
SHELL := /bin/bash
help:
@awk -F ':|##' '/^[^\t].+:.*##/ { printf "\033[36mmake %-28s\033[0m -%s\n", $$1, $$NF }' $(MAKEFILE_LIST) | sort
.PHONY: clean
clean: ## recreate clean virtual environment
rm -rf .venv || true
python3 -m venv .venv
source .venv/bin/activate && pip install --upgrade pip && pip install --progress-bar on -r requirements.txt
rm -f src/infragraph/visualizer/frontend/js/vis-network.min.js
curl -kL https://unpkg.com/vis-network@9.1.2/standalone/umd/vis-network.min.js -o src/infragraph/visualizer/frontend/js/vis-network.min.js
.PHONY: generate
generate: ## generate artifacts using OpenApiArt
source .venv/bin/activate && \
python3 generate.py
cp -f artifacts/infragraph/*.py src/infragraph/
rm -rf src/docs || true
mkdir src/docs
cp -f artifacts/*.* src/docs
.PHONY: test
test: ## run unit tests on the src/infragraph files
source .venv/bin/activate && \
pip uninstall -y infragraph && \
make pre-test-notebook && \
pytest -s
.PHONY: package
package: generate ## create sdist/wheel packages from OpenAPIArt generated artifacts
rm -rf dist || true
source .venv/bin/activate && \
python3 -m build
tar tvzf dist/infragraph*.tar.gz
python3 -m zipfile --list dist/infragraph*.whl
.PHONY: install
install: package ## pip install infragraph package
source .venv/bin/activate && \
pip3 install dist/infragraph*.whl --force-reinstall
.PHONY: deploy
PYPI_TOKEN=__invalid_token__
deploy: ## deploy packages to pypi.org
source .venv/bin/activate && \
python3 -m twine upload -u __token__ -p $(PYPI_TOKEN) dist/*
.PHONY: docs
docs: ## generate local documentation to docs/site
source .venv/bin/activate && \
python3 docs/generate_yaml.py && \
python3 -m mkdocs build --config-file docs/mkdocs.yml --site-dir site
.PHONY: yaml
yaml: ## generate yaml contents for docs
source .venv/bin/activate && \
python3 docs/generate_yaml.py
.PHONY: pre-test-notebook
pre-test-notebook:
rm -rf src/tests/test_notebooks
jupytext --to notebook src/infragraph/notebooks/*.py
cd src && python3 notebook_to_test_script.py
rm -rf src/infragraph/notebooks/*.ipynb