Skip to content

Commit d8b74f2

Browse files
committed
fixed ./dev to use uv fully
1 parent 6df6232 commit d8b74f2

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

dev

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function version() {
9595

9696
function versions() {
9797
info "versions"
98-
info "$(python --version)"
98+
# info "$(python --version)" <- not necessarily the uv python
9999
info "$(uv --version)"
100100
if ! command -v docker > /dev/null 2>&1; then
101101
warn "docker not found, skipping docker version"
@@ -161,7 +161,7 @@ function start() {
161161
function celery() {
162162
docker compose up -d redis
163163
DJANGO_SETTINGS_MODULE="${DJANGO_SETTINGS_MODULE:-"fl_server.settings.development"}" \
164-
python -m celery --workdir "${PROJECT_ROOT_ABSOLUTE}" --app fl_server_ai worker --loglevel=INFO
164+
uv run celery --workdir "${PROJECT_ROOT_ABSOLUTE}" --app fl_server_ai worker --loglevel=INFO
165165
}
166166

167167
function migrate() {
@@ -234,7 +234,7 @@ function test() {
234234
coverage-report
235235
if [ "${HTTP_SERVE}" = "true" ]; then
236236
if [ -d "${BUILD_ROOT}/htmlcov" ]; then
237-
python -m http.server --directory "${BUILD_ROOT}/htmlcov" 8080
237+
uv run http.server --directory "${BUILD_ROOT}/htmlcov" 8080
238238
else
239239
error "no coverage report found"
240240
exit 1
@@ -252,12 +252,12 @@ function lint() {
252252

253253
function lint-code() {
254254
info "lint code"
255-
info "flake8 version: $(python -m flake8 --version | xargs)"
256-
python -m flake8 "${SOURCE_CORE}"
257-
python -m flake8 "${SOURCE_API}"
258-
python -m flake8 "${SOURCE_AI}"
259-
python -m flake8 "${SOURCE_DJANGO}"
260-
python -m flake8 "${SCRIPTS_ROOT}"
255+
info "flake8 version: $(uv run flake8 --version | xargs)"
256+
uv run flake8 "${SOURCE_CORE}"
257+
uv run flake8 "${SOURCE_API}"
258+
uv run flake8 "${SOURCE_AI}"
259+
uv run flake8 "${SOURCE_DJANGO}"
260+
uv run flake8 "${SCRIPTS_ROOT}"
261261
}
262262

263263
function lint-doc() {
@@ -276,32 +276,32 @@ function lint-scripts() {
276276

277277
function mypy() {
278278
info "type checking"
279-
python -m mypy "${SOURCE_CORE}"
280-
python -m mypy "${SOURCE_API}"
281-
python -m mypy "${SOURCE_AI}"
282-
python -m mypy "${SOURCE_DJANGO}"
279+
uv run mypy "${SOURCE_CORE}"
280+
uv run mypy "${SOURCE_API}"
281+
uv run mypy "${SOURCE_AI}"
282+
uv run mypy "${SOURCE_DJANGO}"
283283
if find "${SCRIPTS_ROOT}" -type f -name "*.py" | grep -q .; then
284-
python -m mypy "${SCRIPTS_ROOT}"
284+
uv run mypy "${SCRIPTS_ROOT}"
285285
fi
286286
}
287287

288288
function coverage() {
289289
info "run python tests with coverage"
290290
# TODO should we start the DB here (docker compose up db -d) or better not?
291-
python -m coverage run manage.py test
292-
python -m coverage html --directory "${BUILD_ROOT}/htmlcov"
291+
uv run coverage run manage.py test
292+
uv run coverage html --directory "${BUILD_ROOT}/htmlcov"
293293
}
294294

295295
function coverage-report() {
296296
info "print test coverage report"
297-
python -m coverage report
297+
uv run coverage report
298298
}
299299

300300
function doc() {
301301
versions
302302
info
303-
mkdocs_version="$(python -m mkdocs --version)"
304-
info "${mkdocs_version#"python -m "}"
303+
mkdocs_version="$(uv run mkdocs --version)"
304+
info "${mkdocs_version#"uv run "}"
305305
# check if the user has passed the --dirtyreload flag
306306
dirty_flag=false
307307
for value in "$@"; do
@@ -315,30 +315,30 @@ function doc() {
315315
# create and serve documentation
316316
DJANGO_SETTINGS_MODULE="${DJANGO_SETTINGS_MODULE:-"fl_server.settings.production"}" \
317317
FL_DJANGO_SECRET_KEY="${FL_DJANGO_SECRET_KEY:-}" FL_POSTGRES_PASSWD="${FL_POSTGRES_PASSWD:-}" \
318-
python -m mkdocs serve "$@"
318+
uv run mkdocs serve "$@"
319319
}
320320

321321
function doc-build() {
322322
versions
323-
mkdocs_version="$(python -m mkdocs --version)"
324-
info "${mkdocs_version#"python -m "}"
323+
mkdocs_version="$(uv run mkdocs --version)"
324+
info "${mkdocs_version#"uv run "}"
325325
info "build documentation"
326326
DJANGO_SETTINGS_MODULE="${DJANGO_SETTINGS_MODULE:-"fl_server.settings.production"}" \
327327
FL_DJANGO_SECRET_KEY="${FL_DJANGO_SECRET_KEY:-}" FL_POSTGRES_PASSWD="${FL_POSTGRES_PASSWD:-}" \
328-
python -m mkdocs build "$@"
328+
uv run mkdocs build "$@"
329329
}
330330

331331
function licenses() {
332332
info "search for license conflicts"
333333
licensecheck
334334
info "search for non-compliant files with REUSE"
335-
python -m reuse lint
335+
uv run reuse lint
336336
}
337337

338338
function safety-check() {
339339
info "check dependencies for known security vulnerabilities"
340340
# main only no dev dependencies etc.
341-
python -m tox --recreate -e safety
341+
uv run tox --recreate -e safety
342342
# alternative
343343
#uv pip install -U safety
344344
#safety check

0 commit comments

Comments
 (0)