Skip to content

Commit b8e1b0f

Browse files
committed
replace pip install by uv and lock file
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent e44d30c commit b8e1b0f

4 files changed

Lines changed: 1268 additions & 27 deletions

File tree

Makefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
# See https://aboutcode.org for more information about AboutCode FOSS projects.
77
#
88

9-
PYTHON_EXE=python3.14
109
VENV_LOCATION=.venv
1110
ACTIVATE?=. ${VENV_LOCATION}/bin/activate;
1211
MANAGE=${VENV_LOCATION}/bin/python manage.py
1312
# Do not depend on Python to generate the SECRET_KEY
1413
GET_SECRET_KEY=`head -c50 /dev/urandom | base64 | head -c50`
15-
PIP_ARGS=--find-links=./thirdparty/dist/ --no-index --no-cache-dir
1614
# Customize with `$ make envfile ENV_FILE=/etc/dejacode/.env`
1715
ENV_FILE=.env
1816
DOCS_LOCATION=./docs
@@ -36,18 +34,18 @@ else
3634
endif
3735

3836
virtualenv:
39-
@echo "-> Bootstrap the virtualenv with PYTHON_EXE=${PYTHON_EXE}"
40-
${PYTHON_EXE} -m venv ${VENV_LOCATION}
37+
@echo "-> Bootstrap the virtualenv with uv"
38+
uv venv --allow-existing ${VENV_LOCATION}
4139

4240
conf: virtualenv
4341
@echo "-> Install dependencies"
44-
@${ACTIVATE} pip install ${PIP_ARGS} --editable .
42+
uv sync --frozen
4543
@echo "-> Create the var/ directory"
4644
@mkdir -p var
4745

4846
dev: virtualenv
4947
@echo "-> Configure and install development dependencies"
50-
@${ACTIVATE} pip install ${PIP_ARGS} --editable .[dev]
48+
uv sync --frozen --extra dev
5149

5250
envfile:
5351
@echo "-> Create the .env file and generate a secret key"
@@ -61,7 +59,7 @@ envfile_dev: envfile
6159

6260
doc_dependencies: virtualenv
6361
@echo "-> Configure and install documentation dependencies"
64-
@${ACTIVATE} pip install --editable .[docs]
62+
uv sync --frozen --extra dev
6563

6664
doc8:
6765
@echo "-> Run documentation .rst validation"
@@ -176,4 +174,4 @@ log:
176174
createsuperuser:
177175
${DOCKER_EXEC} web ./manage.py createsuperuser
178176

179-
.PHONY: virtualenv conf dev envfile envfile_dev doc_dependencies check doc8 valid check-deploy clean initdb postgresdb postgresdb_clean migrate upgrade run test docs build psql bash shell log createsuperuser
177+
.PHONY: virtualenv conf dev envfile envfile_dev doc_dependencies check outdated doc8 valid check-deploy clean initdb postgresdb postgresdb_clean migrate upgrade run test docs build psql bash shell log createsuperuser

etc/git_hooks/pre-commit

Lines changed: 0 additions & 14 deletions
This file was deleted.

pyproject.toml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ dev = [
167167
# Parallel testing
168168
"tblib==3.2.2"
169169
]
170-
docs = [
171-
"Sphinx",
172-
"furo",
173-
"doc8",
174-
]
170+
#docs = [
171+
# "Sphinx",
172+
# "furo",
173+
# "doc8",
174+
#]
175175

176176
[project.urls]
177177
Homepage = "https://github.com/aboutcode-org/dejacode"
@@ -186,6 +186,21 @@ dejacode = "dejacode:command_line"
186186
[tool.setuptools.packages.find]
187187
where = ["."]
188188

189+
[tool.uv]
190+
# Disable PyPI and any remote index, only use local sources
191+
no-index = true
192+
# Look for wheels in this local directory only
193+
find-links = ["./thirdparty/dist"]
194+
# Copy files instead of hardlinking, works across all filesystems
195+
link-mode = "copy"
196+
# Ignore package versions published in the last 7 days for safety
197+
exclude-newer = "7 days"
198+
# Only resolve for Linux and macOS
199+
environments = [
200+
"sys_platform == 'linux'",
201+
"sys_platform == 'darwin'",
202+
]
203+
189204
[tool.ruff]
190205
line-length = 100
191206
target-version = "py313"

0 commit comments

Comments
 (0)