10
10
# #
11
11
12
12
# # Source location
13
- MODULE_BASE_DIR = example
13
+ MODULE_BASE_DIR = src/ example
14
14
TESTS_BASE_DIR = tests
15
15
16
16
# # Pythonic variables
@@ -69,11 +69,11 @@ PYENV ?= pyenv
69
69
CURRENT_PYTHON ?= python3
70
70
PRECOMMIT ?= pre-commit
71
71
POETRY ?= $(FLAGS ) poetry
72
- PERU ?= $(POETRY ) run peru
73
- RUFF ?= $(POETRY ) run ruff
74
- BLACK ?= $(POETRY ) run black
75
- MYPY ?= $(POETRY ) run mypy
76
- PYTEST ?= $(POETRY ) run pytest
72
+ UV ?= $(FLAGS ) uv
73
+ PERU ?= $(UV ) run peru
74
+ RUFF ?= $(UV ) run ruff
75
+ MYPY ?= $(UV ) run mypy
76
+ PYTEST ?= $(UV ) run pytest
77
77
78
78
# ##
79
79
# ## TASKS
@@ -151,10 +151,10 @@ format-py: ## Runs formatter, makes changes where necessary
151
151
# #@ Building and Publishing
152
152
153
153
.PHONY : build
154
- build : poetry -build # # Build an artifact
154
+ build : uv -build # # Build an artifact
155
155
156
156
.PHONY : publish
157
- publish : poetry -publish # # Publish an artifact
157
+ publish : uv -publish # # Publish an artifact
158
158
159
159
160
160
# #@ Manual Setup
@@ -197,10 +197,10 @@ install-poetry: ## Installs Poetry to the current Python environment
197
197
deps : deps-brew deps-py $(DEPS_TASKS_IF_PERU_CONFIG ) install-precommit # # Installs all dependencies
198
198
@echo " $( COLOR_GREEN) All deps installed!$( COLOR_RESET) "
199
199
.PHONY : deps-py
200
- deps-py : install-python $(POETRY_TASK ) poetry-use-pyenv poetry -install # # Install Python-based dependencies
200
+ deps-py : install-python $(POETRY_TASK ) poetry-use-pyenv uv -install # # Install Python-based dependencies
201
201
@echo " $( COLOR_GREEN) All Python deps installed!$( COLOR_RESET) "
202
202
.PHONY : deps-py-update
203
- deps-py-update : poetry -update # # Update Poetry deps, e.g. after adding a new one manually
203
+ deps-py-update : uv -update # # Update Python deps, e.g. after adding a new one manually
204
204
@echo " $( COLOR_GREEN) All Python deps updated!$( COLOR_RESET) "
205
205
206
206
COLOR_ORANGE = \033[33m
@@ -261,23 +261,23 @@ $(PYTHON_EXEC): $(PYTHON_VERSION_FILE)
261
261
$(PYENV_FLAGS) $(PYENV) install --verbose --skip-existing "$${py}" ; \
262
262
done
263
263
264
- # #@ Poetry
264
+ # #@ uv
265
265
266
- .PHONY : poetry -install
267
- poetry -install : # # Run poetry install with any environment-required flags
268
- $(POETRY ) install
266
+ .PHONY : uv -install
267
+ uv -install : # # Run uv install with any environment-required flags
268
+ $(UV ) sync --locked
269
269
270
- .PHONY : poetry -update
271
- poetry -update : # # Run poetry update with any environment-required flags, pass PKGS=pkg to update only pkg
272
- time $(POETRY ) update -v $(PKGS )
270
+ .PHONY : uv -update
271
+ uv -update : # # Run uv update with any environment-required flags
272
+ time $(UV ) lock --upgrade $(PKGS )
273
273
274
274
.PHONY : poetry-relock
275
- poetry -relock : pyproject.toml # # Run poetry lock w/o updating deps, use after changing pyproject.toml trivially
276
- $(POETRY ) lock --no-update
275
+ uv -relock : pyproject.toml # # Run uv lock w/o updating deps, use after changing pyproject.toml trivially
276
+ $(POETRY ) lock
277
277
278
- .PHONY : poetry -build
279
- poetry -build : poetry -set-version # # Run poetry build with any environment-required flags
280
- $(POETRY ) build
278
+ .PHONY : uv -build
279
+ uv -build : uv -set-version # # Run uv build with any environment-required flags
280
+ $(UV ) build
281
281
282
282
# For release builds, pass this into poetry-set-version-from-git, e.g. ARTIFACT_VERSION=${CI_BUILD_TAG}
283
283
ifndef ARTIFACT_VERSION
0 commit comments