~dricottone/dalle-mini-terminal

3d1904e546e4a28d3c5d3daacfe2bb874754a868 — Dominic Ricottone 1 year, 9 months ago d9bf1e9
Refactored Makefile

The install recipe just installs the program, no development processes.
1 files changed, 16 insertions(+), 40 deletions(-)

M Makefile
M Makefile => Makefile +16 -40
@@ 1,63 1,39 @@
#PYTHON_BIN=python3
PYTHON_BIN=python

#PIP_BIN=$(PYTHON_BIN) -m pip
PIP_BIN=pip

# NOTE: `pipx` not currently used
#PIPX_BIN=$(PYTHON_BIN) -m pipx
PIPX_BIN=pipx

PYTHON_BIN=python3
PIP_BIN=$(PYTHON_BIN) -m pip
VENV_BIN=$(PYTHON_BIN) -m venv

PY_COMPILE_BIN=$(PYTHON_BIN) -m py_compile

# NOTE: `pyproject-build` not currently used
#PYPROJECT_BUILD_BIN=$(PYTHON_BIN) -m build
PYPROJECT_BUILD_BIN=pyproject-build

# NOTE: `unittest` not currently used
#UNITTEST_BIN=$(PYTHON_BIN) -m unittest
UNITTEST_BIN=unittest --color

# NOTE: `mypy` not currently used
#MYPY_BIN=$(PYTHON_BIN) -m mypy
MYPY_BIN=MYPY_CACHE_DIR=dalle_mini_terminal/__mypycache__ mypy

# see https://git.dominic-ricottone.com/gap.git/about
#GAP_BIN=$(PYTHON_BIN) -m gap
# see https://git.dominic-ricottone.com/~dricottone/gap
GAP_BIN=gap

.PHONY: clean test install install-cuda uninstall run

clean:
	rm -rf **/__pycache__ **/*.pyc
	#rm -rf **/__mypycache__
	#rm -rf build
	#rm -rf *.egg-info

uninstall:
	rm -rf .venv

test:
	$(PY_COMPILE_BIN) dalle_mini_terminal/*.py
	#$(UNITTEST_BIN) --working-directory . tests --verbose
	#$(MYPY_BIN) -p dalle_mini_terminal

install:
.venv:
	$(VENV_BIN) .venv

dalle_mini_terminal/cli.py:
	$(GAP_BIN) dalle_mini_terminal/cli.toml -o dalle_mini_terminal/cli.py

build: dalle_mini_terminal/cli.py

install: .venv dalle_mini_terminal/cli.py
	(source .venv/bin/activate; $(PIP_BIN) install jax)
	(source .venv/bin/activate; $(PIP_BIN) install git+https://github.com/patil-suraj/vqgan-jax.git)
	(source .venv/bin/activate; $(PIP_BIN) install dalle-mini)
	$(GAP_BIN) dalle_mini_terminal/cli.toml -o dalle_mini_terminal/cli.py

install-cuda:
	$(VENV_BIN) .venv
install-cuda: .venv dalle_mini_terminal/cli.py
	(source .venv/bin/activate; $(PIP_BIN) install "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_releases.html)
	(source .venv/bin/activate; $(PIP_BIN) install git+https://github.com/patil-suraj/vqgan-jax.git)
	(source .venv/bin/activate; $(PIP_BIN) install dalle-mini)
	$(GAP_BIN) dalle_mini_terminal/cli.toml -o dalle_mini_terminal/cli.py

uninstall:
	rm -rf .venv

run:
	(source .venv/bin/activate; $(PYTHON_BIN) -m dalle_mini_terminal --artifacts ./mini-1_v0_artifacts -- cats playing chess)

.PHONY: clean uninstall test build install install-cuda run