Skip to content

Commit 5245124

Browse files
Merge pull request #1012 from A-Baji/switch-to-djtest
Update testing image from pydev to djtest
2 parents 3b6e845 + 9823355 commit 5245124

17 files changed

+60
-68
lines changed

.github/workflows/development.yaml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
strategy:
1919
matrix:
2020
include:
21-
- py_ver: 3.8
22-
distro: alpine
21+
- py_ver: '3.9'
22+
distro: debian
2323
image: djbase
2424
env:
2525
PY_VER: ${{matrix.py_ver}}
@@ -28,7 +28,7 @@ jobs:
2828
DOCKER_CLIENT_TIMEOUT: "120"
2929
COMPOSE_HTTP_TIMEOUT: "120"
3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
- name: Validate version and release notes
3333
run: |
3434
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
@@ -44,9 +44,9 @@ jobs:
4444
export HOST_UID=$(id -u)
4545
docker-compose -f docker-compose-build.yaml up --exit-code-from app --build
4646
echo "DJ_VERSION=${DJ_VERSION}" >> $GITHUB_ENV
47-
- if: matrix.py_ver == '3.8' && matrix.distro == 'alpine'
47+
- if: matrix.py_ver == '3.9' && matrix.distro == 'debian'
4848
name: Add pip artifacts
49-
uses: actions/upload-artifact@v2
49+
uses: actions/upload-artifact@v3
5050
with:
5151
name: pip-datajoint-${{env.DJ_VERSION}}
5252
path: dist
@@ -55,13 +55,15 @@ jobs:
5555
runs-on: ubuntu-latest
5656
strategy:
5757
matrix:
58-
py_ver: ["3.8"]
58+
py_ver: ["3.9"]
5959
mysql_ver: ["8.0", "5.7"]
6060
include:
61+
- py_ver: "3.8"
62+
mysql_ver: "5.7"
6163
- py_ver: "3.7"
6264
mysql_ver: "5.7"
6365
steps:
64-
- uses: actions/checkout@v2
66+
- uses: actions/checkout@v3
6567
- name: Set up Python ${{matrix.py_ver}}
6668
uses: actions/setup-python@v4
6769
with:
@@ -76,14 +78,12 @@ jobs:
7678
env:
7779
PY_VER: ${{matrix.py_ver}}
7880
MYSQL_VER: ${{matrix.mysql_ver}}
79-
ALPINE_VER: "3.10"
81+
DISTRO: alpine
8082
MINIO_VER: RELEASE.2021-09-03T03-56-13Z
83+
DOCKER_CLIENT_TIMEOUT: "120"
8184
COMPOSE_HTTP_TIMEOUT: "120"
82-
COVERALLS_SERVICE_NAME: travis-ci
83-
COVERALLS_REPO_TOKEN: fd0BoXG46TPReEem0uMy7BJO5j0w1MQiY
8485
run: |
8586
export HOST_UID=$(id -u)
86-
export HOST_GID=$(id -g)
8787
docker-compose -f LNX-docker-compose.yml up --build --exit-code-from app
8888
- name: Run style tests
8989
run: |
@@ -101,7 +101,7 @@ jobs:
101101
DOCKER_CLIENT_TIMEOUT: "120"
102102
COMPOSE_HTTP_TIMEOUT: "120"
103103
steps:
104-
- uses: actions/checkout@v2
104+
- uses: actions/checkout@v3
105105
- name: Deploy docs
106106
run: |
107107
export MODE=BUILD
@@ -119,8 +119,8 @@ jobs:
119119
strategy:
120120
matrix:
121121
include:
122-
- py_ver: 3.8
123-
distro: alpine
122+
- py_ver: '3.9'
123+
distro: debian
124124
image: djbase
125125
env:
126126
PY_VER: ${{matrix.py_ver}}
@@ -133,7 +133,7 @@ jobs:
133133
outputs:
134134
release_upload_url: ${{steps.create_gh_release.outputs.upload_url}}
135135
steps:
136-
- uses: actions/checkout@v2
136+
- uses: actions/checkout@v3
137137
- name: Set up Python ${{matrix.py_ver}}
138138
uses: actions/setup-python@v4
139139
with:
@@ -160,7 +160,7 @@ jobs:
160160
prerelease: false
161161
draft: false
162162
- name: Fetch pip artifacts
163-
uses: actions/download-artifact@v2
163+
uses: actions/download-artifact@v3
164164
with:
165165
name: pip-datajoint-${{env.DJ_VERSION}}
166166
path: dist
@@ -192,3 +192,19 @@ jobs:
192192
docker-compose -f docker-compose-build.yaml run \
193193
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \
194194
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ __main__.py
2626
jupyter_custom.js
2727
.eggs
2828
*.code-workspace
29-
docs/site
29+
docs/site

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Bugfix - Activating a schema requires all tables to exist even if `create_tables=False` PR [#1058](https://github.com/datajoint/datajoint-python/pull/1058)
55
* Update - Populate call with `reserve_jobs=True` to exclude `error` and `ignore` keys - PR [#1062](https://github.com/datajoint/datajoint-python/pull/1062)
66
* 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)
78

89
### 0.13.8 -- Sep 21, 2022
910
* Add - New documentation structure based on markdown PR [#1052](https://github.com/datajoint/datajoint-python/pull/1052)

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
ARG PY_VER=3.8
2-
ARG DISTRO=alpine
31
ARG IMAGE=djbase
2+
ARG PY_VER=3.9
3+
ARG DISTRO=debian
44
FROM datajoint/${IMAGE}:py${PY_VER}-${DISTRO}
5-
WORKDIR /main
6-
COPY --chown=anaconda:anaconda ./requirements.txt ./setup.py \
7-
/main/
8-
COPY --chown=anaconda:anaconda ./datajoint/*.py /main/datajoint/
5+
COPY --chown=anaconda:anaconda ./setup.py ./datajoint.pub ./requirements.txt /main/
6+
COPY --chown=anaconda:anaconda ./datajoint /main/datajoint
97
RUN \
10-
umask u+rwx,g+rwx,o-rwx && \
11-
pip install --no-cache-dir . && \
12-
rm -R ./*
13-
CMD ["python"]
8+
pip install --no-cache-dir /main && \
9+
rm -r /main/*

LNX-docker-compose.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# docker compose -f LNX-docker-compose.yml --env-file LNX.env up --exit-code-from app --build
2-
version: '2.2'
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
@@ -51,7 +51,7 @@ services:
5151
condition: service_healthy
5252
app:
5353
<<: *net
54-
image: datajoint/pydev:${PY_VER}-alpine${ALPINE_VER}
54+
image: datajoint/djtest:py${PY_VER}-${DISTRO}
5555
depends_on:
5656
fakeservices.datajoint.io:
5757
condition: service_healthy
@@ -69,23 +69,19 @@ services:
6969
- PYTHON_USER=dja
7070
- JUPYTER_PASSWORD=datajoint
7171
- DISPLAY
72-
- COVERALLS_SERVICE_NAME
73-
- COVERALLS_REPO_TOKEN
7472
working_dir: /src
7573
command:
7674
- sh
7775
- -c
7876
- |
7977
set -e
80-
pip install --user -r test_requirements.txt
78+
pip install --user nose nose-cov
8179
pip install -e .
82-
pip freeze | grep datajoint
80+
pip list --format=freeze | grep datajoint
8381
nosetests -vsw tests --with-coverage --cover-package=datajoint
84-
coveralls
85-
# jupyter notebook
8682
# ports:
8783
# - "8888:8888"
88-
user: ${HOST_UID}:${HOST_GID}
84+
user: ${HOST_UID}:anaconda
8985
volumes:
9086
- .:/src
9187
- /tmp/.X11-unix:/tmp/.X11-unix:rw

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,11 @@ the same command as above, but replace `up --build` with `down`.
128128

129129
* Create an `.env` with desired development environment values e.g.
130130
``` sh
131-
PY_VER=3.7
132-
ALPINE_VER=3.10
131+
PY_VER=3.9
133132
MYSQL_VER=5.7
134-
MINIO_VER=RELEASE.2021-09-03T03-56-13Z
133+
DISTRO=alpine
134+
MINIO_VER=RELEASE.2022-01-03T18-22-58Z
135135
HOST_UID=1000
136-
HOST_GID=1000
137136
```
138137
* `cp local-docker-compose.yml docker-compose.yml`
139138
* `docker-compose up -d` (Note configured `JUPYTER_PASSWORD`)

datajoint/diagram.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class Diagram(nx.DiGraph):
9494
"""
9595

9696
def __init__(self, source, context=None):
97-
9897
if isinstance(source, Diagram):
9998
# copy constructor
10099
self.nodes_to_show = set(source.nodes_to_show)
@@ -302,7 +301,6 @@ def _make_graph(self):
302301
return graph
303302

304303
def make_dot(self):
305-
306304
graph = self._make_graph()
307305
graph.nodes()
308306

datajoint/heading.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ def _init_from_database(self):
273273

274274
# additional attribute properties
275275
for attr in attributes:
276-
277276
attr.update(
278277
in_key=(attr["in_key"] == "PRI"),
279278
database=database,

datajoint/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262

6363

6464
class Config(collections.abc.MutableMapping):
65-
6665
instance = None
6766

6867
def __init__(self, *args, **kwargs):

docker-compose-build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PY_VER=3.8 IMAGE=djbase DISTRO=alpine DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) HOST_UID=$(id -u) docker compose -f docker-compose-build.yaml up --exit-code-from app --build
1+
# PY_VER=3.9 IMAGE=djbase DISTRO=debian DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) HOST_UID=$(id -u) docker compose -f docker-compose-build.yaml up --exit-code-from app --build
22
#
33
# Intended for updating dependencies and docker image.
44
# Used to build release artifacts.
@@ -17,7 +17,7 @@ services:
1717
- .:/main
1818
command:
1919
- sh
20-
- -lc
20+
- -c
2121
- |
2222
set -e
2323
rm -R build dist *.egg-info || echo "No prev build"

0 commit comments

Comments
 (0)