2023-11-20 20:12:34 +00:00
|
|
|
# simple Makefile with scripts that are otherwise hard to remember
|
|
|
|
# to use, run from the repo root `make <command>`
|
|
|
|
|
2023-12-12 02:08:03 +00:00
|
|
|
default: help
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo Developer commands:
|
|
|
|
@echo
|
2024-02-19 16:40:53 +00:00
|
|
|
@echo "ruff Run ruff, fixing any safely-fixable errors and formatting"
|
|
|
|
@echo "ruff-unsafe Run ruff, fixing all fixable errors and formatting"
|
|
|
|
@echo "mypy Run mypy using the config in pyproject.toml to identify type mismatches and other coding errors"
|
|
|
|
@echo "mypy-all Run mypy ignoring the config in pyproject.tom but still ignoring missing imports"
|
2024-03-06 02:49:08 +00:00
|
|
|
@echo "test Run the unit tests."
|
|
|
|
@echo "frontend-install Install the pnpm modules needed for the front end"
|
2024-02-19 16:40:53 +00:00
|
|
|
@echo "frontend-build Build the frontend in order to run on localhost:9090"
|
|
|
|
@echo "frontend-dev Run the frontend in developer mode on localhost:5173"
|
2024-03-06 02:49:08 +00:00
|
|
|
@echo "frontend-typegen Generate types for the frontend from the OpenAPI schema"
|
2024-02-19 16:40:53 +00:00
|
|
|
@echo "installer-zip Build the installer .zip file for the current version"
|
|
|
|
@echo "tag-release Tag the GitHub repository with the current version (use at release time only!)"
|
2023-12-12 02:08:03 +00:00
|
|
|
|
2023-11-20 20:12:34 +00:00
|
|
|
# Runs ruff, fixing any safely-fixable errors and formatting
|
|
|
|
ruff:
|
2024-02-19 16:40:53 +00:00
|
|
|
ruff check . --fix
|
|
|
|
ruff format .
|
2023-11-20 20:12:34 +00:00
|
|
|
|
|
|
|
# Runs ruff, fixing all errors it can fix and formatting
|
|
|
|
ruff-unsafe:
|
2024-02-19 16:40:53 +00:00
|
|
|
ruff check . --fix --unsafe-fixes
|
|
|
|
ruff format .
|
2023-11-20 20:12:34 +00:00
|
|
|
|
|
|
|
# Runs mypy, using the config in pyproject.toml
|
|
|
|
mypy:
|
2024-02-19 16:40:53 +00:00
|
|
|
mypy scripts/invokeai-web.py
|
2023-11-20 20:12:34 +00:00
|
|
|
|
|
|
|
# Runs mypy, ignoring the config in pyproject.toml but still ignoring missing (untyped) imports
|
2023-11-20 20:18:04 +00:00
|
|
|
# (many files are ignored by the config, so this is useful for checking all files)
|
2023-11-20 20:12:34 +00:00
|
|
|
mypy-all:
|
2024-02-19 16:40:53 +00:00
|
|
|
mypy scripts/invokeai-web.py --config-file= --ignore-missing-imports
|
|
|
|
|
|
|
|
# Run the unit tests
|
|
|
|
test:
|
|
|
|
pytest ./tests
|
|
|
|
|
|
|
|
# Install the pnpm modules needed for the front end
|
|
|
|
frontend-install:
|
|
|
|
rm -rf invokeai/frontend/web/node_modules
|
|
|
|
cd invokeai/frontend/web && pnpm install
|
2023-12-12 02:08:03 +00:00
|
|
|
|
|
|
|
# Build the frontend
|
|
|
|
frontend-build:
|
|
|
|
cd invokeai/frontend/web && pnpm build
|
|
|
|
|
|
|
|
# Run the frontend in dev mode
|
|
|
|
frontend-dev:
|
|
|
|
cd invokeai/frontend/web && pnpm dev
|
|
|
|
|
2024-03-06 02:49:08 +00:00
|
|
|
frontend-typegen:
|
|
|
|
cd invokeai/frontend/web && python ../../../scripts/generate_openapi_schema.py | pnpm typegen
|
|
|
|
|
2023-12-12 02:08:03 +00:00
|
|
|
# Installer zip file
|
|
|
|
installer-zip:
|
|
|
|
cd installer && ./create_installer.sh
|
|
|
|
|
|
|
|
# Tag the release
|
|
|
|
tag-release:
|
2023-12-12 02:11:37 +00:00
|
|
|
cd installer && ./tag_release.sh
|
2023-12-12 02:08:03 +00:00
|
|
|
|