Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.11 and MySQL 5.7 #1148

Closed
wants to merge 278 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
278 commits
Select commit Hold shift + click to select a range
4939853
Update MySQL default auth plugin
ethho Dec 4, 2023
2228807
Change default MySQL root password
ethho Dec 4, 2023
92f6d6e
Add nosetests and mysql to dev container
ethho Dec 4, 2023
39c42d0
Change default MySQL root password in CI
ethho Dec 5, 2023
09a5439
Update developer docs with MySQL password
ethho Dec 5, 2023
241e14a
Merge remote-tracking branch 'upstream/dev-tests' into fix-dev-container
ethho Dec 5, 2023
4b7a68c
Unique tag for devcontainer
ethho Dec 5, 2023
6d77392
Merge pull request #1115 from ethho/fix-dev-container
ethho Dec 5, 2023
3aa0a9d
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests
ethho Dec 5, 2023
071d9eb
adapted_attributes tests passing
ethho Dec 5, 2023
c2605d7
Format with black
ethho Dec 5, 2023
eb9d469
Merge branch 'dev-tests' into dev-tests-test-s3
ethho Dec 5, 2023
d9a592c
Merge branch 'dev-tests-test-s3' into dev-tests-plat-165
ethho Dec 5, 2023
874c9cb
test_s3 uses bucket setup fixtures
ethho Dec 5, 2023
5568954
Format with black
ethho Dec 5, 2023
2ba91c4
cp to tests
ethho Dec 5, 2023
d35aa3b
Move schema_ext to conftest
ethho Dec 5, 2023
18626c8
Migrate test_attach
ethho Dec 5, 2023
81ef9a9
Add @A-Baji suggestions for SCHEMA_NAME
ethho Dec 5, 2023
eff463d
Format with black
ethho Dec 5, 2023
1814f9b
Merge pull request #1116 from ethho/dev-tests
A-Baji Dec 5, 2023
d9dc93e
Merge branch 'dev-tests' into dev-tests-plat-148
ethho Dec 5, 2023
186d7cd
Merge #1116 changes
ethho Dec 5, 2023
c97b6b6
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 5, 2023
a76bbd5
Format with black
ethho Dec 5, 2023
e277f69
Merge branch 'dev-tests-plat-145' into dev-tests-plat-148
ethho Dec 5, 2023
13b128d
Format with black
ethho Dec 5, 2023
10e0a90
Finish migrating test_s3
ethho Dec 5, 2023
217945b
Merge branch 'dev-tests-plat-145' into dev-tests-plat-165
ethho Dec 5, 2023
f993076
Change scope of raises block
ethho Dec 5, 2023
3cd99f1
Move schema_ext to conftest
ethho Dec 5, 2023
124b1fb
Remove duplicates from merge conflict resolution
ethho Dec 5, 2023
a28e1ba
Merge branch 'dev-tests-plat-145' into dev-tests-plat-165
ethho Dec 5, 2023
0ed5c3f
Merge pull request #1117 from ethho/dev-tests-plat-145
ethho Dec 5, 2023
b25886f
Merge branch 'dev-tests-plat-165' into dev-tests-plat-148
ethho Dec 5, 2023
7bd840e
Remove duplicates from merge conflict resolution
ethho Dec 5, 2023
46fdb3c
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 5, 2023
3b5047b
Add @A-Baji suggestions
ethho Dec 5, 2023
50cdd76
Merge branch 'dev-tests-plat-165' into dev-tests-plat-148
ethho Dec 5, 2023
453e516
Merge pull request #1118 from ethho/dev-tests-plat-165
ethho Dec 5, 2023
bad3e9e
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 5, 2023
cecd022
Merge pull request #1119 from ethho/dev-tests-plat-148
ethho Dec 5, 2023
77e9cc9
cp to tests
ethho Dec 5, 2023
22cfc22
First pass at migrating test_autopopulate
ethho Dec 5, 2023
f067017
Format with black
ethho Dec 5, 2023
78e1ed2
Use setup and teardown class methods instead
ethho Dec 5, 2023
4f2a3ca
Teardown tolerates nonexistent table
ethho Dec 5, 2023
ebc2144
Migrate test_autopopulate.py
ethho Dec 5, 2023
57cddd5
Switch from deprecated Version classes
ethho Dec 5, 2023
0de5a69
Format with black
ethho Dec 5, 2023
209a69b
Fix syntax error
ethho Dec 5, 2023
61c7e17
Catch a DJ error on drop_quick
ethho Dec 5, 2023
e04d15d
cp to tests
ethho Dec 5, 2023
ead5896
Merge pull request #1120 from ethho/dev-tests-plat-149-autopopulate
A-Baji Dec 5, 2023
6fe69d1
Migrate test_filepath.py
ethho Dec 5, 2023
de128a0
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 5, 2023
90209a6
Merge pull request #1121 from ethho/dev-tests-plat-158-filepath
A-Baji Dec 7, 2023
993a659
cp to tests
ethho Dec 7, 2023
2f30e40
Migrate schema_uuid
ethho Dec 7, 2023
b1cd039
Fix test tests/test_aggr_regressions.py::test_left_join_len
ethho Dec 7, 2023
5b8c429
Tests pass with module scoped fixtures
ethho Dec 7, 2023
f84c21a
Fix fixtures
ethho Dec 8, 2023
af28729
If we skip these, test_union_join passes
ethho Dec 8, 2023
c81ee0a
Skipping TestIssue558 passes all
ethho Dec 8, 2023
71720a3
Tests passing with reordering
ethho Dec 8, 2023
19a4744
test_aggr_regressions passing
ethho Dec 8, 2023
894e548
Construct schema_aggr_reg_with_abx separately
ethho Dec 8, 2023
110d642
Add context to diagram tests
ethho Dec 8, 2023
7e9ea6a
First pass at migrating test_alter
ethho Dec 9, 2023
6bc4a7f
One test passing
ethho Dec 9, 2023
9c0b1b0
Start with copy of schema_any fixture
ethho Dec 9, 2023
815a353
One test_alter test passing
ethho Dec 9, 2023
895971c
All test_alter passing
ethho Dec 9, 2023
8a9d0ee
Clean up
ethho Dec 9, 2023
6935e87
Format with black
ethho Dec 9, 2023
c6cfc4b
cp to tests
ethho Dec 9, 2023
fe51002
Migrate test_bypass_serialization
ethho Dec 9, 2023
149555c
cp to tests
ethho Dec 10, 2023
0b08225
Migrate test_cascading_delete
ethho Dec 10, 2023
1b4e238
cp to tests
ethho Dec 10, 2023
69a7938
WIP test_declare migration
ethho Dec 10, 2023
fbecd8a
nose2pytest tests
ethho Dec 10, 2023
d815e82
First pass at migrating test_declare
ethho Dec 10, 2023
e97f163
Clean up and format
ethho Dec 10, 2023
47cea7d
Format with black
ethho Dec 10, 2023
775521f
Merge branch 'dev-tests-plat-151-cascade' into dev-tests-plat-153-dec…
ethho Dec 10, 2023
9c0e407
Merge pull request #1122 from ethho/dev-tests-plat-146-aggr
A-Baji Dec 11, 2023
e2c0d30
Define schema_alter in test module
ethho Dec 11, 2023
8a8b0c3
Simpler schema_alter fixture
ethho Dec 11, 2023
28a311b
Merge branch 'dev-tests-plat-147-alter' into dev-tests-plat-150-bypass
ethho Dec 11, 2023
0e20c73
Merge branch 'dev-tests-plat-147-alter' into dev-tests-plat-151-cascade
ethho Dec 11, 2023
3baa4f4
Merge pull request #1123 from ethho/dev-tests-plat-147-alter
A-Baji Dec 11, 2023
cc7432c
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 11, 2023
5af6e36
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 11, 2023
8ca30bd
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 11, 2023
e87a7d8
Merge pull request #1124 from ethho/dev-tests-plat-150-bypass
A-Baji Dec 11, 2023
6ee5d20
Merge pull request #1125 from ethho/dev-tests-plat-151-cascade
ethho Dec 11, 2023
27e045c
Merge branch 'dev-tests' into dev-tests-plat-153-declare
ethho Dec 11, 2023
23c01f4
Remove extraneous declarations
ethho Dec 11, 2023
45f9997
Fix escape sequence warning
ethho Dec 11, 2023
10185a2
Merge pull request #1126 from ethho/dev-tests-plat-153-declare
ethho Dec 11, 2023
6046b81
cp to tests
ethho Dec 11, 2023
cdb4052
nose2pytest test_external
ethho Dec 11, 2023
49670c9
Use pytest tmpdir fixtures for mocking stores
ethho Dec 11, 2023
012e46d
Migrate test_external
ethho Dec 11, 2023
9392959
Format with black
ethho Dec 11, 2023
071a3c0
cp to tests
ethho Dec 11, 2023
cee3da8
Migrate test_external_class
ethho Dec 11, 2023
7c3c2b7
Format with black
ethho Dec 11, 2023
e23f909
cp to tests
ethho Dec 11, 2023
e0a0bdb
First pass at migrating test_fetch
ethho Dec 11, 2023
a6b4777
Merge pull request #1127 from ethho/dev-tests-plat-154-external
A-Baji Dec 12, 2023
5cf703f
Merge pull request #1128 from ethho/dev-tests-plat-155-external-class
A-Baji Dec 12, 2023
97d5bf3
All but one test_fetch passing
ethho Dec 12, 2023
30174bc
Skip nonbreaking tests
ethho Dec 12, 2023
115c8bd
Show breaking test
ethho Dec 12, 2023
17cc564
Fix breaking test
ethho Dec 12, 2023
b1db688
Unskip tests
ethho Dec 12, 2023
8885795
Format with black
ethho Dec 12, 2023
761c166
Remove unnecessary assert
ethho Dec 13, 2023
0a498a6
cp to tests
ethho Dec 13, 2023
e2acbea
Migrate test_fetch_same
ethho Dec 13, 2023
74402eb
cp to tests
ethho Dec 13, 2023
66cd1c1
nose2pytest test_jobs
ethho Dec 13, 2023
b2c1f0e
All but two test_jobs passing
ethho Dec 13, 2023
4fa05a2
Clean jobs table in fixture
ethho Dec 13, 2023
c7a3036
Change from generator to list
ethho Dec 13, 2023
dfdb805
Tolerate error when cleaning up schema_any.jobs
ethho Dec 13, 2023
a4ea5ff
Format with black
ethho Dec 13, 2023
6906193
Remove unnecessary fixture usage
ethho Dec 13, 2023
4026a56
Fix typo
ethho Dec 13, 2023
52e78bb
test_long_error_stack requires subjects fixture
ethho Dec 13, 2023
ecbcac1
cp to tests
ethho Dec 13, 2023
fdd4352
Migrate TestUnprivileged
ethho Dec 13, 2023
37248ff
Format with black
ethho Dec 13, 2023
08fcac0
Separate fixture for DB creds dict
ethho Dec 13, 2023
156d229
First pass at migrating test_privileges
ethho Dec 13, 2023
05b3b00
Clean up
ethho Dec 13, 2023
9b0df13
rm commented code
ethho Dec 13, 2023
9621733
cp to tests
ethho Dec 13, 2023
f3a5dd1
nose2pytest test_reconnection
ethho Dec 13, 2023
e3672f6
Migrate test_reconnection
ethho Dec 13, 2023
394cad9
Add default values for db_creds_root
ethho Dec 13, 2023
36623f1
Format with black
ethho Dec 13, 2023
37b8fb3
cp to tests
ethho Dec 13, 2023
24e14ab
nose2pytest test_reconnection
ethho Dec 13, 2023
94c6c31
Merge branch 'dev-tests' into dev-tests-plat-156-fetch
ethho Dec 13, 2023
cd14f4a
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 13, 2023
d5445bf
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 13, 2023
bd2690d
Merge pull request #1129 from ethho/dev-tests-plat-156-fetch
A-Baji Dec 13, 2023
8511328
WIP migrate test_relation
ethho Dec 13, 2023
05201ac
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 13, 2023
42c50f3
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 13, 2023
a8e20eb
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 13, 2023
e128632
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 13, 2023
e862547
Merge pull request #1131 from ethho/dev-tests-plat-159-jobs
A-Baji Dec 13, 2023
911184f
Merge pull request #1130 from ethho/dev-tests-plat-157-fetch-same
A-Baji Dec 13, 2023
ce17785
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 13, 2023
88f7b53
Merge remote-tracking branch 'upstream/dev-tests' into dev-tests-plat…
ethho Dec 13, 2023
88ca9b6
Merge pull request #1132 from ethho/dev-tests-plat-160-privileges
A-Baji Dec 13, 2023
46a015c
Merge pull request #1133 from ethho/dev-tests-plat-161-reconn
A-Baji Dec 13, 2023
9ab9a92
Move tests to top level
ethho Dec 13, 2023
07553a2
Fix typo in test
ethho Dec 14, 2023
b7ce668
Format with black
ethho Dec 14, 2023
34ddf0d
Clean up
ethho Dec 14, 2023
3998cb4
Use fixture for TTest2
ethho Dec 14, 2023
3830c55
Use fixture for TTest
ethho Dec 14, 2023
aa84da9
cp to tests
ethho Dec 14, 2023
60fda04
nose2pytest test_relational_operand
ethho Dec 14, 2023
bad9a22
First pass at migrating test_relational_operand
ethho Dec 14, 2023
39e5efe
Format with black
ethho Dec 14, 2023
f34ca35
cp to tests
ethho Dec 14, 2023
7598441
nose2pytest test_schema
ethho Dec 14, 2023
55bf4ea
Add db_creds_test fixture
ethho Dec 14, 2023
5fed6a5
First pass at migrating test_schema
ethho Dec 14, 2023
74614b1
Merge pull request #1134 from ethho/dev-tests-plat-162-relation
A-Baji Dec 14, 2023
68b32b8
Merge branch 'dev-tests' into dev-tests-plat-163-relop
ethho Dec 14, 2023
20c5039
Merge pull request #1135 from ethho/dev-tests-plat-163-relop
A-Baji Dec 14, 2023
58c6103
Mock schema_empty module
ethho Dec 14, 2023
b9ccb4f
Move call to spawn_missing_classes to test
ethho Dec 14, 2023
0e194e7
Merge branch 'dev-tests' into dev-tests-plat-166-schema
ethho Dec 14, 2023
7bf18f0
Format with black
ethho Dec 14, 2023
acb2ab3
Checkout conftest from dev-tests-plat-166-schema
ethho Dec 14, 2023
ffc61b8
cp to tests
ethho Dec 14, 2023
9974818
nose2pytest test_tls
ethho Dec 14, 2023
0a94b20
Migrate test_tls
ethho Dec 14, 2023
1e3ba5c
Format with black
ethho Dec 14, 2023
baf74a6
cp to tests
ethho Dec 14, 2023
a66da4d
nose2pytest test_university
ethho Dec 14, 2023
7577cfe
Checkout conftest from dev-tests-plat-166-schema
ethho Dec 14, 2023
b40d4ec
cp tests_old/data to tests
ethho Dec 14, 2023
fc363f4
First pass at migrating test_university
ethho Dec 14, 2023
f307d3b
Format with black
ethho Dec 14, 2023
e12e021
cp to tests
ethho Dec 14, 2023
9614641
nose2pytest test_update1
ethho Dec 14, 2023
20ab185
Format with black
ethho Dec 14, 2023
164753c
cp to tests
ethho Dec 14, 2023
5f439c6
nose2pytest test_uuid
ethho Dec 14, 2023
5d2b1f7
Migrate test_uuid
ethho Dec 14, 2023
922ab00
Clean test_adapted_attributes
ethho Dec 14, 2023
608782f
Clean test_admin
ethho Dec 14, 2023
44a9184
Clean test_aggr_regressions
ethho Dec 14, 2023
8f85b02
Clean test_alter
ethho Dec 14, 2023
d40fca6
Clean test_attach
ethho Dec 14, 2023
c0d56a6
Fix ImportError
ethho Dec 14, 2023
95643de
Make stores config serializable
ethho Dec 15, 2023
62bd4cc
Correct use of tmpdir_factory
ethho Dec 15, 2023
32b7c4c
Clean up test_autopopulate
ethho Dec 15, 2023
91d7ad6
Clean up other modules
ethho Dec 15, 2023
fc0cf35
Move all CONN_INFO to fixtures
ethho Dec 15, 2023
b689ec2
Session scoped s3_creds
ethho Dec 15, 2023
c3e96e9
Format with black
ethho Dec 15, 2023
a59325a
Replace PREFIX with fixture
ethho Dec 15, 2023
a3f6338
Format with black
ethho Dec 15, 2023
462f111
Empty tests init
ethho Dec 15, 2023
3f48bf9
Add missing prefix injection
ethho Dec 15, 2023
70318e2
Add missing prefix injection
ethho Dec 15, 2023
23529b4
Format with black
ethho Dec 15, 2023
e81d5ce
Fix warnings in test_cascading_delete
ethho Dec 15, 2023
ec914f8
Merge pull request #1137 from ethho/dev-tests-plat-167-tls
ethho Dec 15, 2023
d474c7d
Merge pull request #1138 from ethho/dev-tests-plat-168-uni
ethho Dec 15, 2023
fa2ae33
Merge pull request #1139 from ethho/dev-tests-plat-169-update1
ethho Dec 15, 2023
9f1e2c4
Merge pull request #1140 from ethho/dev-tests-plat-170-uuid
ethho Dec 15, 2023
fdace0b
Merge branch 'dev-tests' into dev-tests-cleanup
ethho Dec 15, 2023
573df44
Clean up from merge conflict
ethho Dec 15, 2023
03db252
Merge pull request #1136 from ethho/dev-tests-plat-166-schema
ethho Dec 15, 2023
5489dff
Merge branch 'dev-tests' into dev-tests-cleanup
ethho Dec 15, 2023
b149868
Add @dimitri-yatsenko suggested changes on #1131
ethho Dec 15, 2023
abda8f1
Clean up last modules
ethho Dec 15, 2023
fd53931
Replace PREFIX in test_schema
ethho Dec 15, 2023
725cae2
Resolve DeprecationWarning in tests/test_blob.py::test_insert_longblob
ethho Dec 18, 2023
34161a8
Move insert_blobs to module scope
ethho Dec 18, 2023
a7ad213
Delete commented code
ethho Dec 18, 2023
bf17e75
Format with black
ethho Dec 18, 2023
e755b97
Remove nosetest commands from dev docs
ethho Dec 18, 2023
207ed12
Add Python 3.10 and 3.11 to CI
ethho Dec 18, 2023
d96a04b
Test 3.10 and 3.11 with MySQL 8.0 only
ethho Dec 18, 2023
b58e238
Remove nosetest commands from compose stack
ethho Dec 18, 2023
bfe3608
Merge branch 'dev-tests-cleanup' into dev-tests-plat-143-modernpy
ethho Dec 19, 2023
27c6be1
Add fixture enable_feature_32bit_dims
ethho Dec 19, 2023
7422f94
Explicitly define timeit context
ethho Dec 19, 2023
674a669
Format with black
ethho Dec 19, 2023
a0a4a96
Use latest datajoint/nginx image
ethho Jan 2, 2024
88c96e6
Merge pull request #1141 from ethho/dev-tests-cleanup
A-Baji Jan 2, 2024
90d1b5d
Merge pull request #1143 from ethho/dev-tests-plat-144-docs
A-Baji Jan 2, 2024
23a7588
Merge branch 'dev-tests' into dev-tests-plat-143-modernpy
ethho Jan 2, 2024
960e3e4
Partially merge changes from dev-tests-plat-143-debug-ssl
ethho Jan 3, 2024
6ffe78a
Use TLS config for Connection constructor
ethho Jan 3, 2024
3ca55dd
Use fixture for test_json skip
ethho Jan 3, 2024
85a0189
For use_tls, use config value if not provided as kwarg
ethho Jan 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Note: You can use any Debian/Ubuntu based image you want.
FROM mcr.microsoft.com/devcontainers/python:3.7-bullseye

ARG PY_VER
ARG DISTRO
FROM mcr.microsoft.com/devcontainers/python:${PY_VER}-${DISTRO}
RUN \
apt update && \
apt-get install bash-completion graphviz default-mysql-client -y && \
pip install flake8 black faker ipykernel pytest pytest-cov nose nose-cov datajoint && \
pip uninstall datajoint -y

USER root
ENV DJ_HOST fakeservices.datajoint.io
ENV DJ_USER root
ENV DJ_PASS simple
ENV DJ_PASS password
44 changes: 29 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
{
"name": "Development",
"dockerComposeFile": "docker-compose.yaml",
"name": "Existing Docker Compose (Extend)",
// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../LNX-docker-compose.yml",
"docker-compose.yml"
],
// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "app",
// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use this environment variable if you need to bind mount your local source code into a new container.
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
},
// https://containers.dev/features
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {},
"ghcr.io/guiyomh/features/vim:0": {}
},
"onCreateCommand": "pip install -e .",
"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",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
80,
443,
3306,
8080,
9000
],
// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
"shutdownAction": "stopCompose",
"onCreateCommand": "python3 -m pip install -e .",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
},
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
]
}
},
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
}
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
10 changes: 0 additions & 10 deletions .devcontainer/docker-compose.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: '2.4'
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
app:
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
# array). The sample below assumes your primary file is in the root of your project.
container_name: devcontainer
image: devcontainer
build:
context: .
dockerfile: .devcontainer/Dockerfile
args:
- PY_VER=${PY_VER:-3.8}
- DISTRO=${DISTRO:-buster}

volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspaces:cached

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

user: root

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"

6 changes: 5 additions & 1 deletion .github/workflows/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ jobs:
py_ver: ["3.9"]
mysql_ver: ["8.0", "5.7"]
include:
- py_ver: "3.11"
mysql_ver: "8.0"
- py_ver: "3.10"
mysql_ver: "8.0"
- py_ver: "3.8"
mysql_ver: "5.7"
- py_ver: "3.7"
Expand All @@ -77,7 +81,7 @@ jobs:
- name: Run primary tests
env:
PY_VER: ${{matrix.py_ver}}
DJ_PASS: simple
DJ_PASS: password
MYSQL_VER: ${{matrix.mysql_ver}}
DISTRO: alpine
MINIO_VER: RELEASE.2021-09-03T03-56-13Z
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ docs/site

!.vscode/settings.json
!.vscode/launch.json
!.devcontainer/devcontainer.json
!.devcontainer/devcontainer.json
!.devcontainer/docker-compose.yml

17 changes: 8 additions & 9 deletions LNX-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ x-net:
services:
db:
<<: *net
image: datajoint/mysql:${MYSQL_VER}
image: datajoint/mysql:${MYSQL_VER:-5.7}
environment:
- MYSQL_ROOT_PASSWORD=${DJ_PASS}
- MYSQL_ROOT_PASSWORD=${DJ_PASS:-password}
command: mysqld --default-authentication-plugin=mysql_native_password
# ports:
# - "3306:3306"
# volumes:
Expand All @@ -21,7 +22,7 @@ services:
interval: 15s
minio:
<<: *net
image: minio/minio:${MINIO_VER}
image: minio/minio:${MINIO_VER:-RELEASE.2022-08-11T04-37-28Z}
environment:
- MINIO_ACCESS_KEY=datajoint
- MINIO_SECRET_KEY=datajoint
Expand All @@ -44,7 +45,7 @@ services:
interval: 15s
fakeservices.datajoint.io:
<<: *net
image: datajoint/nginx:v0.2.6
image: datajoint/nginx:v0.2.8
environment:
- ADD_db_TYPE=DATABASE
- ADD_db_ENDPOINT=db:3306
Expand All @@ -58,7 +59,7 @@ services:
# - "3306:3306"
app:
<<: *net
image: datajoint/djtest:py${PY_VER}-${DISTRO}
image: datajoint/djtest:py${PY_VER:-3.11}-${DISTRO:-alpine}
depends_on:
db:
condition: service_healthy
Expand All @@ -69,7 +70,7 @@ services:
environment:
- DJ_HOST=fakeservices.datajoint.io
- DJ_USER=root
- DJ_PASS
- DJ_PASS=password
- DJ_TEST_HOST=fakeservices.datajoint.io
- DJ_TEST_USER=datajoint
- DJ_TEST_PASSWORD=datajoint
Expand All @@ -86,14 +87,12 @@ services:
- -c
- |
set -e
pip install --user nose nose-cov
pip install -e .
pip list --format=freeze | grep datajoint
pytest -sv --cov-report term-missing --cov=datajoint tests
nosetests -vsw tests_old --with-coverage --cover-package=datajoint
# ports:
# - "8888:8888"
user: ${HOST_UID}:anaconda
user: ${HOST_UID:-1000}:anaconda
volumes:
- .:/src
- /tmp/.X11-unix:/tmp/.X11-unix:rw
Expand Down
2 changes: 2 additions & 0 deletions datajoint/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def __init__(self, host, user, password, port=None, init_fun=None, use_tls=None)
elif port is None:
port = config["database.port"]
self.conn_info = dict(host=host, port=port, user=user, passwd=password)
if use_tls is None:
use_tls = config["database.use_tls"]
if use_tls is not False:
self.conn_info["ssl"] = (
use_tls if isinstance(use_tls, dict) else {"ssl": {}}
Expand Down
16 changes: 4 additions & 12 deletions docs/src/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,16 @@ The following will verify there are no regression errors by running our test sui

- Entire test suite:
```
nosetests -vw tests_old
pytest -sv --cov-report term-missing --cov=datajoint tests
```
> Note: We are in the process of upgrading to `pytest` tests. To run those, use:
> ```
> pytest -sv --cov-report term-missing --cov=datajoint tests
> ```

- A single functional test:
```
nosetests -vs --tests=tests_old.test_external_class:test_insert_and_fetch
pytest -sv tests/test_connection.py::test_dj_conn
```
> Note: We are in the process of upgrading to `pytest` tests. To run those, use:
> ```
> pytest -sv tests/test_connection.py::test_dj_conn
> ```
- A single class test:
```
nosetests -vs --tests=tests_old.test_fetch:TestFetch.test_getattribute_for_fetch1
pytest -sv tests/test_aggr_regressions.py::TestIssue558
```

### Style Tests
Expand Down Expand Up @@ -104,7 +96,7 @@ It is often useful in development to connect to DataJoint's relational database
Connect as follows to the database running within your developer environment:

```
mysql -hfakeservices.datajoint.io -uroot -psimple
mysql -hfakeservices.datajoint.io -uroot -ppassword
```

### Documentation
Expand Down
69 changes: 0 additions & 69 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,69 +0,0 @@
import datajoint as dj
from packaging import version
import pytest
import os

PREFIX = "djtest"

CONN_INFO_ROOT = dict(
host=os.getenv("DJ_HOST"),
user=os.getenv("DJ_USER"),
password=os.getenv("DJ_PASS"),
)


@pytest.fixture
def connection_root():
"""Root user database connection."""
dj.config["safemode"] = False
connection = dj.Connection(
host=os.getenv("DJ_HOST"),
user=os.getenv("DJ_USER"),
password=os.getenv("DJ_PASS"),
)
yield connection
dj.config["safemode"] = True
connection.close()


@pytest.fixture
def connection_test(connection_root):
"""Test user database connection."""
database = f"{PREFIX}%%"
credentials = dict(
host=os.getenv("DJ_HOST"), user="datajoint", password="datajoint"
)
permission = "ALL PRIVILEGES"

# Create MySQL users
if version.parse(
connection_root.query("select @@version;").fetchone()[0]
) >= version.parse("8.0.0"):
# create user if necessary on mysql8
connection_root.query(
f"""
CREATE USER IF NOT EXISTS '{credentials["user"]}'@'%%'
IDENTIFIED BY '{credentials["password"]}';
"""
)
connection_root.query(
f"""
GRANT {permission} ON `{database}`.*
TO '{credentials["user"]}'@'%%';
"""
)
else:
# grant permissions. For MySQL 5.7 this also automatically creates user
# if not exists
connection_root.query(
f"""
GRANT {permission} ON `{database}`.*
TO '{credentials["user"]}'@'%%'
IDENTIFIED BY '{credentials["password"]}';
"""
)

connection = dj.Connection(**credentials)
yield connection
connection_root.query(f"""DROP USER `{credentials["user"]}`""")
connection.close()
Loading
Loading