Skip to content

Commit 4eb8202

Browse files
Merge branch 'claude/refine-primary-key-rules-lVgTt' into claude/review-code-organization-9135z
Merges restructured project with src/datajoint/ layout and code organization improvements including docstrings, type hints, and modern Python 3.10+ features. Co-authored-by: dimitri-yatsenko <[email protected]>
2 parents 4421e32 + 7150387 commit 4eb8202

File tree

115 files changed

+19816
-3682
lines changed

Some content is hidden

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

115 files changed

+19816
-3682
lines changed

.codespellrc

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

.devcontainer/devcontainer.json

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,7 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
31
{
4-
"name": "Existing Docker Compose (Extend)",
5-
// Update the 'dockerComposeFile' list if you have more compose files or use different names.
6-
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
7-
"dockerComposeFile": [
8-
"../docker-compose.yaml",
9-
"docker-compose.yml"
10-
],
11-
// The 'service' property is the name of the service for the container that VS Code should
12-
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
13-
"service": "app",
14-
// The optional 'workspaceFolder' property is the path VS Code should open by default when
15-
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
16-
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
17-
// Features to add to the dev container. More info: https://containers.dev/features.
18-
// "features": {},
19-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20-
"forwardPorts": [
21-
80,
22-
443,
23-
3306,
24-
8080,
25-
9000
26-
],
27-
"mounts": [
28-
"type=bind,source=${env:SSH_AUTH_SOCK},target=/ssh-agent"
29-
],
30-
"containerEnv": {
31-
"SSH_AUTH_SOCK": "/ssh-agent"
32-
},
33-
// Uncomment the next line if you want start specific services in your Docker Compose config.
34-
// "runServices": [],
35-
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
36-
"shutdownAction": "stopCompose",
37-
"onCreateCommand": "python3 -m pip install -q -e .[dev]",
38-
"features": {
39-
"ghcr.io/devcontainers/features/git:1": {},
40-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
41-
"ghcr.io/devcontainers/features/github-cli:1": {},
42-
},
43-
// Configure tool-specific properties.
44-
"customizations": {
45-
"vscode": {
46-
"extensions": [
47-
"ms-python.python"
48-
]
49-
}
50-
},
51-
"remoteEnv": {
52-
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
53-
}
54-
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
55-
// "remoteUser": "devcontainer"
56-
}
2+
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-18",
3+
"features": {
4+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
5+
},
6+
"postCreateCommand": "curl -fsSL https://pixi.sh/install.sh | bash && echo 'export PATH=\"$HOME/.pixi/bin:$PATH\"' >> ~/.bashrc"
7+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true

.github/workflows/lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
extra_args: codespell --all-files
2424
- uses: pre-commit/[email protected]
2525
with:
26-
extra_args: black --all-files
26+
extra_args: ruff --all-files
2727
- uses: pre-commit/[email protected]
2828
with:
29-
extra_args: flake8 --all-files
29+
extra_args: ruff-format --all-files

.github/workflows/post_draft_release_published.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
include:
26-
- py_ver: "3.9"
26+
- py_ver: "3.10"
2727
runs-on: ubuntu-latest
2828
env:
2929
PY_VER: ${{matrix.py_ver}}
@@ -40,14 +40,14 @@ jobs:
4040
- name: Update version.py
4141
run: |
4242
VERSION=$(echo "${{ github.event.release.name }}" | grep -oP '\d+\.\d+\.\d+')
43-
sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" datajoint/version.py
44-
cat datajoint/version.py
43+
sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" src/datajoint/version.py
44+
cat src/datajoint/version.py
4545
# Commit the changes
4646
BRANCH_NAME="update-version-$VERSION"
4747
git switch -c $BRANCH_NAME
4848
git config --global user.name "github-actions"
4949
git config --global user.email "[email protected]"
50-
git add datajoint/version.py
50+
git add src/datajoint/version.py
5151
git commit -m "Update version.py to $VERSION"
5252
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
5353
- name: Update README.md badge

.github/workflows/test.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,23 @@ on:
66
- "!gh-pages" # exclude gh-pages branch
77
- "!stage*" # exclude branches beginning with stage
88
paths:
9-
- "datajoint"
9+
- "src/datajoint"
1010
- "tests"
1111
pull_request:
1212
branches:
1313
- "**" # every branch
1414
- "!gh-pages" # exclude gh-pages branch
1515
- "!stage*" # exclude branches beginning with stage
1616
paths:
17-
- "datajoint"
17+
- "src/datajoint"
1818
- "tests"
1919
jobs:
2020
test:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"]
24+
py_ver: ["3.10", "3.11", "3.12", "3.13"]
2525
mysql_ver: ["8.0"]
26-
include:
27-
- py_ver: "3.9"
28-
mysql_ver: "5.7"
2926
steps:
3027
- uses: actions/checkout@v4
3128
- name: Set up Python ${{matrix.py_ver}}
@@ -34,9 +31,7 @@ jobs:
3431
python-version: ${{matrix.py_ver}}
3532
- name: Integration test
3633
env:
37-
PY_VER: ${{matrix.py_ver}}
3834
MYSQL_VER: ${{matrix.mysql_ver}}
39-
# taking default variables set in docker-compose.yaml to sync with local test
4035
run: |
41-
export HOST_UID=$(id -u)
42-
docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest
36+
pip install -e ".[test]"
37+
pytest --cov-report term-missing --cov=datajoint tests

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,5 @@ cython_debug/
185185
dj_local_conf.json
186186
*.env
187187
!.vscode/launch.json
188+
# pixi environments
189+
.pixi

.pre-commit-config.yaml

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,17 @@ repos:
2020
rev: v2.4.1
2121
hooks:
2222
- id: codespell
23-
- repo: https://github.com/pycqa/isort
24-
rev: 6.0.1 # Use the latest stable version
23+
args: [--toml, pyproject.toml]
24+
- repo: https://github.com/astral-sh/ruff-pre-commit
25+
rev: v0.8.4
2526
hooks:
26-
- id: isort
27-
args:
28-
- --profile=black # Optional, makes isort compatible with Black
29-
- repo: https://github.com/psf/black
30-
rev: 25.1.0 # matching versions in pyproject.toml and github actions
31-
hooks:
32-
- id: black
33-
args: ["--check", "-v", "datajoint", "tests", "--diff"] # --required-version is conflicting with pre-commit
34-
- repo: https://github.com/PyCQA/flake8
35-
rev: 7.3.0
36-
hooks:
37-
# syntax tests
38-
- id: flake8
39-
args:
40-
- --select=E9,F63,F7,F82
41-
- --count
42-
- --show-source
43-
- --statistics
44-
files: datajoint # a lot of files in tests are not compliant
45-
# style tests
46-
- id: flake8
47-
args:
48-
- --ignore=E203,E722,W503
49-
- --count
50-
- --max-complexity=62
51-
- --max-line-length=127
52-
- --statistics
53-
- --per-file-ignores=datajoint/diagram.py:C901
54-
files: datajoint # a lot of files in tests are not compliant
27+
# Run the linter
28+
- id: ruff
29+
args: [--fix]
30+
files: ^(src/|tests/)
31+
# Run the formatter
32+
- id: ruff-format
33+
files: ^(src/|tests/)
5534
- repo: https://github.com/rhysd/actionlint
5635
rev: v1.7.7
5736
hooks:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN ${CONDA_BIN} install --no-pin -qq -y -n base -c conda-forge \
1111
ENV PATH="$PATH:/home/mambauser/.local/bin"
1212

1313
COPY --chown=${HOST_UID:-1000}:mambauser ./pyproject.toml ./README.md ./LICENSE.txt /main/
14-
COPY --chown=${HOST_UID:-1000}:mambauser ./datajoint /main/datajoint
14+
COPY --chown=${HOST_UID:-1000}:mambauser ./src/datajoint /main/src/datajoint
1515

1616
VOLUME /src
1717
WORKDIR /src

activate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /usr/bin/bash
2+
# This script registers dot plugins so that we can use graphviz
3+
# to write png images
4+
dot -c

0 commit comments

Comments
 (0)