Skip to content

Commit c76a952

Browse files
committed
Makefile: create the venv via python3 -m venv (installing virtualenv via pip fails on e.g. Ubuntu 24.04, PEP 668)
1 parent 0298185 commit c76a952

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to AI coding agents when working with code in this r
44

55
## Commands
66

7-
All `make` targets use (and create if needed) the virtualenv in `.venv` from `requirements.txt`.
7+
All `make` targets use (and create if needed, via `python3 -m venv`) the virtual environment in `.venv` from `requirements.txt`.
88

99
- `make depend` — set up venv and download the ObjectBox C shared libraries (`download-c-lib.py`) into `objectbox_clib/lib/<arch>/`. Required once after checkout and whenever the C library version changes.
1010
- `make depend-sync` — download the Sync variant of the C libraries into `objectbox_sync_clib/lib/<arch>/`; if present, it is loaded instead (needed for the Sync tests).

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ platform) which actually implements the database functionality. The library shou
2929
#### Initial setup
3030
If you're just getting started, run the following simple steps to set up the repository on your machine
3131
* clone this repository
32-
* `make depend` to initialize `virtualenv` and get dependencies (objectbox-c shared library)
32+
* `make depend` to create a virtual environment (`.venv`) and get dependencies (objectbox-c shared library);
33+
on Debian/Ubuntu, this requires the `python3-venv` package
3334
* `make` to build and test
3435

3536
You can also run `make help` to see all available options.

‎Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ build-sync: ${VENV} ## Build objectbox-sync-clib wheels and the objectbox-sync
4040
${VENV}: ${VENVBIN}/activate
4141

4242
venv-init:
43-
${PIP} install --user virtualenv
44-
${PYTHON} -m virtualenv ${VENV}
43+
@# venv is part of Python; pip/setuptools/wheel come from requirements.txt (e.g. venv has no setuptools since 3.12)
44+
${PYTHON} -m venv ${VENV} || { echo "Creating ${VENV} failed; on Debian/Ubuntu, install python3-venv" ; exit 1 ; }
4545

4646
# remove packages not in the requirements.txt
4747
# install and upgrade based on the requirements.txt

0 commit comments

Comments
 (0)