Skip to content

Commit 219d6d6

Browse files
Merge branch 'master' into dj-cli
2 parents c7776ed + b9d8488 commit 219d6d6

File tree

229 files changed

+21781
-2124
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

+21781
-2124
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: 6 additions & 5 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 && \
7-
pip install flake8 black faker ipykernel pytest pytest-cov nose nose-cov datajoint && \
7+
pip install flake8 black faker ipykernel pytest pytest-cov nose nose-cov datajoint jupyterlab && \
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: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,50 @@
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+
"ghcr.io/devcontainers/features/github-cli:1": {},
36+
},
37+
// Configure tool-specific properties.
2738
"customizations": {
2839
"vscode": {
2940
"extensions": [
3041
"ms-python.python"
3142
]
3243
}
44+
},
45+
"remoteEnv": {
46+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
3347
}
48+
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
49+
// "remoteUser": "devcontainer"
3450
}

.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: 45 additions & 17 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,48 @@ 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 \
92-
--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
111+
--count --max-complexity=62 --max-line-length=127 --statistics \
112+
--per-file-ignores='datajoint/diagram.py:C901'
113+
black --required-version '24.2.0' --check -v datajoint tests tests_old
114+
codespell:
115+
name: Check for spelling errors
116+
permissions:
117+
contents: read
118+
runs-on: ubuntu-latest
119+
steps:
120+
- name: Checkout
121+
uses: actions/checkout@v4
122+
- name: Codespell
123+
uses: codespell-project/actions-codespell@v2
96124
publish-docs:
97125
if: |
98126
github.event_name == 'push' &&
@@ -103,7 +131,7 @@ jobs:
103131
DOCKER_CLIENT_TIMEOUT: "120"
104132
COMPOSE_HTTP_TIMEOUT: "120"
105133
steps:
106-
- uses: actions/checkout@v3
134+
- uses: actions/checkout@v4
107135
- name: Deploy docs
108136
run: |
109137
export MODE=BUILD
@@ -135,9 +163,9 @@ jobs:
135163
outputs:
136164
release_upload_url: ${{steps.create_gh_release.outputs.upload_url}}
137165
steps:
138-
- uses: actions/checkout@v3
166+
- uses: actions/checkout@v4
139167
- name: Set up Python ${{matrix.py_ver}}
140-
uses: actions/setup-python@v4
168+
uses: actions/setup-python@v5
141169
with:
142170
python-version: ${{matrix.py_ver}}
143171
- name: Determine package version
@@ -162,7 +190,7 @@ jobs:
162190
prerelease: false
163191
draft: false
164192
- name: Fetch pip artifacts
165-
uses: actions/download-artifact@v3
193+
uses: actions/download-artifact@v4.1.7
166194
with:
167195
name: pip-datajoint-${{env.DJ_VERSION}}
168196
path: dist
@@ -191,7 +219,7 @@ jobs:
191219
- name: Publish pip release
192220
run: |
193221
export HOST_UID=$(id -u)
194-
docker-compose -f docker-compose-build.yaml run \
222+
docker compose -f docker-compose-build.yaml run \
195223
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \
196224
sh -c "pip install twine && python -m twine upload dist/*"
197225
- 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: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
## Release notes
22

3-
### Upcoming
3+
### 0.14.3 -- TBD
4+
- Fixed - Added encapsulating double quotes to comply with [DOT language](https://graphviz.org/doc/info/lang.html) - PR [#1177](https://github.com/datajoint/datajoint-python/pull/1177)
45
- Added - Datajoint python CLI ([#940](https://github.com/datajoint/datajoint-python/issues/940)) PR [#1095](https://github.com/datajoint/datajoint-python/pull/1095)
56

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

3653
### 0.13.7 -- Jul 13, 2022
37-
- Fixed - Fix networkx incompatable change by version pinning to 2.6.3 (#1035) PR #1036
54+
- Fixed - Fix networkx incompatible change by version pinning to 2.6.3 (#1035) PR #1036
3855
- Added - Support for serializing numpy datetime64 types (#1022) PR #1036
3956
- Changed - Add traceback to default logging PR #1036
4057

@@ -86,7 +103,7 @@
86103
- Fixed - `schema.list_tables()` is not topologically sorted (#838) PR #893
87104
- Fixed - Diagram part tables do not show proper class name (#882) PR #893
88105
- 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
106+
- Fixed - WHERE and GROUP BY classes are dropped on joins with aggregation (#898, #899) PR #893
90107

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

0 commit comments

Comments
 (0)