Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ce72461

Browse filesBrowse files
committed
Enables make deps check test with uv
1 parent 78e9650 commit ce72461
Copy full SHA for ce72461

File tree

4 files changed

+977
-73
lines changed
Filter options

4 files changed

+977
-73
lines changed

‎Makefile

Copy file name to clipboardExpand all lines: Makefile
+22-22Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
##
1111

1212
## Source location
13-
MODULE_BASE_DIR = example
13+
MODULE_BASE_DIR = src/example
1414
TESTS_BASE_DIR = tests
1515

1616
## Pythonic variables
@@ -69,11 +69,11 @@ PYENV ?= pyenv
6969
CURRENT_PYTHON ?= python3
7070
PRECOMMIT ?= pre-commit
7171
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
7777

7878
###
7979
### TASKS
@@ -151,10 +151,10 @@ format-py: ## Runs formatter, makes changes where necessary
151151
##@ Building and Publishing
152152

153153
.PHONY: build
154-
build: poetry-build ## Build an artifact
154+
build: uv-build ## Build an artifact
155155

156156
.PHONY: publish
157-
publish: poetry-publish ## Publish an artifact
157+
publish: uv-publish ## Publish an artifact
158158

159159

160160
##@ Manual Setup
@@ -197,10 +197,10 @@ install-poetry: ## Installs Poetry to the current Python environment
197197
deps: deps-brew deps-py $(DEPS_TASKS_IF_PERU_CONFIG) install-precommit ## Installs all dependencies
198198
@echo "$(COLOR_GREEN)All deps installed!$(COLOR_RESET)"
199199
.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
201201
@echo "$(COLOR_GREEN)All Python deps installed!$(COLOR_RESET)"
202202
.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
204204
@echo "$(COLOR_GREEN)All Python deps updated!$(COLOR_RESET)"
205205

206206
COLOR_ORANGE = \033[33m
@@ -261,23 +261,23 @@ $(PYTHON_EXEC): $(PYTHON_VERSION_FILE)
261261
$(PYENV_FLAGS) $(PYENV) install --verbose --skip-existing "$${py}" ; \
262262
done
263263

264-
##@ Poetry
264+
##@ uv
265265

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
269269

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)
273273

274274
.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
277277

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
281281

282282
# For release builds, pass this into poetry-set-version-from-git, e.g. ARTIFACT_VERSION=${CI_BUILD_TAG}
283283
ifndef ARTIFACT_VERSION

‎pyproject.toml

Copy file name to clipboardExpand all lines: pyproject.toml
+31-51Lines changed: 31 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,44 @@
1-
[build-system]
2-
requires = ["poetry-core"]
3-
build-backend = "poetry.core.masonry.api"
4-
5-
[tool.poetry]
1+
[project]
2+
authors = [
3+
{name = "Colin Dean", email = "c.o.l.i.n.d.e.a.n@example.com"},
4+
]
5+
license = {text = "CC0"}
6+
requires-python = "<3.14,>=3.9"
7+
dependencies = [
8+
"retry2<1.0,>=0.9",
9+
"deprecated<2.0,>=1.2",
10+
"loguru",
11+
]
612
name = "example"
713
version = "0.0.0"
814
description = "This is a demonstration of the Make Python Devex concept project"
9-
authors = ["Colin Dean <c.o.l.i.n.d.e.a.n@example.com>"]
10-
license = "CC0"
1115
readme = "README.md"
1216

13-
[tool.poetry.scripts]
17+
[project.scripts]
1418
example-make-python-devex = "example:main"
1519

16-
[tool.poetry.dependencies]
17-
# set Python constraints
18-
python = ">=3.9,<3.14"
19-
## commonly used libraries
20-
# retry failing method calls
21-
retry2 = "^0.9"
22-
# mark things as deprecated
23-
deprecated = "^1.2"
24-
# simple logging that just works
25-
loguru = "*"
26-
27-
[tool.poetry.group.dev.dependencies]
28-
# test framework
29-
pytest = "^8"
30-
# html output
31-
pytest-html = "*"
32-
# necessary for best html output
33-
ansi2html = "*"
34-
# Test Anything Protocol output
35-
pytest-tap = "*"
36-
# coverage.py integration
37-
pytest-cov = "*"
38-
# opinionated code formatter
39-
black = ">=22"
40-
# type hints checker
41-
mypy = { version = "*", extras = ["faster-cache"] }
42-
# xml library, used for outputting HTML reports from mypy, etc.
43-
lxml = "*"
44-
# lightning fast linter and style checker
45-
ruff = "*"
46-
# universal dependency retriver
47-
peru = "*"
20+
[dependency-groups]
21+
dev = [
22+
"pytest<9,>=8",
23+
"pytest-html",
24+
"ansi2html",
25+
"pytest-tap",
26+
"pytest-cov",
27+
"black>=22",
28+
"mypy[faster-cache]",
29+
"lxml",
30+
"ruff",
31+
"peru",
32+
"types-Deprecated",
33+
"types-retry",
34+
]
4835

49-
## types packages
50-
types-Deprecated = "*"
51-
types-retry = "*"
5236

37+
[tool.uv]
38+
package = true
5339

54-
## Configure publish destination explicitly, for safety
55-
## Default is PyPI but you probably don't want to do that internally.
56-
## See also https://python-poetry.org/docs/repositories/#publishable-repositories
57-
[[tool.poetry.source]]
58-
name = "publish-source"
59-
url = "https://pypi.example.com/pypi/example-repo"
60-
# url = "https://pypi.org/simple/"
61-
priority = "explicit"
40+
[tool.uv.workspace]
41+
members = ["example"]
6242

6343
###
6444
# Below here are rarely-touched settings for the various tools used in this project.
File renamed without changes.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.