VENV=.venv BIN=$(VENV)/bin help: @echo "\nPlease use \`make target\` where target is one of\n" @echo "init - build deck.gl and install all requirements for development" @echo "test - run tests" @echo "prepare-jupyter - initiate pydeck-related extensions in JupyterLab and Jupyter Notebook" @echo "bump-version - bump the version files for the pydeck frontend and backend" @echo "publish-pypi - prepare pydeck for publication to PyPI" @echo "publish-test-pypi - prepare pydeck for publication to the test.pypi.org" @echo "release - package and upload a release" @echo "fast-build - rebuild @deck.gl/jupyter-widget" @echo "setup-env - detect basic requirements and set up a virtualenv using uv" @echo "pre-commit - run pre-commit hook for pydeck" WIDGET_DIST=../../modules/jupyter-widget/dist NBEXT_STATIC=pydeck/nbextension/static copy-bundle: cp $(WIDGET_DIST)/index.js $(NBEXT_STATIC)/index.js cp $(WIDGET_DIST)/index.js.map $(NBEXT_STATIC)/index.js.map init: . $(BIN)/activate && \ yarn bootstrap && \ yarn build $(MAKE) copy-bundle uv pip install -r requirements/requirements.txt && \ uv pip install -r requirements/requirements-dev.txt && \ uv pip install -e . fast-build: cd ../../modules/jupyter-widget && yarn build $(MAKE) copy-bundle uv pip install -e . pre-commit: $(BIN)/python -m black . && $(MAKE) test setup-env: test `command -v uv` || echo "Please install uv: https://docs.astral.sh/uv/getting-started/installation/" test `command -v yarn` || echo Please install yarn test `command -v uv` && test `command -v yarn` uv venv --python 3.13 $(VENV) # avoid conflict between any js code in the venv and the root echo '{"type": "commonjs"}' > $(VENV)/package.json prepare-jupyter: # Enable the notebook extension python -m jupyter nbextension install --sys-prefix --symlink --overwrite --py pydeck; \ python -m jupyter nbextension enable --sys-prefix --py pydeck; \ # Build and install the JS module cd ../../modules/jupyter-widget/; \ python -m jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build; \ python -m jupyter labextension install . --no-build; \ python -m jupyter labextension link .; \ python -m jupyter lab build; \ cd ../../bindings/pydeck test: $(BIN)/python -m flake8 . && \ $(BIN)/python -m pytest --cov=pydeck bump-version: @read -p "Choose a release type {MAJOR, MINOR, PATCH, BETA, ALPHA, RC}:" choice; \ python bump_version.py "$$choice"; publish-pypi: uv pip install build twine rm -rf ./dist/* python -m build python -m twine upload dist/* publish-test-pypi: uv pip install build twine rm -rf ./dist/* python -m build python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/* release: $(MAKE) bump-version $(MAKE) test VERSION=$$(python -c "import pydeck; print(pydeck.__version__)"); \ git commit -am "pydeck $$VERSION" $(MAKE) publish-pypi ci: $(MAKE) test