Skip to content

Commit e4fa467

Browse files
committed
Merge branch 'master' into dj-top-1084-continued
2 parents d9aabf2 + b755c84 commit e4fa467

File tree

229 files changed

+21745
-1845
lines changed

Some content is hidden

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

229 files changed

+21745
-1845
lines changed

.codespellrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[codespell]
2+
skip = .git,*.pdf,*.svg,*.csv,*.ipynb,*.drawio
3+
# Rever -- nobody knows
4+
# numer -- numerator variable
5+
ignore-words-list = rever,numer

.devcontainer/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# Note: You can use any Debian/Ubuntu based image you want.
2-
FROM mcr.microsoft.com/devcontainers/python:3.7-bullseye
3-
1+
ARG PY_VER
2+
ARG DISTRO
3+
FROM mcr.microsoft.com/devcontainers/python:${PY_VER}-${DISTRO}
44
RUN \
55
apt update && \
66
apt-get install bash-completion graphviz default-mysql-client -y && \
77
pip install flake8 black faker ipykernel pytest pytest-cov nose nose-cov datajoint && \
88
pip uninstall datajoint -y
99

10+
USER root
1011
ENV DJ_HOST fakeservices.datajoint.io
1112
ENV DJ_USER root
12-
ENV DJ_PASS simple
13+
ENV DJ_PASS password

.devcontainer/devcontainer.json

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,49 @@
11
// 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
23
{
3-
"name": "Development",
4-
"dockerComposeFile": "docker-compose.yaml",
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+
"../LNX-docker-compose.yml",
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.
513
"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
616
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
7-
// Use this environment variable if you need to bind mount your local source code into a new container.
8-
"remoteEnv": {
9-
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
10-
},
11-
// https://containers.dev/features
12-
"features": {
13-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
14-
"ghcr.io/devcontainers/features/git:1": {},
15-
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {},
16-
"ghcr.io/guiyomh/features/vim:0": {}
17-
},
18-
"onCreateCommand": "pip install -e .",
19-
"postStartCommand": "MYSQL_VER=8.0 MINIO_VER=RELEASE.2022-08-11T04-37-28Z docker compose -f local-docker-compose.yml down && docker volume prune -f && MYSQL_VER=8.0 MINIO_VER=RELEASE.2022-08-11T04-37-28Z docker compose -f local-docker-compose.yml up --build --wait",
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.
2020
"forwardPorts": [
2121
80,
2222
443,
2323
3306,
2424
8080,
2525
9000
2626
],
27+
// Uncomment the next line if you want start specific services in your Docker Compose config.
28+
// "runServices": [],
29+
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
30+
"shutdownAction": "stopCompose",
31+
"onCreateCommand": "python3 -m pip install -e .",
32+
"features": {
33+
"ghcr.io/devcontainers/features/git:1": {},
34+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
35+
},
36+
// Configure tool-specific properties.
2737
"customizations": {
2838
"vscode": {
2939
"extensions": [
3040
"ms-python.python"
3141
]
3242
}
43+
},
44+
"remoteEnv": {
45+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
3346
}
47+
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
48+
// "remoteUser": "devcontainer"
3449
}

.devcontainer/docker-compose.yaml

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

.devcontainer/docker-compose.yml

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

.github/workflows/development.yaml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
DOCKER_CLIENT_TIMEOUT: "120"
2929
COMPOSE_HTTP_TIMEOUT: "120"
3030
steps:
31-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3232
- name: Validate version and release notes
3333
run: |
3434
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
@@ -42,7 +42,7 @@ jobs:
4242
- name: Build pip artifacts
4343
run: |
4444
export HOST_UID=$(id -u)
45-
docker-compose -f docker-compose-build.yaml up --exit-code-from app --build
45+
docker compose -f docker-compose-build.yaml up --exit-code-from app --build
4646
echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV
4747
- if: matrix.py_ver == '3.9' && matrix.distro == 'debian'
4848
name: Add pip artifacts
@@ -58,14 +58,16 @@ jobs:
5858
py_ver: ["3.9"]
5959
mysql_ver: ["8.0", "5.7"]
6060
include:
61+
- py_ver: "3.11"
62+
mysql_ver: "8.0"
63+
- py_ver: "3.10"
64+
mysql_ver: "8.0"
6165
- py_ver: "3.8"
6266
mysql_ver: "5.7"
63-
- py_ver: "3.7"
64-
mysql_ver: "5.7"
6567
steps:
66-
- uses: actions/checkout@v3
68+
- uses: actions/checkout@v4
6769
- name: Set up Python ${{matrix.py_ver}}
68-
uses: actions/setup-python@v4
70+
uses: actions/setup-python@v5
6971
with:
7072
python-version: ${{matrix.py_ver}}
7173
- name: Install dependencies
@@ -77,22 +79,47 @@ jobs:
7779
- name: Run primary tests
7880
env:
7981
PY_VER: ${{matrix.py_ver}}
80-
DJ_PASS: simple
82+
DJ_PASS: password
8183
MYSQL_VER: ${{matrix.mysql_ver}}
8284
DISTRO: alpine
8385
MINIO_VER: RELEASE.2021-09-03T03-56-13Z
8486
DOCKER_CLIENT_TIMEOUT: "120"
8587
COMPOSE_HTTP_TIMEOUT: "120"
8688
run: |
8789
export HOST_UID=$(id -u)
88-
docker-compose -f LNX-docker-compose.yml up --build --exit-code-from app
90+
docker compose -f LNX-docker-compose.yml up --build --exit-code-from app
91+
lint:
92+
runs-on: ubuntu-latest
93+
strategy:
94+
matrix:
95+
py_ver: ["3.11"]
96+
steps:
97+
- uses: actions/checkout@v4
98+
- name: Set up Python ${{matrix.py_ver}}
99+
uses: actions/setup-python@v5
100+
with:
101+
python-version: ${{matrix.py_ver}}
102+
- name: Install dependencies
103+
run: |
104+
python -m pip install --upgrade pip
105+
pip install flake8 black==24.2.0
106+
- name: Run syntax tests
107+
run: flake8 datajoint --count --select=E9,F63,F7,F82 --show-source --statistics
89108
- name: Run style tests
90109
run: |
91110
flake8 --ignore=E203,E722,W503 datajoint \
92111
--count --max-complexity=62 --max-line-length=127 --statistics
93-
black datajoint --check -v
94-
black tests --check -v
95-
black tests_old --check -v
112+
black --required-version '24.2.0' --check -v datajoint tests tests_old
113+
codespell:
114+
name: Check for spelling errors
115+
permissions:
116+
contents: read
117+
runs-on: ubuntu-latest
118+
steps:
119+
- name: Checkout
120+
uses: actions/checkout@v4
121+
- name: Codespell
122+
uses: codespell-project/actions-codespell@v2
96123
publish-docs:
97124
if: |
98125
github.event_name == 'push' &&
@@ -103,7 +130,7 @@ jobs:
103130
DOCKER_CLIENT_TIMEOUT: "120"
104131
COMPOSE_HTTP_TIMEOUT: "120"
105132
steps:
106-
- uses: actions/checkout@v3
133+
- uses: actions/checkout@v4
107134
- name: Deploy docs
108135
run: |
109136
export MODE=BUILD
@@ -135,9 +162,9 @@ jobs:
135162
outputs:
136163
release_upload_url: ${{steps.create_gh_release.outputs.upload_url}}
137164
steps:
138-
- uses: actions/checkout@v3
165+
- uses: actions/checkout@v4
139166
- name: Set up Python ${{matrix.py_ver}}
140-
uses: actions/setup-python@v4
167+
uses: actions/setup-python@v5
141168
with:
142169
python-version: ${{matrix.py_ver}}
143170
- name: Determine package version
@@ -191,7 +218,7 @@ jobs:
191218
- name: Publish pip release
192219
run: |
193220
export HOST_UID=$(id -u)
194-
docker-compose -f docker-compose-build.yaml run \
221+
docker compose -f docker-compose-build.yaml run \
195222
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \
196223
sh -c "pip install twine && python -m twine upload dist/*"
197224
- name: Login to DockerHub

.github/workflows/docs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Manual docs release
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
publish-docs:
6+
runs-on: ubuntu-latest
7+
env:
8+
DOCKER_CLIENT_TIMEOUT: "120"
9+
COMPOSE_HTTP_TIMEOUT: "120"
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Deploy docs
13+
run: |
14+
export MODE=BUILD
15+
export PACKAGE=datajoint
16+
export UPSTREAM_REPO=https://github.com/${GITHUB_REPOSITORY}.git
17+
export HOST_UID=$(id -u)
18+
docker compose -f docs/docker-compose.yaml up --exit-code-from docs --build
19+
git push origin gh-pages

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ docs/site
3030

3131
!.vscode/settings.json
3232
!.vscode/launch.json
33-
!.devcontainer/devcontainer.json
33+
!.devcontainer/devcontainer.json
34+
!.devcontainer/docker-compose.yml
35+

CHANGELOG.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
## Release notes
22

3-
### Upcoming
3+
### 0.14.3 -- TBD
44
- Added - `dj.Top` restriction ([#1024](https://github.com/datajoint/datajoint-python/issues/1024)) PR [#1084](https://github.com/datajoint/datajoint-python/pull/1084)
55

6+
### 0.14.2 -- Aug 19, 2024
7+
- Added - Migrate nosetests to pytest - PR [#1142](https://github.com/datajoint/datajoint-python/pull/1142)
8+
- Added - Codespell GitHub Actions workflow
9+
- Added - GitHub Actions workflow to manually release docs
10+
- Changed - Update `datajoint/nginx` to `v0.2.6`
11+
- Changed - Migrate docs from `https://docs.datajoint.org/python` to `https://datajoint.com/docs/core/datajoint-python`
12+
- Fixed - [DevContainer](https://containers.dev/) configuration - PR [#1115](https://github.com/datajoint/datajoint-python/pull/1115)
13+
- Fixed - Updated set_password to work on MySQL 8 - PR [#1106](https://github.com/datajoint/datajoint-python/pull/1106)
14+
- Added - Missing tests for set_password - PR [#1106](https://github.com/datajoint/datajoint-python/pull/1106)
15+
- Changed - Returning success count after the .populate() call - PR [#1050](https://github.com/datajoint/datajoint-python/pull/1050)
16+
- Fixed - `Autopopulate.populate` excludes `reserved` jobs in addition to `ignore` and `error` jobs
17+
- Fixed - Issue [#1159](https://github.com/datajoint/datajoint-python/pull/1159) (cascading delete) - PR [#1160](https://github.com/datajoint/datajoint-python/pull/1160)
18+
- Changed - Minimum Python version for Datajoint-Python is now 3.8 PR #1163
19+
- Fixed - `docker compose` commands in CI [#1164](https://github.com/datajoint/datajoint-python/pull/1164)
20+
- Changed - Default delete behavior now includes masters of part tables - PR [#1158](https://github.com/datajoint/datajoint-python/pull/1158)
21+
622
### 0.14.1 -- Jun 02, 2023
723
- Fixed - Fix altering a part table that uses the "master" keyword - PR [#991](https://github.com/datajoint/datajoint-python/pull/991)
824
- Fixed - `.ipynb` output in tutorials is not visible in dark mode ([#1078](https://github.com/datajoint/datajoint-python/issues/1078)) PR [#1080](https://github.com/datajoint/datajoint-python/pull/1080)
@@ -34,7 +50,7 @@
3450
- Fixed - Fix queries with backslashes ([#999](https://github.com/datajoint/datajoint-python/issues/999)) PR [#1052](https://github.com/datajoint/datajoint-python/pull/1052)
3551

3652
### 0.13.7 -- Jul 13, 2022
37-
- Fixed - Fix networkx incompatable change by version pinning to 2.6.3 (#1035) PR #1036
53+
- Fixed - Fix networkx incompatible change by version pinning to 2.6.3 (#1035) PR #1036
3854
- Added - Support for serializing numpy datetime64 types (#1022) PR #1036
3955
- Changed - Add traceback to default logging PR #1036
4056

@@ -86,7 +102,7 @@
86102
- Fixed - `schema.list_tables()` is not topologically sorted (#838) PR #893
87103
- Fixed - Diagram part tables do not show proper class name (#882) PR #893
88104
- Fixed - Error in complex restrictions (#892) PR #893
89-
- Fixed - WHERE and GROUP BY clases are dropped on joins with aggregation (#898, #899) PR #893
105+
- Fixed - WHERE and GROUP BY classes are dropped on joins with aggregation (#898, #899) PR #893
90106

91107
### 0.13.0 -- Mar 24, 2021
92108
- Re-implement query transpilation into SQL, fixing issues (#386, #449, #450, #484, #558). PR #754

LNX-docker-compose.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ x-net:
77
services:
88
db:
99
<<: *net
10-
image: datajoint/mysql:${MYSQL_VER}
10+
image: datajoint/mysql:${MYSQL_VER:-8.0}
1111
environment:
12-
- MYSQL_ROOT_PASSWORD=${DJ_PASS}
12+
- MYSQL_ROOT_PASSWORD=${DJ_PASS:-password}
13+
command: mysqld --default-authentication-plugin=mysql_native_password
1314
# ports:
1415
# - "3306:3306"
1516
# volumes:
@@ -21,7 +22,7 @@ services:
2122
interval: 15s
2223
minio:
2324
<<: *net
24-
image: minio/minio:${MINIO_VER}
25+
image: minio/minio:${MINIO_VER:-RELEASE.2022-08-11T04-37-28Z}
2526
environment:
2627
- MINIO_ACCESS_KEY=datajoint
2728
- MINIO_SECRET_KEY=datajoint
@@ -44,7 +45,7 @@ services:
4445
interval: 15s
4546
fakeservices.datajoint.io:
4647
<<: *net
47-
image: datajoint/nginx:v0.2.6
48+
image: datajoint/nginx:latest
4849
environment:
4950
- ADD_db_TYPE=DATABASE
5051
- ADD_db_ENDPOINT=db:3306
@@ -58,7 +59,7 @@ services:
5859
# - "3306:3306"
5960
app:
6061
<<: *net
61-
image: datajoint/djtest:py${PY_VER}-${DISTRO}
62+
image: datajoint/djtest:py${PY_VER:-3.8}-${DISTRO:-alpine}
6263
depends_on:
6364
db:
6465
condition: service_healthy
@@ -69,7 +70,7 @@ services:
6970
environment:
7071
- DJ_HOST=fakeservices.datajoint.io
7172
- DJ_USER=root
72-
- DJ_PASS
73+
- DJ_PASS=password
7374
- DJ_TEST_HOST=fakeservices.datajoint.io
7475
- DJ_TEST_USER=datajoint
7576
- DJ_TEST_PASSWORD=datajoint
@@ -86,14 +87,12 @@ services:
8687
- -c
8788
- |
8889
set -e
89-
pip install --user nose nose-cov
9090
pip install -e .
9191
pip list --format=freeze | grep datajoint
9292
pytest -sv --cov-report term-missing --cov=datajoint tests
93-
nosetests -vsw tests_old --with-coverage --cover-package=datajoint
9493
# ports:
9594
# - "8888:8888"
96-
user: ${HOST_UID}:anaconda
95+
user: ${HOST_UID:-1000}:anaconda
9796
volumes:
9897
- .:/src
9998
- /tmp/.X11-unix:/tmp/.X11-unix:rw

0 commit comments

Comments
 (0)