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

Fix tox config for Girder 5 #1728

Draft
wants to merge 12 commits into
base: girder-5
Choose a base branch
from
20 changes: 13 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ executors:
toxandnode:
working_directory: ~/project
docker:
- image: girder/girder_test:py38-node16
- image: girder/tox-and-node
commands:
tox:
description: "Run tox"
Expand Down Expand Up @@ -125,6 +125,12 @@ commands:
nvm alias default << parameters.node >>
NODE_DIR=$(dirname $(which node))
echo "export PATH=$NODE_DIR:\$PATH" >> $BASH_ENV
- run:
name: Install and build large_image plugin
command: |
npm ci
npm run build
working_directory: girder/girder_large_image/web_client
- save_cache:
name: Save nvm cache
key: v1-nvm-cache-<< parameters.node >>
Expand Down Expand Up @@ -169,7 +175,7 @@ jobs:
- checkout
- allservices:
version: "3.8"
node: v14
node: v16
- tox:
toxenv: test-py38
- coverage
Expand All @@ -183,7 +189,7 @@ jobs:
- checkout
- allservices:
version: "3.9"
node: v14
node: v16
- tox:
toxenv: test-py39
- coverage
Expand All @@ -197,7 +203,7 @@ jobs:
- checkout
- allservices:
version: "3.10"
node: v14
node: v16
- tox:
toxenv: test-py310
- coverage
Expand All @@ -211,7 +217,7 @@ jobs:
- checkout
- allservices:
version: "3.11"
node: v14
node: v16
- tox:
toxenv: test-py311
- coverage
Expand All @@ -225,7 +231,7 @@ jobs:
- checkout
- allservices:
version: "3.12"
node: v14
node: v16
- tox:
toxenv: test-py312
- coverage
Expand All @@ -239,7 +245,7 @@ jobs:
- checkout
- allservices:
version: "3.13"
node: v14
node: v16
- tox:
toxenv: test-py313
environ: TOX_VERBOSE=4 TOX_PREFER_BINARY=1
Expand Down
2 changes: 1 addition & 1 deletion girder/girder_large_image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def checkForLargeImageFiles(event): # noqa
except Exception:
pass
# We couldn't automatically set this as a large image
girder.logger.info(
logger.info(
'Saved file %s cannot be automatically used as a largeImage' % str(file['_id']))


Expand Down
4 changes: 2 additions & 2 deletions girder/test_girder/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def unavailableWorker(db):
"""
Make sure that Girder Worker can't be reached and times out quickly.
"""
from girder_worker.girder_plugin.constants import PluginSettings as WorkerSettings
from girder_plugin_worker.constants import PluginSettings as WorkerSettings

from girder.models.setting import Setting

Expand Down Expand Up @@ -47,7 +47,7 @@ def girderWorker(db, girderWorkerProcess):
Run an instance of Girder worker, connected to rabbitmq. The rabbitmq
service must be running.
"""
from girder_worker.girder_plugin.constants import PluginSettings as WorkerSettings
from girder_plugin_worker.constants import PluginSettings as WorkerSettings

from girder.models.setting import Setting

Expand Down
2 changes: 1 addition & 1 deletion girder/test_girder/test_large_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from girder_jobs.models.job import Job
from girder_large_image import constants
from girder_large_image.models.image_item import ImageItem
from girder_worker.girder_plugin.status import CustomJobStatus
from girder_plugin_worker.status import CustomJobStatus

from girder import events
from girder.exceptions import ValidationException
Expand Down
49 changes: 0 additions & 49 deletions girder/test_girder/test_web_client.py

This file was deleted.

40 changes: 0 additions & 40 deletions girder_annotation/test_annotation/test_web_client.py

This file was deleted.

2 changes: 0 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Top level dependencies
girder>=3.1.18
girder-jobs>=3.0.3
-e sources/bioformats
-e sources/deepzoom
-e sources/dicom
Expand Down
6 changes: 6 additions & 0 deletions requirements-girder5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Dependencies needed from Girder 5 during prerelease
--pre
girder
girder-jobs
girder-worker
girder-plugin-worker
22 changes: 15 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,22 @@ deps =
pytest
pytest-cov
pytest-custom-exit-code
pytest-girder
pytest-girder==5.0.0a4
pytest-rerunfailures
pytest-xdist
allowlist_externals =
rm
npx
npm
cd
sh
commands_pre =
sh -c "cd girder/girder_large_image/web_client && npm run build"
# Run most tests in parallel and conflicting tests sequentially
commands =
rm -rf build/test/coverage/web_temp
girder build --dev {env:GIRDER_BUILD_OPTIONS}
# girder build --dev {env:GIRDER_BUILD_OPTIONS}
pytest --numprocesses 0 -m 'singular' --cov-config tox.ini --suppress-no-test-exit-code {posargs}
pytest --numprocesses {env:PYTEST_NUMPROCESSES:logical} -m 'not singular and not notebook' --cov-config tox.ini --cov-append --suppress-no-test-exit-code {posargs}
- npx nyc report --temp-dir build/test/coverage/web_temp --report-dir build/test/coverage --reporter cobertura --reporter text-summary
# Reduce npm chatter
setenv =
NPM_CONFIG_FUND=false
Expand All @@ -66,39 +69,44 @@ package=editable
passenv = {[testenv:test]passenv}
extras = {[testenv:test]extras}
deps =
-rrequirements-girder5.txt
-rrequirements-dev.txt
coverage
mock
pooch
pytest
pytest-cov
pytest-custom-exit-code
pytest-girder
pytest-girder==5.0.0a4
pytest-rerunfailures
pytest-xdist
numcodecs
imagecodecs
allowlist_externals = {[testenv:test]allowlist_externals}
commands_pre = {[testenv:test]commands_pre}
commands = {[testenv:test]commands}
setenv = {[testenv:test]setenv}

[testenv:monkeytype-py{38,39,310,311,312,313}]
passenv = {[testenv:test]passenv}
deps =
-rrequirements-girder5.txt
-rrequirements-dev.txt
coverage
mock
pooch
pytest
pytest-cov
pytest-custom-exit-code
pytest-girder
pytest-girder==5.0.0a5.dev117
pytest-monkeytype
pytest-rerunfailures
pytest-xdist
allowlist_externals = {[testenv:test]allowlist_externals}
commands =
rm -rf build/test/coverage/web_temp
-rm ./monkeytype.sqlite3
girder build --dev
# girder build --dev
pytest --numprocesses 0 -m 'not notebook' --no-cov --suppress-no-test-exit-code --monkeytype-output=./monkeytype.sqlite3 {posargs}
- npx nyc report --temp-dir build/test/coverage/web_temp --report-dir build/test/coverage --reporter cobertura --reporter text-summary
# After running tox, you can do
Expand Down
1 change: 0 additions & 1 deletion utilities/tasks/large_image_tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def cache_histograms_job(job):
from girder_jobs.models.job import Job
from girder_large_image.models.image_item import ImageItem

from girder import logger

kwargs = job['kwargs']
item = ImageItem().load(kwargs.pop('itemId'), force=True)
Expand Down
Loading