-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
43 lines (42 loc) · 1.72 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
PYTHON_EXEC:=pipenv run
TEST_SCOPE=tests/
.PHONY: build
init: ## Build local development environment
mkdir -p .venv
yarn --cwd qslwidgets install
pipenv install
make build
@$(PYTHON_EXEC) jupyter labextension develop --overwrite --no-build .
@$(PYTHON_EXEC) jupyter nbextension install --sys-prefix --symlink --overwrite --py qsl
@$(PYTHON_EXEC) jupyter nbextension enable --sys-prefix --py qsl
check: ## Check code for formatting, linting, etc.
@$(PYTHON_EXEC) pytest -s -v $(TEST_SCOPE)
@$(PYTHON_EXEC) mypy qsl
@$(PYTHON_EXEC) pylint qsl
@$(PYTHON_EXEC) black --diff --check .
develop: ## Watch/rebuild Jupyter / Eel UI elements.
@$(PYTHON_EXEC) yarn --cwd qslwidgets watch
storybook: ## Watch/rebuild isolated UI elements.
yarn --cwd qslwidgets storybook
clean: ## Clean out all build files.
rm -rf dist build qslwidgets/lib qslwidgets/dist \
qsl/ui/labextension \
qsl/ui/nbextension/index.js* .*_cache
lab: ## Launch a jupyter lab instance
@$(PYTHON_EXEC) jupyter lab
notebook: ## Launch a jupyter notebook instance
@$(PYTHON_EXEC) jupyter notebook
format: ## Format all files.
@$(PYTHON_EXEC) black qsl
yarn --cwd qslwidgets format
build: # Build the frontend and integrate into the package
yarn --cwd qslwidgets clean
@$(PYTHON_EXEC) yarn --cwd qslwidgets build
package: build ## Make a local build of the Python package, source dist and wheel
rm -rf dist
@$(PYTHON_EXEC) pyproject-build .
publish-docs:
cd docs && git init && git remote add origin git@github.com:faustomorales/qsl.git; git branch -m gh-pages && git add . && git commit --amend --no-edit && git push --force --set-upstream origin gh-pages
publish: package ## Publish the npm and pypi packages.
yarn --cwd qslwidgets publish
twine upload dist/*.whl