This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: add makefile * update makefile to have additional commands * update readme
- Loading branch information
1 parent
1980708
commit 0ccaa84
Showing
5 changed files
with
356 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
PYTHONPATH= | ||
SHELL=/bin/bash | ||
VENV = .venv | ||
|
||
ifeq ($(OS),Windows_NT) | ||
VENV_BIN=$(VENV)/Scripts | ||
else | ||
VENV_BIN=$(VENV)/bin | ||
endif | ||
|
||
install-graphviz: | ||
ifeq ($(shell uname), Darwin) # MacOS | ||
brew install graphviz | ||
else ifeq ($(shell uname -o), Cygwin) # Windows | ||
choco install graphviz | ||
else ifeq ($(shell uname -o), GNU/Linux) # Linux | ||
if command -v apt-get >/dev/null; then sudo apt-get install -y graphviz; fi | ||
if command -v yum >/dev/null; then sudo yum install -y graphviz; fi | ||
if command -v dnf >/dev/null; then sudo dnf install -y graphviz; fi | ||
if command -v pacman >/dev/null; then sudo pacman -S --noconfirm graphviz; fi | ||
else | ||
@echo "Could not identify OS or appropriate package manager." | ||
endif | ||
|
||
.venv: ## Set up virtual environment and install requirements | ||
python3 -m venv $(VENV) | ||
$(MAKE) requirements | ||
$(MAKE) install-graphviz | ||
|
||
.PHONY: node_modules | ||
node_modules: | ||
npm install | ||
|
||
.PHONY: requirements | ||
requirements: .venv | ||
$(VENV_BIN)/python -m pip install --upgrade pip | ||
$(VENV_BIN)/pip install -r requirements.txt | ||
|
||
.PHONY: serve | ||
serve: .venv | ||
@unset CONDA_PREFIX && source $(VENV_BIN)/activate && mkdocs serve | ||
|
||
.PHONY: lint | ||
lint: .venv node_modules | ||
# python | ||
$(VENV_BIN)/black --check . | ||
# js | ||
npx rome format docs/src/node/ | ||
|
||
.PHONY: test-python | ||
test-python: .venv | ||
find docs/src/ -name "*.py" | xargs -n 1 sh -c 'python $$0 || exit 255' | ||
|
||
.PHONY: test-node | ||
test-node: node_modules | ||
find docs/src/ -name "*.js" | xargs -n 1 sh -c 'node $$0 || exit 255' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"devDependencies": { | ||
"nodejs-polars": "0.8.0", | ||
"rome": "12.1.3" | ||
}, | ||
"dependencies": { | ||
"chance": "^1.1.11" | ||
} | ||
} |