Skip to content

Commit d899675

Browse files
Merge upstream/claude/upgrade-adapted-type-1W3ap into spec-issue-1243-YvqmF
Resolved conflicts: - jobs.py: Keep AutoPopulate 2.0 JobsTable implementation, add config import - schemas.py: Keep _auto_populated_tables tracking, remove non-existent ExternalMapping - conftest.py: Use simpler fixtures from upgrade-adapted-type branch, add DataJointError import 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2 parents 4a43f50 + d51c16e commit d899675

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4473
-2101
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-18",
3-
"features": {
4-
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
5-
},
2+
"dockerComposeFile": ["../docker-compose.yaml", "docker-compose.yml"],
3+
"service": "app",
4+
"workspaceFolder": "/src",
65
"postCreateCommand": "curl -fsSL https://pixi.sh/install.sh | bash && echo 'export PATH=\"$HOME/.pixi/bin:$PATH\"' >> ~/.bashrc"
7-
}
6+
}

.devcontainer/docker-compose.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
1+
# Devcontainer overrides for the app service from ../docker-compose.yaml
2+
# Inherits db and minio services automatically
13
services:
2-
# Update this to the name of the service you want to work with in your docker-compose.yml file
34
app:
4-
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
5-
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
6-
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
7-
# array). The sample below assumes your primary file is in the root of your project.
85
container_name: datajoint-python-devcontainer
9-
image: datajoint/datajoint-python-devcontainer:${PY_VER:-3.11}-${DISTRO:-bookworm}
106
build:
11-
context: .
7+
context: ..
128
dockerfile: .devcontainer/Dockerfile
139
args:
1410
- PY_VER=${PY_VER:-3.11}
1511
- DISTRO=${DISTRO:-bookworm}
16-
17-
volumes:
18-
# Update this to wherever you want VS Code to mount the folder of your project
19-
- ..:/workspaces:cached
20-
21-
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
22-
# cap_add:
23-
# - SYS_PTRACE
24-
# security_opt:
25-
# - seccomp:unconfined
26-
2712
user: root
28-
29-
# Overrides default command so things don't shut down after the process ends.
13+
# Keep container running for devcontainer
3014
command: /bin/sh -c "while sleep 1000; do :; done"

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,66 @@ DataJoint (<https://datajoint.com>).
141141
- [Contribution Guidelines](https://docs.datajoint.com/about/contribute/)
142142

143143
- [Developer Guide](https://docs.datajoint.com/core/datajoint-python/latest/develop/)
144+
145+
## Developer Guide
146+
147+
### Prerequisites
148+
149+
- [Docker](https://docs.docker.com/get-docker/) for running MySQL and MinIO services
150+
- [pixi](https://prefix.dev/docs/pixi/overview) package manager (or pip/conda)
151+
152+
### Setting Up the Development Environment
153+
154+
1. Clone the repository and install dependencies:
155+
156+
```bash
157+
git clone https://github.com/datajoint/datajoint-python.git
158+
cd datajoint-python
159+
pixi install
160+
```
161+
162+
2. Start the required services (MySQL and MinIO):
163+
164+
```bash
165+
docker compose up -d db minio
166+
```
167+
168+
### Running Tests
169+
170+
Run tests with pytest using the test environment:
171+
172+
```bash
173+
DJ_HOST=localhost DJ_PORT=3306 S3_ENDPOINT=localhost:9000 python -m pytest tests/
174+
```
175+
176+
Or run specific test files:
177+
178+
```bash
179+
DJ_HOST=localhost DJ_PORT=3306 S3_ENDPOINT=localhost:9000 python -m pytest tests/test_blob.py -v
180+
```
181+
182+
### Running Pre-commit Checks
183+
184+
Pre-commit hooks ensure code quality before commits. Install and run them:
185+
186+
```bash
187+
# Install pre-commit hooks
188+
pre-commit install
189+
190+
# Run all pre-commit checks manually
191+
pre-commit run --all-files
192+
193+
# Run specific hooks
194+
pre-commit run ruff --all-files
195+
pre-commit run mypy --all-files
196+
```
197+
198+
### Environment Variables
199+
200+
| Variable | Default | Description |
201+
|----------|---------|-------------|
202+
| `DJ_HOST` | `localhost` | MySQL server hostname |
203+
| `DJ_PORT` | `3306` | MySQL server port |
204+
| `DJ_USER` | `datajoint` | MySQL username |
205+
| `DJ_PASS` | `datajoint` | MySQL password |
206+
| `S3_ENDPOINT` | `localhost:9000` | MinIO/S3 endpoint |

docker-compose.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Development environment with MySQL and MinIO services
2-
# To run tests: pytest --cov-report term-missing --cov=datajoint tests
2+
# Start services: docker-compose up -d db minio
3+
# Run tests: pixi run test
34
services:
45
db:
56
image: datajoint/mysql:${MYSQL_VER:-8.0}
67
environment:
78
- MYSQL_ROOT_PASSWORD=${DJ_PASS:-password}
89
command: mysqld --default-authentication-plugin=mysql_native_password
9-
# ports:
10-
# - "3306:3306"
11-
# volumes:
12-
# - ./mysql/data:/var/lib/mysql
10+
ports:
11+
- "3306:3306"
1312
healthcheck:
1413
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
1514
timeout: 30s
@@ -20,18 +19,15 @@ services:
2019
environment:
2120
- MINIO_ACCESS_KEY=datajoint
2221
- MINIO_SECRET_KEY=datajoint
23-
# ports:
24-
# - "9000:9000"
25-
# volumes:
26-
# - ./minio/config:/root/.minio
27-
# - ./minio/data:/data
22+
ports:
23+
- "9000:9000"
2824
command: server --address ":9000" /data
2925
healthcheck:
3026
test:
3127
- "CMD"
3228
- "curl"
3329
- "--fail"
34-
- "http://minio:9000/minio/health/live"
30+
- "http://localhost:9000/minio/health/live"
3531
timeout: 30s
3632
retries: 5
3733
interval: 15s

0 commit comments

Comments
 (0)