@@ -5,15 +5,11 @@ SHELL := /bin/bash
55
66.DEFAULT_GOAL: =help
77.ONESHELL :
8- USING_PDM = $(shell grep "tool.pdm" pyproject.toml && echo "yes")
98USING_NPM = $(shell python3 -c "if __import__('pathlib') .Path('package-lock.json').exists(): print('yes')")
109ENV_PREFIX =.venv/bin/
11- VENV_EXISTS = $(shell python3 -c "if __import__('pathlib') .Path('.venv/bin/activate').exists(): print('yes')")
1210NODE_MODULES_EXISTS = $(shell python3 -c "if __import__('pathlib') .Path('node_modules').exists(): print('yes')")
1311SRC_DIR =src
1412BUILD_DIR =dist
15- PDM_OPTS ?=
16- PDM ?= pdm $(PDM_OPTS )
1713
1814.EXPORT_ALL_VARIABLES :
1915
@@ -30,43 +26,28 @@ help: ## Display this help text for Makefile
3026.PHONY : upgrade
3127upgrade : # # Upgrade all dependencies to the latest stable versions
3228 @echo " => Updating all dependencies"
33- @if [ " $( USING_PDM ) " ] ; then $( PDM ) update ; fi
29+ @uv lock --upgrade
3430 @echo " => Python Dependencies Updated"
3531 @if [ " $( USING_NPM) " ]; then npm upgrade --latest; fi
3632 @echo " => Node Dependencies Updated"
3733 @$(ENV_PREFIX ) pre-commit autoupdate
3834 @echo " => Updated Pre-commit"
3935
40- .PHONY : uninstall
41- uninstall :
42- @echo " => Uninstalling PDM"
43- ifeq ($(OS ) ,Windows_NT)
44- @echo "=> Removing PDM from %APPDATA%\Python\Scripts"
45- @if exist "%APPDATA%\Python\Scripts\pdm" (del "%APPDATA%\Python\Scripts\pdm")
46- else
47- @echo "=> Removing PDM from ~/.local/bin"
48- @rm -f ~/.local/bin/pdm
49- endif
50- @echo "=> PDM removal complete"
51- @echo "=> Uninstallation complete!"
52-
5336# =============================================================================
5437# Developer Utils
5538# =============================================================================
56- install-pdm : # # Install latest version of PDM
57- @curl -sSLO https://pdm.fming.dev/install-pdm.py && \
58- curl -sSL https://pdm.fming.dev/install-pdm.py.sha256 | shasum -a 256 -c - && \
59- python3 install-pdm.py
39+ .PHONY : install-uv
40+ install-uv : # # Install latest version of uv
41+ @echo " ${INFO} Installing uv..."
42+ @curl -LsSf https://astral.sh/uv/install.sh | sh > /dev/null 2>&1
43+ @uv tool install nodeenv > /dev/null 2>&1
44+ @echo " ${OK} UV installed successfully"
6045
6146install : # # Install the project and
62- @if ! $(PDM ) --version > /dev/null; then echo ' => Installing PDM' ; $(MAKE ) install-pdm; fi
63- @if [ " $( VENV_EXISTS) " ]; then echo " => Removing existing virtual environment" ; fi
64- if [ " $( VENV_EXISTS) " ]; then $( MAKE) destroy-venv; fi
65- if [ " $( VENV_EXISTS) " ]; then $( MAKE) clean; fi
47+ @uv sync
48+ uv run python scripts/pre-build.py --install-packages
6649 @if [ " $( NODE_MODULES_EXISTS) " ]; then echo " => Removing existing node modules" ; fi
6750 if [ " $( NODE_MODULES_EXISTS) " ]; then $( MAKE) destroy-node_modules; fi
68- @if [ " $( USING_PDM) " ]; then $(PDM ) config venv.in_project true && python3 -m venv --copies .venv && . $(ENV_PREFIX ) /activate && $(ENV_PREFIX ) /pip install --quiet -U wheel setuptools cython pip mypy nodeenv; fi
69- @if [ " $( USING_PDM) " ]; then $(PDM ) install -G:all; fi
7051 @echo " => Install complete! Note: If you want to re-install re-run 'make install'"
7152
7253
@@ -105,17 +86,19 @@ migrate: ## Generate database migrations
10586.PHONY : build
10687build :
10788 @echo " => Building package..."
108- @if [ " $( USING_PDM) " ]; then pdm build; fi
89+ uv run python scripts/pre-build.py --build-assets
90+ @uv build
10991 @echo " => Package build complete..."
11092
111- .PHONY : refresh-lockfiles
112- refresh-lockfiles : # # Sync lockfiles with requirements files.
113- @pdm update --update-reuse --group :all
114-
11593.PHONY : lock
11694lock : # # Rebuild lockfiles from scratch, updating all dependencies
117- @pdm update --update-eager --group :all
95+ @uv lock
96+
97+ start-infra :
98+ docker compose -f docker-compose.infra.yml up --force-recreate -d
11899
100+ stop-infra :
101+ docker compose -f docker-compose.infra.yml down --remove-orphans
119102# =============================================================================
120103# Tests, Linting, Coverage
121104# =============================================================================
@@ -151,7 +134,7 @@ test: ## Run the tests
151134.PHONY : docs-install
152135docs-install : # # Install docs dependencies
153136 @echo " => Installing documentation dependencies"
154- @$( PDM ) install -dG: docs
137+ @uv sync --group docs
155138 @echo " => Installed documentation dependencies"
156139
157140docs-clean : # # Dump the existing built docs
@@ -161,8 +144,8 @@ docs-clean: ## Dump the existing built docs
161144
162145docs-serve : docs-clean # # Serve the docs locally
163146 @echo " => Serving documentation"
164- $( PDM_RUN_BIN ) sphinx-autobuild docs docs/_build/ -j auto --watch src --watch docs --watch tests --watch CONTRIBUTING.rst --port 8002
147+ $uv run sphinx-autobuild docs docs/_build/ -j auto --watch src --watch docs --watch tests --watch CONTRIBUTING.rst --port 8002
165148
166149docs : docs-clean # # Dump the existing built docs and rebuild them
167150 @echo " => Building documentation"
168- @$( PDM_RUN_BIN ) sphinx-build -M html docs docs/_build/ -E -a -j auto --keep-going
151+ @uv run sphinx-build -M html docs docs/_build/ -E -a -j auto --keep-going
0 commit comments