Skip to content

Commit 9823355

Browse files
authored
Merge pull request #1 from guzman-raphael/switch-to-djtest
Fix merge conflicts + update images
2 parents 21f7ad1 + 7ac30db commit 9823355

File tree

163 files changed

+2217
-3091
lines changed

Some content is hidden

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

163 files changed

+2217
-3091
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: 'bug, awaiting-triage'
5+
labels: 'bug'
66
assignees: ''
77

88
---

.github/workflows/development.yaml

Lines changed: 149 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,69 @@ on:
33
push:
44
branches:
55
- '**' # every branch
6+
- '!gh-pages' # exclude gh-pages branch
67
- '!stage*' # exclude branches beginning with stage
8+
tags:
9+
- '\d+\.\d+\.\d+' # only semver tags
710
pull_request:
811
branches:
912
- '**' # every branch
13+
- '!gh-pages' # exclude gh-pages branch
1014
- '!stage*' # exclude branches beginning with stage
1115
jobs:
12-
build-docs:
16+
build:
1317
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
include:
21+
- py_ver: '3.9'
22+
distro: debian
23+
image: djbase
1424
env:
25+
PY_VER: ${{matrix.py_ver}}
26+
DISTRO: ${{matrix.distro}}
27+
IMAGE: ${{matrix.image}}
1528
DOCKER_CLIENT_TIMEOUT: "120"
1629
COMPOSE_HTTP_TIMEOUT: "120"
1730
steps:
18-
- uses: actions/checkout@v2
19-
- name: Compile docs static artifacts
31+
- uses: actions/checkout@v3
32+
- name: Validate version and release notes
33+
run: |
34+
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
35+
RELEASE_BODY=$(python -c \
36+
'print(open("./CHANGELOG.md").read().split("\n\n")[1].split("\n", 1)[1])' \
37+
)
38+
echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV
39+
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
40+
echo "$RELEASE_BODY" >> $GITHUB_ENV
41+
echo "EOF" >> $GITHUB_ENV
42+
- name: Build pip artifacts
2043
run: |
2144
export HOST_UID=$(id -u)
22-
docker-compose -f ./docs-api/docker-compose.yaml up --exit-code-from docs-builder --build
23-
- name: Add docs static artifacts
24-
uses: actions/upload-artifact@v2
45+
docker-compose -f docker-compose-build.yaml up --exit-code-from app --build
46+
echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV
47+
- if: matrix.py_ver == '3.9' && matrix.distro == 'debian'
48+
name: Add pip artifacts
49+
uses: actions/upload-artifact@v3
2550
with:
26-
name: docs-api-static
27-
path: docs-api/build/html
51+
name: pip-datajoint-${{env.DJ_VERSION}}
52+
path: dist
2853
retention-days: 1
2954
test:
30-
if: github.event_name == 'push' || github.event_name == 'pull_request'
3155
runs-on: ubuntu-latest
3256
strategy:
3357
matrix:
34-
# py_ver: ["3.10"]
3558
py_ver: ["3.9"]
3659
mysql_ver: ["8.0", "5.7"]
3760
include:
38-
# - py_ver: "3.9"
39-
# mysql_ver: "5.7"
4061
- py_ver: "3.8"
4162
mysql_ver: "5.7"
4263
- py_ver: "3.7"
4364
mysql_ver: "5.7"
4465
steps:
45-
- uses: actions/checkout@v2
66+
- uses: actions/checkout@v3
4667
- name: Set up Python ${{matrix.py_ver}}
47-
uses: actions/setup-python@v2
68+
uses: actions/setup-python@v4
4869
with:
4970
python-version: ${{matrix.py_ver}}
5071
- name: Install dependencies
@@ -55,56 +76,135 @@ jobs:
5576
run: flake8 datajoint --count --select=E9,F63,F7,F82 --show-source --statistics
5677
- name: Run primary tests
5778
env:
58-
HOST_UID: "1001"
59-
GID: "121"
6079
PY_VER: ${{matrix.py_ver}}
6180
MYSQL_VER: ${{matrix.mysql_ver}}
6281
DISTRO: alpine
6382
MINIO_VER: RELEASE.2021-09-03T03-56-13Z
83+
DOCKER_CLIENT_TIMEOUT: "120"
6484
COMPOSE_HTTP_TIMEOUT: "120"
65-
run: docker-compose -f LNX-docker-compose.yml up --build --exit-code-from app
85+
run: |
86+
export HOST_UID=$(id -u)
87+
docker-compose -f LNX-docker-compose.yml up --build --exit-code-from app
6688
- name: Run style tests
6789
run: |
68-
flake8 --ignore=E203,E722,F401,W503 datajoint \
90+
flake8 --ignore=E203,E722,W503 datajoint \
6991
--count --max-complexity=62 --max-line-length=127 --statistics
7092
black datajoint --check -v
7193
black tests --check -v
7294
publish-docs:
7395
if: |
7496
github.event_name == 'push' &&
75-
(
76-
github.repository_owner == 'datajoint' ||
77-
github.repository_owner == 'datajoint-company' ||
78-
github.repository_owner == 'dj-sciops'
79-
)
80-
needs: build-docs
97+
startsWith(github.ref, 'refs/tags')
98+
needs: test
8199
runs-on: ubuntu-latest
100+
env:
101+
DOCKER_CLIENT_TIMEOUT: "120"
102+
COMPOSE_HTTP_TIMEOUT: "120"
103+
steps:
104+
- uses: actions/checkout@v3
105+
- name: Deploy docs
106+
run: |
107+
export MODE=BUILD
108+
export PACKAGE=datajoint
109+
export UPSTREAM_REPO=https://github.com/${GITHUB_REPOSITORY}.git
110+
export HOST_UID=$(id -u)
111+
docker compose -f docs/docker-compose.yaml up --exit-code-from docs --build
112+
git push origin gh-pages
113+
publish-release:
114+
if: |
115+
github.event_name == 'push' &&
116+
startsWith(github.ref, 'refs/tags')
117+
needs: test
118+
runs-on: ubuntu-latest
119+
strategy:
120+
matrix:
121+
include:
122+
- py_ver: '3.9'
123+
distro: debian
124+
image: djbase
125+
env:
126+
PY_VER: ${{matrix.py_ver}}
127+
DISTRO: ${{matrix.distro}}
128+
IMAGE: ${{matrix.image}}
129+
TWINE_USERNAME: ${{secrets.twine_username}}
130+
TWINE_PASSWORD: ${{secrets.twine_password}}
131+
DOCKER_CLIENT_TIMEOUT: "120"
132+
COMPOSE_HTTP_TIMEOUT: "120"
133+
outputs:
134+
release_upload_url: ${{steps.create_gh_release.outputs.upload_url}}
82135
steps:
83-
- uses: actions/checkout@v2
84-
- name: Fetch docs static artifacts
85-
uses: actions/download-artifact@v2
136+
- uses: actions/checkout@v3
137+
- name: Set up Python ${{matrix.py_ver}}
138+
uses: actions/setup-python@v4
86139
with:
87-
name: docs-api-static
88-
path: docs-api/build/html
89-
- name: Commit documentation changes
140+
python-version: ${{matrix.py_ver}}
141+
- name: Determine package version
90142
run: |
91-
git clone https://github.com/${GITHUB_REPOSITORY}.git \
92-
--branch gh-pages --single-branch gh-pages
93-
rm -R gh-pages/*
94-
cp -r docs-api/build/html/* gh-pages/
95-
cp .gitignore gh-pages/
96-
touch gh-pages/.nojekyll
97-
echo "docs-api.datajoint.org" > gh-pages/CNAME
98-
cd gh-pages
99-
git config --local user.email "[email protected]"
100-
git config --local user.name "GitHub Action"
101-
git add . --all
102-
git commit -m "Update documentation" -a || true
103-
# The above command will fail if no changes were present, so we ignore
104-
# the return code.
105-
- name: Push changes
106-
uses: ad-m/github-push-action@master
143+
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
144+
RELEASE_BODY=$(python -c \
145+
'print(open("./CHANGELOG.md").read().split("\n\n")[1].split("\n", 1)[1])' \
146+
)
147+
echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV
148+
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
149+
echo "$RELEASE_BODY" >> $GITHUB_ENV
150+
echo "EOF" >> $GITHUB_ENV
151+
- name: Create GH release
152+
id: create_gh_release
153+
uses: actions/create-release@v1
154+
env:
155+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
107156
with:
108-
branch: gh-pages
109-
directory: gh-pages
110-
github_token: ${{secrets.GITHUB_TOKEN}}
157+
tag_name: ${{env.DJ_VERSION}}
158+
release_name: Release ${{env.DJ_VERSION}}
159+
body: ${{env.RELEASE_BODY}}
160+
prerelease: false
161+
draft: false
162+
- name: Fetch pip artifacts
163+
uses: actions/download-artifact@v3
164+
with:
165+
name: pip-datajoint-${{env.DJ_VERSION}}
166+
path: dist
167+
- name: Determine pip artifact paths
168+
run: |
169+
echo "DJ_WHEEL_PATH=$(ls dist/datajoint-*.whl)" >> $GITHUB_ENV
170+
echo "DJ_SDIST_PATH=$(ls dist/datajoint-*.tar.gz)" >> $GITHUB_ENV
171+
- name: Upload pip wheel asset to release
172+
uses: actions/upload-release-asset@v1
173+
env:
174+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
175+
with:
176+
upload_url: ${{steps.create_gh_release.outputs.upload_url}}
177+
asset_path: ${{env.DJ_WHEEL_PATH}}
178+
asset_name: pip-datajoint-${{env.DJ_VERSION}}.whl
179+
asset_content_type: application/zip
180+
- name: Upload pip sdist asset to release
181+
uses: actions/upload-release-asset@v1
182+
env:
183+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
184+
with:
185+
upload_url: ${{steps.create_gh_release.outputs.upload_url}}
186+
asset_path: ${{env.DJ_SDIST_PATH}}
187+
asset_name: pip-datajoint-${{env.DJ_VERSION}}.tar.gz
188+
asset_content_type: application/gzip
189+
- name: Publish pip release
190+
run: |
191+
export HOST_UID=$(id -u)
192+
docker-compose -f docker-compose-build.yaml run \
193+
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \
194+
sh -lc "pip install twine && python -m twine upload dist/*"
195+
- name: Login to DockerHub
196+
uses: docker/login-action@v1
197+
with:
198+
username: ${{secrets.docker_username}}
199+
password: ${{secrets.docker_password}}
200+
- name: Publish image
201+
run: |
202+
IMAGE=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Repository}}")
203+
TAG=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Tag}}")
204+
docker push "${IMAGE}:${TAG}"
205+
docker tag "${IMAGE}:${TAG}" "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
206+
docker push "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
207+
[ "$PY_VER" == "3.9" ] && [ "$DISTRO" == "debian" ] \
208+
&& docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \
209+
&& docker push "${IMAGE}:latest" \
210+
|| echo "skipping 'latest' tag..."

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ notebook
2424
.vscode
2525
__main__.py
2626
jupyter_custom.js
27-
apk_requirements.txt
2827
.eggs
28+
*.code-workspace
29+
docs/site

CHANGELOG.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
## Release notes
22

3-
### 0.13.5 -- TBA
4-
* Update - Switch testing image from `pydev` to `djtest` PR #1012
5-
6-
### 0.13.4 -- March, 28 2022
3+
### 0.14.0 -- TBA
4+
* Bugfix - Activating a schema requires all tables to exist even if `create_tables=False` PR [#1058](https://github.com/datajoint/datajoint-python/pull/1058)
5+
* Update - Populate call with `reserve_jobs=True` to exclude `error` and `ignore` keys - PR [#1062](https://github.com/datajoint/datajoint-python/pull/1062)
6+
* Add - Support for inserting data with CSV files - PR [#1067](https://github.com/datajoint/datajoint-python/pull/1067)
7+
* Update - Switch testing image from `pydev` to `djtest` PR [#1012](https://github.com/datajoint/datajoint-python/pull/1012)
8+
9+
### 0.13.8 -- Sep 21, 2022
10+
* Add - New documentation structure based on markdown PR [#1052](https://github.com/datajoint/datajoint-python/pull/1052)
11+
* Bugfix - Fix queries with backslashes ([#999](https://github.com/datajoint/datajoint-python/issues/999)) PR [#1052](https://github.com/datajoint/datajoint-python/pull/1052)
12+
13+
### 0.13.7 -- Jul 13, 2022
14+
* Bugfix - Fix networkx incompatable change by version pinning to 2.6.3 (#1035) PR #1036
15+
* Add - Support for serializing numpy datetime64 types (#1022) PR #1036
16+
* Update - Add traceback to default logging PR #1036
17+
18+
### 0.13.6 -- Jun 13, 2022
19+
* Add - Config option to set threshold for when to stop using checksums for filepath stores. PR #1025
20+
* Add - Unified package level logger for package (#667) PR #1031
21+
* Update - Swap various datajoint messages, warnings, etc. to use the new logger. (#667) PR #1031
22+
* Bugfix - Fix query caching deleting non-datajoint files PR #1027
23+
* Update - Minimum Python version for Datajoint-Python is now 3.7 PR #1027
24+
25+
### 0.13.5 -- May 19, 2022
26+
* Update - Import ABC from collections.abc for Python 3.10 compatibility
27+
* Bugfix - Fix multiprocessing value error (#1013) PR #1026
28+
29+
### 0.13.4 -- Mar, 28 2022
730
* Add - Allow reading blobs produced by legacy 32-bit compiled mYm library for matlab. PR #995
831
* Bugfix - Add missing `jobs` argument for multiprocessing PR #997
932
* Add - Test for multiprocessing PR #1008
@@ -253,7 +276,7 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
253276

254277
### 0.3.4
255278
* Added method the `ERD.add_parts` method, which adds the part tables of all tables currently in the ERD.
256-
* `ERD() + arg` and `ERD() - arg` can now accept relation classes as arg.
279+
* `ERD() + arg` and `ERD() - arg` can now accept table classes as arg.
257280

258281
### 0.3.3
259282
* Suppressed warnings (redirected them to logging). Previoiusly, scipy would throw warnings in ERD, for example.
@@ -263,5 +286,5 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
263286

264287
### 0.3.2.
265288
* Fixed issue #223: `insert` can insert relations without fetching.
266-
* ERD() now takes the `context` argument, which specifies in which context to look for classes. The default is taken from the argument (schema or relation).
289+
* ERD() now takes the `context` argument, which specifies in which context to look for classes. The default is taken from the argument (schema or table).
267290
* ERD.draw() no longer has the `prefix` argument: class names are shown as found in the context.

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
FROM datajoint/djbase
2-
3-
COPY --chown=anaconda:anaconda . /tmp/src
4-
RUN pip install --no-cache-dir /tmp/src && \
5-
rm -rf /tmp/src
1+
ARG IMAGE=djbase
2+
ARG PY_VER=3.9
3+
ARG DISTRO=debian
4+
FROM datajoint/${IMAGE}:py${PY_VER}-${DISTRO}
5+
COPY --chown=anaconda:anaconda ./setup.py ./datajoint.pub ./requirements.txt /main/
6+
COPY --chown=anaconda:anaconda ./datajoint /main/datajoint
7+
RUN \
8+
pip install --no-cache-dir /main && \
9+
rm -r /main/*

LNX-docker-compose.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# docker-compose -f LNX-docker-compose.yml --env-file LNX.env up --exit-code-from app --build
2-
version: '2.2'
1+
# docker compose -f LNX-docker-compose.yml --env-file LNX.env up --exit-code-from app --build
2+
version: '2.4'
33
x-net: &net
44
networks:
55
- main
66
services:
77
db:
88
<<: *net
9-
image: datajoint/mysql:$MYSQL_VER
9+
image: datajoint/mysql:${MYSQL_VER}
1010
environment:
1111
- MYSQL_ROOT_PASSWORD=simple
1212
# ports:
@@ -15,7 +15,7 @@ services:
1515
# - ./mysql/data:/var/lib/mysql
1616
minio:
1717
<<: *net
18-
image: minio/minio:$MINIO_VER
18+
image: minio/minio:${MINIO_VER}
1919
environment:
2020
- MINIO_ACCESS_KEY=datajoint
2121
- MINIO_SECRET_KEY=datajoint
@@ -32,7 +32,7 @@ services:
3232
interval: 1s
3333
fakeservices.datajoint.io:
3434
<<: *net
35-
image: datajoint/nginx:v0.2.0
35+
image: datajoint/nginx:v0.2.4
3636
environment:
3737
- ADD_db_TYPE=DATABASE
3838
- ADD_db_ENDPOINT=db:3306
@@ -77,16 +77,14 @@ services:
7777
set -e
7878
pip install --user nose nose-cov
7979
pip install -e .
80-
pip freeze | grep datajoint
80+
pip list --format=freeze | grep datajoint
8181
nosetests -vsw tests --with-coverage --cover-package=datajoint
82-
# jupyter notebook
8382
# ports:
8483
# - "8888:8888"
8584
user: ${HOST_UID}:anaconda
8685
volumes:
8786
- .:/src
8887
- /tmp/.X11-unix:/tmp/.X11-unix:rw
89-
# - ./apk_requirements.txt:/tmp/apk_requirements.txt
9088
# - ./notebooks:/home/dja/notebooks
9189
networks:
9290
main:

0 commit comments

Comments
 (0)