chore: update TODO and add uv targets
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
# ENV
|
# ENV
|
||||||
|
|
||||||
UV ?= uv
|
ifeq (,$(shell which uv))
|
||||||
|
ifeq (,$(shell python3 -m uv --help||python3 -m pip install --user uv)) # detect uv install
|
||||||
ifeq (, $(shell which uv))
|
UV ?= false
|
||||||
|
endif
|
||||||
UV ?= python3 -m uv
|
UV ?= python3 -m uv
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
UV ?= uv
|
||||||
RUFF ?= $(UV) run --active ruff
|
RUFF ?= $(UV) run --active ruff
|
||||||
TY ?= $(UV) run --active ty
|
TY ?= $(UV) run --active ty
|
||||||
DOCKER ?= docker
|
DOCKER ?= docker
|
||||||
@@ -17,13 +19,13 @@ PORT ?= 8080
|
|||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help: ## show this message
|
help: ## show this message
|
||||||
@echo "Usage: make [target1] (target2) ..."
|
@echo "Usage: $(MAKE) [target1] [target2] ..."
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Commands/Targets:"
|
@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 ""
|
||||||
@echo "Environment:"
|
@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-%
|
.PHONY: print-%
|
||||||
print-%:
|
print-%:
|
||||||
@@ -32,10 +34,18 @@ print-%:
|
|||||||
# FILES
|
# FILES
|
||||||
|
|
||||||
.venv: uv.lock
|
.venv: uv.lock
|
||||||
@$(UV) sync --active
|
@$(MAKE) -s uv-sync
|
||||||
|
|
||||||
# TOOLS
|
# 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
|
.PHONY: ruff
|
||||||
ruff: .venv ## ruff check
|
ruff: .venv ## ruff check
|
||||||
@$(RUFF) check
|
@$(RUFF) check
|
||||||
@@ -66,6 +76,12 @@ docker-run: docker-build ## docker run
|
|||||||
|
|
||||||
# ACTIONS
|
# ACTIONS
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install: uv-sync ## install project
|
||||||
|
|
||||||
|
.PHONY: update
|
||||||
|
update: uv-upgrade ## update project dependencies
|
||||||
|
|
||||||
.PHONY: format
|
.PHONY: format
|
||||||
format: ruff-fix ruff-format ## format project
|
format: ruff-fix ruff-format ## format project
|
||||||
|
|
||||||
|
|||||||
@@ -100,15 +100,20 @@ curl -X DELETE \
|
|||||||
- [x] better error page
|
- [x] better error page
|
||||||
- [x] add favicon.ico + special path
|
- [x] add favicon.ico + special path
|
||||||
- [x] [http.server security](https://docs.python.org/3/library/http.server.html#http-server-security)
|
- [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
|
- [ ] proper doc
|
||||||
|
|
||||||
### Makefile targets
|
### Makefile targets
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
Usage: make [target1] (target2) ...
|
Usage: make [target1] [target2] ...
|
||||||
|
|
||||||
Commands/Targets:
|
Commands/Targets:
|
||||||
help show this message
|
help show this message
|
||||||
|
uv-sync uv sync
|
||||||
|
uv-upgrade uv sync upgrade
|
||||||
ruff ruff check
|
ruff ruff check
|
||||||
ruff-fix ruff check (and fix)
|
ruff-fix ruff check (and fix)
|
||||||
ruff-format ruff format
|
ruff-format ruff format
|
||||||
@@ -116,8 +121,11 @@ ruff-format-check ruff format (check only)
|
|||||||
ty ty check
|
ty ty check
|
||||||
docker-build docker build
|
docker-build docker build
|
||||||
docker-run docker run
|
docker-run docker run
|
||||||
|
install install project
|
||||||
|
update update project dependencies
|
||||||
format format project
|
format format project
|
||||||
lint lint project
|
lint lint project
|
||||||
|
build build project
|
||||||
start start server in localhost
|
start start server in localhost
|
||||||
|
|
||||||
Environment:
|
Environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user