chore: update TODO and add uv targets
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
# ENV
|
||||
|
||||
UV ?= uv
|
||||
|
||||
ifeq (, $(shell which uv))
|
||||
ifeq (,$(shell which uv))
|
||||
ifeq (,$(shell python3 -m uv --help||python3 -m pip install --user uv)) # detect uv install
|
||||
UV ?= false
|
||||
endif
|
||||
UV ?= python3 -m uv
|
||||
endif
|
||||
|
||||
UV ?= uv
|
||||
RUFF ?= $(UV) run --active ruff
|
||||
TY ?= $(UV) run --active ty
|
||||
DOCKER ?= docker
|
||||
@@ -17,13 +19,13 @@ PORT ?= 8080
|
||||
|
||||
.PHONY: help
|
||||
help: ## show this message
|
||||
@echo "Usage: make [target1] (target2) ..."
|
||||
@echo "Usage: $(MAKE) [target1] [target2] ..."
|
||||
@echo ""
|
||||
@echo "Commands/Targets:"
|
||||
@grep -E '(^[a-zA-Z0-9_%-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
|
||||
@cat $(MAKEFILE_LIST) | grep -E '(^[a-zA-Z0-9_%-]+:.*?##.*$$)|(^##)' | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
|
||||
@echo ""
|
||||
@echo "Environment:"
|
||||
@grep -E '^[a-zA-Z0-9_-]+\s*[?:]?=.*$$' $(MAKEFILE_LIST) | grep -Eo '^[a-zA-Z0-9_-]+' | xargs -I {} make -s print-{}
|
||||
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z0-9_-]+\s*\??=.*$$' | grep -Eo '^[a-zA-Z0-9_-]+' | xargs -I {} $(MAKE) -s print-{} 2> /dev/null
|
||||
|
||||
.PHONY: print-%
|
||||
print-%:
|
||||
@@ -32,10 +34,18 @@ print-%:
|
||||
# FILES
|
||||
|
||||
.venv: uv.lock
|
||||
@$(UV) sync --active
|
||||
@$(MAKE) -s uv-sync
|
||||
|
||||
# TOOLS
|
||||
|
||||
.PHONY: uv-sync
|
||||
uv-sync: ## uv sync
|
||||
@$(UV) sync --active
|
||||
|
||||
.PHONY: uv-update
|
||||
uv-upgrade: ## uv sync upgrade
|
||||
@$(UV) sync --active --upgrade
|
||||
|
||||
.PHONY: ruff
|
||||
ruff: .venv ## ruff check
|
||||
@$(RUFF) check
|
||||
@@ -66,6 +76,12 @@ docker-run: docker-build ## docker run
|
||||
|
||||
# ACTIONS
|
||||
|
||||
.PHONY: install
|
||||
install: uv-sync ## install project
|
||||
|
||||
.PHONY: update
|
||||
update: uv-upgrade ## update project dependencies
|
||||
|
||||
.PHONY: format
|
||||
format: ruff-fix ruff-format ## format project
|
||||
|
||||
|
||||
@@ -100,15 +100,20 @@ curl -X DELETE \
|
||||
- [x] better error page
|
||||
- [x] add favicon.ico + special path
|
||||
- [x] [http.server security](https://docs.python.org/3/library/http.server.html#http-server-security)
|
||||
- [ ] launch separate upgrade 80->443 server when https
|
||||
- [ ] token management with "generate" command and bind path to specific token
|
||||
- [ ] docker compose example + .env
|
||||
- [ ] proper doc
|
||||
|
||||
### Makefile targets
|
||||
|
||||
```txt
|
||||
Usage: make [target1] (target2) ...
|
||||
Usage: make [target1] [target2] ...
|
||||
|
||||
Commands/Targets:
|
||||
help show this message
|
||||
uv-sync uv sync
|
||||
uv-upgrade uv sync upgrade
|
||||
ruff ruff check
|
||||
ruff-fix ruff check (and fix)
|
||||
ruff-format ruff format
|
||||
@@ -116,8 +121,11 @@ ruff-format-check ruff format (check only)
|
||||
ty ty check
|
||||
docker-build docker build
|
||||
docker-run docker run
|
||||
install install project
|
||||
update update project dependencies
|
||||
format format project
|
||||
lint lint project
|
||||
build build project
|
||||
start start server in localhost
|
||||
|
||||
Environment:
|
||||
|
||||
Reference in New Issue
Block a user