@@ -100,23 +100,25 @@ Scientific data includes both structured metadata and large data objects (time s
100100# ## Prerequisites
101101
102102- [Docker](https://docs.docker.com/get-docker/) (Docker daemon must be running)
103- - Python 3.10+
103+ - [pixi](https://pixi.sh) (recommended) or Python 3.10+
104104
105- # ## Quick Start
105+ # ## Quick Start with pixi (Recommended)
106+
107+ [pixi](https://pixi.sh) manages all dependencies including Python, graphviz, and test tools:
106108
107109` ` ` bash
108- # Clone and install
110+ # Clone the repo
109111git clone https://github.com/datajoint/datajoint-python.git
110112cd datajoint-python
111- pip install -e " .[test]"
112113
113- # Run all tests (containers start automatically via testcontainers)
114- pytest tests/
114+ # Install dependencies and run tests (containers managed by testcontainers)
115+ pixi run test
115116
116- # Install and run pre-commit hooks
117- pip install pre-commit
118- pre-commit install
119- pre-commit run --all-files
117+ # Run with coverage
118+ pixi run test-cov
119+
120+ # Run pre-commit hooks
121+ pixi run pre-commit run --all-files
120122` ` `
121123
122124# ## Running Tests
@@ -126,16 +128,30 @@ Tests use [testcontainers](https://testcontainers.com/) to automatically manage
126128
127129` ` ` bash
128130# Run all tests (recommended)
129- pytest tests/
131+ pixi run test
130132
131133# Run with coverage report
132- pytest --cov-report term-missing --cov=datajoint tests/
134+ pixi run test-cov
135+
136+ # Run only unit tests (no containers needed)
137+ pixi run -e test pytest tests/unit/
133138
134139# Run specific test file
135- pytest tests/integration/test_blob.py -v
140+ pixi run -e test pytest tests/integration/test_blob.py -v
141+ ` ` `
136142
137- # Run only unit tests (no containers needed)
138- pytest tests/unit/
143+ ** macOS Docker Desktop users:** If tests fail to connect to Docker, set ` DOCKER_HOST` :
144+ ` ` ` bash
145+ export DOCKER_HOST=unix://$HOME /.docker/run/docker.sock
146+ ` ` `
147+
148+ # ## Alternative: Using pip
149+
150+ If you prefer pip over pixi:
151+
152+ ` ` ` bash
153+ pip install -e " .[test]"
154+ pytest tests/
139155` ` `
140156
141157# ## Alternative: External Containers
@@ -147,7 +163,8 @@ For development/debugging, you may prefer persistent containers that survive tes
147163docker compose up -d db minio
148164
149165# Run tests using external containers
150- DJ_USE_EXTERNAL_CONTAINERS=1 pytest tests/
166+ DJ_USE_EXTERNAL_CONTAINERS=1 pixi run test
167+ # Or with pip: DJ_USE_EXTERNAL_CONTAINERS=1 pytest tests/
151168
152169# Stop containers when done
153170docker compose down
@@ -161,31 +178,21 @@ Run tests entirely in Docker (no local Python needed):
161178docker compose --profile test up djtest --build
162179` ` `
163180
164- # ## Alternative: Using pixi
165-
166- [pixi](https://pixi.sh) users can run tests with:
167-
168- ` ` ` bash
169- pixi install # First time setup
170- pixi run test # Runs tests (testcontainers manages containers)
171- ` ` `
172-
173181# ## Pre-commit Hooks
174182
175183Pre-commit hooks run automatically on ` git commit` to check code quality.
176184** All hooks must pass before committing.**
177185
178186` ` ` bash
179187# Install hooks (first time only)
180- pip install pre-commit
181- pre-commit install
188+ pixi run pre-commit install
189+ # Or with pip: pip install pre-commit && pre-commit install
182190
183191# Run all checks manually
184- pre-commit run --all-files
192+ pixi run pre-commit run --all-files
185193
186194# Run specific hook
187- pre-commit run ruff --all-files
188- pre-commit run codespell --all-files
195+ pixi run pre-commit run ruff --all-files
189196` ` `
190197
191198Hooks include:
@@ -196,9 +203,9 @@ Hooks include:
196203
197204# ## Before Submitting a PR
198205
199- 1. ** Run all tests** : ` pytest tests/ `
200- 2. ** Run pre-commit** : ` pre-commit run --all-files`
201- 3. ** Check coverage** : ` pytest --cov-report term-missing -- cov=datajoint tests/ `
206+ 1. ** Run all tests** : ` pixi run test `
207+ 2. ** Run pre-commit** : ` pixi run pre-commit run --all-files`
208+ 3. ** Check coverage** : ` pixi run test- cov`
202209
203210# ## Environment Variables
204211
0 commit comments