12
12
# - Fallback values using ?=, see below:
13
13
DOCKER_IMAGE_NAME? =zeusops-bot
14
14
DOCKER_REGISTRY? =
15
- APP_VERSION? =$(shell poetry version --short)
15
+ APP_VERSION? =$(shell uvx dunamai from git | sed 's/+/-/g')
16
+
16
17
17
18
# # Default command, run via 'make' or 'make all'
18
19
.PHONY : all
31
32
# # Set up the virtualenv and install the package + dependencies
32
33
.PHONY : install
33
34
install :
34
- poetry install
35
+ uv sync --all-extras
35
36
36
37
# # Run the linters and formatters on all files (not just staged for commit)
37
38
.PHONY : lint
@@ -41,17 +42,18 @@ lint:
41
42
# # Run the tests
42
43
.PHONY : test
43
44
test :
44
- poetry run pytest
45
+ uv run --all-extras pytest
45
46
46
47
# # Generate the docs, both HTML and docsets
47
48
.PHONY : docs
48
49
docs :
49
50
cd docs && make html
50
- poetry run doc2dash \
51
- --force \
52
- --name zeusops-bot \
53
- docs/build/html \
54
- --destination docs/build/docset
51
+ uv run --all-extras \
52
+ doc2dash \
53
+ --force \
54
+ --name zeusops-bot \
55
+ docs/build/html \
56
+ --destination docs/build/docset
55
57
56
58
# # Serve the generated docs on a port of localhost
57
59
.PHONY : docs-serve
@@ -61,7 +63,7 @@ docs-serve:
61
63
# # Build the wheel/tarball package
62
64
.PHONY : build
63
65
build :
64
- poetry build
66
+ uv build
65
67
66
68
# # Set up the pre-commit hooks to execute on next git commit
67
69
.PHONY : install-hooks
@@ -82,55 +84,48 @@ docker-build-dev:
82
84
docker build -t ${DOCKER_IMAGE_NAME} -dev .
83
85
84
86
# # Make a release commit + tag, creating Changelog entry
85
- # # Set BUMP variable to any of poetry-supported (major, minor, patch)
86
- # # or number (1.2.3 etc), see 'poetry version' docs for details
87
+ # # Set BUMP variable to any of uv-supported (major, minor, patch)
87
88
# # Default the bump to a patch (v1.2.3 -> v1.2.4)
88
89
BUMP =patch
89
90
.PHONY : release
90
91
release :
91
92
# Set the new version Makefile variable after the version bump
92
- $(eval NEW_VERSION := $(shell poetry version --short ${BUMP}))
93
+ $(eval NEW_VERSION := $(shell uv version --short --dry-run --bump ${BUMP}))
93
94
$(eval TMP_CHANGELOG := $(shell mktemp))
94
- sed \
95
- "s/ \(# # \[Unreleased\]\)/ \1\n\n## v${NEW_VERSION} - $(shell date +%Y-%m-%d)/ " \
95
+ @ sed \
96
+ "s; \(# # \[Unreleased\]\); \1\n\n## v${NEW_VERSION} - $(shell date +%Y-%m-%d); " \
96
97
CHANGELOG.md > ${TMP_CHANGELOG}
97
- mv --force ${TMP_CHANGELOG} CHANGELOG.md
98
- git add CHANGELOG.md pyproject.toml
98
+ @ mv --force ${TMP_CHANGELOG} CHANGELOG.md
99
+ git add CHANGELOG.md
99
100
git commit -m "Bump to version v${NEW_VERSION}"
100
101
git tag --annotate "v${NEW_VERSION}" \
101
102
--message "Release v${NEW_VERSION}"
102
103
103
104
# # Less commonly used commands
104
105
105
- # # Generate/update the poetry .lock file
106
+ # # Generate/update the uv .lock file
106
107
.PHONY : lock
107
108
lock :
108
- poetry lock --no-update
109
+ uv lock
109
110
110
111
# # Update dependencies (within pyproject.toml specs)
111
112
# # Update the lock-file at the same time
112
113
.PHONY : update
113
114
update :
114
- poetry update --lock
115
+ uv lock --upgrade
116
+
115
117
116
- # # Install tools (poetry , pre-commit) via pipx
118
+ # # Install tools (uv , pre-commit) via pipx
117
119
# # Assumes you have pipx installed
118
120
# See https://jiby.tech/post/my-python-toolbox/#pipx-for-cli-installs-not-pip
119
121
.PHONY : install-tools
120
122
install-tools :
121
- pipx install poetry
122
- pipx install pre-commit
123
-
124
- # # Ensure Poetry will generate virtualenv inside the git repo /.venv/
125
- # # rather than in a centralized location. This makes it possible to
126
- # # manipulate venv more simply
127
- .PHONY : poetry-venv-local
128
- poetry-venv-local :
129
- poetry config virtualenvs.in-project true
123
+ uv self version
124
+ uv tool install uv-dynamic-versioning
125
+ uv tool install pre-commit
130
126
131
127
# # Delete the virtualenv to clean dependencies
132
128
# # Useful when switching to a branch with less dependencies
133
- # # Requires the virtualenv to be local (see "poetry-venv-local")
134
- .PHONY : poetry-venv-nuke
135
- poetry-venv-nuke :
129
+ .PHONY : venv-nuke
130
+ venv-nuke :
136
131
find .venv -delete
0 commit comments