From 994c0648b3781b1a94254c1f429a323460bbbbe3 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 25 Oct 2022 09:18:55 -0400 Subject: [PATCH] Test on Python 3.11 Note that the nd2 and tifffile sources require manually installing some packages; these will be updated when appropriate wheels for testing exist on pypi. The tests don't check if Girder plugins work with Python 3.11 (yet). I think that girder_worker needs some changes to install on 3.11. --- .circleci/config.yml | 34 +++++++++++++++++++++++++++++----- girder/setup.py | 1 + girder_annotation/setup.py | 1 + setup.py | 1 + sources/bioformats/setup.py | 1 + sources/deepzoom/setup.py | 1 + sources/dummy/setup.py | 1 + sources/gdal/setup.py | 1 + sources/mapnik/setup.py | 1 + sources/multi/setup.py | 1 + sources/nd2/setup.py | 3 ++- sources/ometiff/setup.py | 1 + sources/openjpeg/setup.py | 1 + sources/openslide/setup.py | 1 + sources/pil/setup.py | 1 + sources/test/setup.py | 1 + sources/tiff/setup.py | 1 + sources/tifffile/setup.py | 5 +++-- sources/vips/setup.py | 1 + test.Dockerfile | 2 +- test/test_converter.py | 4 ++++ test/test_source_base.py | 7 +++++-- test/test_source_multi.py | 3 +++ test/test_source_nd2.py | 2 ++ tox.ini | 8 ++++---- utilities/converter/setup.py | 3 ++- utilities/tasks/setup.py | 1 + 27 files changed, 72 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b7e1244ce..ff93ec939 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -136,7 +136,7 @@ jobs: steps: - checkout - allservices: - version: 3.7.14 + version: 3.7.15 node: v12 - tox: env: test-py37 @@ -149,7 +149,7 @@ jobs: steps: - checkout - allservices: - version: 3.8.14 + version: 3.8.15 node: v12 - tox: env: test-py38 @@ -162,7 +162,7 @@ jobs: steps: - checkout - allservices: - version: 3.9.14 + version: 3.9.15 node: v12 - tox: env: test-py39 @@ -175,13 +175,26 @@ jobs: steps: - checkout - allservices: - version: 3.10.7 + version: 3.10.8 node: v12 - tox: env: test-py310 - coverage - store_artifacts: path: build/test/artifacts + py311: + machine: + image: ubuntu-2004:202111-02 + steps: + - checkout + - allservices: + version: 3.11.0 + node: v12 + - tox: + env: core-py311 + - coverage + - store_artifacts: + path: build/test/artifacts lint_and_docs: executor: toxandnode steps: @@ -293,6 +306,13 @@ workflows: branches: ignore: - gh-pages + - py311: + filters: + tags: + only: /^v.*/ + branches: + ignore: + - gh-pages - lint_and_docs: filters: tags: @@ -306,7 +326,8 @@ workflows: - py37 - py38 - py39 - # - py310 + - py310 + # - py311 - lint_and_docs filters: tags: @@ -321,6 +342,7 @@ workflows: - py38 - py39 - py310 + - py311 - lint_and_docs filters: tags: @@ -334,6 +356,7 @@ workflows: - py38 - py39 - py310 + - py311 - lint_and_docs filters: tags: @@ -357,5 +380,6 @@ workflows: - py38 - py39 - py310 + - py311 - lint_and_docs - wheels diff --git a/girder/setup.py b/girder/setup.py index 26d9d3cee..e9894c859 100644 --- a/girder/setup.py +++ b/girder/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ 'girder>=3.0.4', diff --git a/girder_annotation/setup.py b/girder_annotation/setup.py index aa91b33d8..8a4e82ba3 100644 --- a/girder_annotation/setup.py +++ b/girder_annotation/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ 'jsonschema>=2.5.1', diff --git a/setup.py b/setup.py index 8660345ad..b1214c8a6 100644 --- a/setup.py +++ b/setup.py @@ -89,6 +89,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ 'cachetools>=3.0.0', diff --git a/sources/bioformats/setup.py b/sources/bioformats/setup.py index 62cc0f8a4..30a60cb84 100644 --- a/sources/bioformats/setup.py +++ b/sources/bioformats/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/deepzoom/setup.py b/sources/deepzoom/setup.py index 0aa2d39db..35743ba86 100644 --- a/sources/deepzoom/setup.py +++ b/sources/deepzoom/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/dummy/setup.py b/sources/dummy/setup.py index e0bc16c1f..fb5c40006 100644 --- a/sources/dummy/setup.py +++ b/sources/dummy/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/gdal/setup.py b/sources/gdal/setup.py index aaa861c8d..b7f80ce9c 100644 --- a/sources/gdal/setup.py +++ b/sources/gdal/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/mapnik/setup.py b/sources/mapnik/setup.py index 256a9a33e..6ee71c2b5 100644 --- a/sources/mapnik/setup.py +++ b/sources/mapnik/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/multi/setup.py b/sources/multi/setup.py index 6759ab23e..dbc362845 100644 --- a/sources/multi/setup.py +++ b/sources/multi/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ 'jsonschema', diff --git a/sources/nd2/setup.py b/sources/nd2/setup.py index 0ca542e5b..aecac8e14 100644 --- a/sources/nd2/setup.py +++ b/sources/nd2/setup.py @@ -49,11 +49,12 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + # 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', 'dask[array]', - 'nd2[legacy]>=0.2.3 ; python_version >= "3.7"', + 'nd2[legacy]>=0.2.3 ; python_version >= "3.7" and python_version < "3.11"', 'importlib-metadata<5 ; python_version < "3.8"', ], extras_require={ diff --git a/sources/ometiff/setup.py b/sources/ometiff/setup.py index 2ddc0f8bb..d9c0f727c 100644 --- a/sources/ometiff/setup.py +++ b/sources/ometiff/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/openjpeg/setup.py b/sources/openjpeg/setup.py index dd9937af5..6a0dcd54c 100644 --- a/sources/openjpeg/setup.py +++ b/sources/openjpeg/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/openslide/setup.py b/sources/openslide/setup.py index 05004ed3d..4208a54e3 100644 --- a/sources/openslide/setup.py +++ b/sources/openslide/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/pil/setup.py b/sources/pil/setup.py index 1db241ce1..f4c71f284 100644 --- a/sources/pil/setup.py +++ b/sources/pil/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/test/setup.py b/sources/test/setup.py index a2a17cda7..8e5ca54a0 100644 --- a/sources/test/setup.py +++ b/sources/test/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/tiff/setup.py b/sources/tiff/setup.py index 39dacecb5..1dfe04df8 100644 --- a/sources/tiff/setup.py +++ b/sources/tiff/setup.py @@ -50,6 +50,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', diff --git a/sources/tifffile/setup.py b/sources/tifffile/setup.py index e9ea52cdd..4d1980d13 100644 --- a/sources/tifffile/setup.py +++ b/sources/tifffile/setup.py @@ -49,12 +49,13 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + # 'Programming Language :: Python :: 3.11', ], install_requires=[ f'large-image{limit_version}', 'dask[array]', - 'tifffile[all]', - 'zarr ; python_version >= "3.8"', + 'tifffile[all] ; python_version < "3.11"', + 'zarr ; python_version >= "3.8" and python_version < "3.11"', 'zarr<2.11 ; python_version < "3.8"', 'importlib-metadata<5 ; python_version < "3.8"', ], diff --git a/sources/vips/setup.py b/sources/vips/setup.py index 1991d6ec8..2a37eba4c 100644 --- a/sources/vips/setup.py +++ b/sources/vips/setup.py @@ -42,6 +42,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ 'large-image', diff --git a/test.Dockerfile b/test.Dockerfile index ecd22db59..e70bb5b31 100644 --- a/test.Dockerfile +++ b/test.Dockerfile @@ -13,7 +13,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ LANG=en_US.UTF-8 \ PYENV_ROOT="/.pyenv" \ PATH="/.pyenv/bin:/.pyenv/shims:$PATH" \ - PYTHON_VERSIONS="3.9.14 3.8.14 3.7.14 3.6.15 3.10.7" + PYTHON_VERSIONS="3.9.15 3.8.15 3.7.15 3.6.15 3.10.8 3.11.0" RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/test/test_converter.py b/test/test_converter.py index 5434de1f9..fe84c60fd 100644 --- a/test/test_converter.py +++ b/test/test_converter.py @@ -1,6 +1,7 @@ import json import os import shutil +import sys import large_image_converter import large_image_converter.__main__ as main @@ -247,6 +248,7 @@ def testConverterMainNonImageFile(tmpdir): assert not os.path.exists(outputPath) +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='requires scikit-image') def testConverterMainStats(tmpdir): testDir = os.path.dirname(os.path.realpath(__file__)) imagePath = os.path.join(testDir, 'test_files', 'yb10kx5k.png') @@ -257,6 +259,7 @@ def testConverterMainStats(tmpdir): assert 'conversion_stats' in desc['large_image_converter'] +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='requires scikit-image') def testConverterMainFullStats(tmpdir): imagePath = datastore.fetch('sample_Easy1.png') outputPath = os.path.join(tmpdir, 'out.tiff') @@ -266,6 +269,7 @@ def testConverterMainFullStats(tmpdir): assert 'psnr' in desc['large_image_converter']['conversion_stats'] +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='requires scikit-image') def testConverterMainFullStatsWithWebp(tmpdir): imagePath = datastore.fetch('d042-353.crop.small.float32.tif') outputPath = os.path.join(tmpdir, 'out.tiff') diff --git a/test/test_source_base.py b/test/test_source_base.py index dc685d7c2..837d8b060 100644 --- a/test/test_source_base.py +++ b/test/test_source_base.py @@ -62,15 +62,18 @@ 'noread': r'\.(nc|nd2|yml|yaml|json|czi|png|svs|scn)$', 'skipTiles': r'(sample_image\.ptif|one_layer_missing_tiles|JK-kidney_B-gal_H3_4C_1-500sec\.jp2|extraoverview)'}, # noqa } -if sys.version_info >= (3, 7): +if sys.version_info >= (3, 7) and sys.version_info < (3, 11): SourceAndFiles.update({ 'nd2': {'read': r'\.(nd2)$'}, + }) +if sys.version_info >= (3, 7) and sys.version_info < (3, 11): + SourceAndFiles.update({ 'tifffile': { 'read': r'', 'noread': r'\.(nc|nd2|yml|yaml|json|czi|png|jpeg|jp2)$', }, }) -else: +if sys.version_info < (3, 7): # Python 3.6 has an older version of PIL that won't read some of the # ome.tif files. SourceAndFiles['pil']['noread'] = SourceAndFiles['pil']['noread'][:-1] + '|sample.*ome)' diff --git a/test/test_source_multi.py b/test/test_source_multi.py index 1e1db475d..bea5b3422 100644 --- a/test/test_source_multi.py +++ b/test/test_source_multi.py @@ -74,6 +74,7 @@ def testTilesFromMultiSimpleScaling(): @pytest.mark.skipif(sys.version_info < (3, 7), reason='requires python >= 3.7 for a sub-source') +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='requires python3.11 wheels') def testTilesFromMultiMultiSource(multiSourceImagePath): imagePath = multiSourceImagePath source = large_image_source_multi.open(imagePath) @@ -124,6 +125,7 @@ def testTilesFromMultiString(): @pytest.mark.skipif(sys.version_info < (3, 7), reason='requires python >= 3.7 for a sub-source') +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='requires python3.11 wheels') def testInternalMetadata(multiSourceImagePath): imagePath = multiSourceImagePath source = large_image_source_multi.open(imagePath) @@ -132,6 +134,7 @@ def testInternalMetadata(multiSourceImagePath): @pytest.mark.skipif(sys.version_info < (3, 7), reason='requires python >= 3.7 for a sub-source') +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='requires python3.11 wheels') def testAssociatedImages(multiSourceImagePath): imagePath = multiSourceImagePath source = large_image_source_multi.open(imagePath) diff --git a/test/test_source_nd2.py b/test/test_source_nd2.py index bed765ec9..cae9eac10 100644 --- a/test/test_source_nd2.py +++ b/test/test_source_nd2.py @@ -8,6 +8,7 @@ @pytest.mark.skipif(sys.version_info < (3, 7), reason='requires python3.7 or higher') +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='requires python3.11 wheels') def testTilesFromND2(): imagePath = datastore.fetch('ITGA3Hi_export_crop2.nd2') source = large_image_source_nd2.open(imagePath) @@ -31,6 +32,7 @@ def testTilesFromND2(): @pytest.mark.skipif(sys.version_info < (3, 7), reason='requires python3.7 or higher') +@pytest.mark.skipif(sys.version_info >= (3, 11), reason='requires python3.11 wheels') def testInternalMetadata(): imagePath = datastore.fetch('ITGA3Hi_export_crop2.nd2') source = large_image_source_nd2.open(imagePath) diff --git a/tox.ini b/tox.ini index 8900894f1..38f9457ef 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - test-py{36,37,38,39,310} + test-py{36,37,38,39,310,311} docs flake8 lintclient @@ -50,7 +50,7 @@ setenv = PIP_FIND_LINKS=https://girder.github.io/large_image_wheels GDAL_PAM_ENABLED=no -[testenv:test-py{36,37,38,39,310}] +[testenv:test-py{36,37,38,39,310,311}] deps = {[testenv:test]deps} whitelist_externals = {[testenv:test]whitelist_externals} commands = {[testenv:test]commands} @@ -63,7 +63,7 @@ commands = pytest -m 'singular and not girder_client' --cov-config tox.ini --suppress-no-test-exit-code {posargs} pytest --numprocesses logical -m 'not singular and not girder_client' --cov-config tox.ini --cov-append --suppress-no-test-exit-code {posargs} -[testenv:server-py{36,37,38,39,310}] +[testenv:server-py{36,37,38,39,310,311}] deps = {[testenv:server]deps} commands = {[testenv:server]commands} @@ -84,7 +84,7 @@ commands = pytest -m 'singular and not girder' --cov-config tox.ini --suppress-no-test-exit-code {posargs} pytest --numprocesses logical -m 'not singular and not girder' --cov-config tox.ini --cov-append --suppress-no-test-exit-code {posargs} -[testenv:core-py{36,37,38,39,310}] +[testenv:core-py{36,37,38,39,310,311}] deps = {[testenv:core]deps} commands = {[testenv:core]commands} diff --git a/utilities/converter/setup.py b/utilities/converter/setup.py index c024a4869..ef120acd4 100644 --- a/utilities/converter/setup.py +++ b/utilities/converter/setup.py @@ -55,6 +55,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ 'gdal', @@ -74,7 +75,7 @@ def prerelease_local_scheme(version): ], 'stats': [ 'packaging', - 'scikit-image', + 'scikit-image ; python_version < "3.11"', ], }, packages=find_packages(), diff --git a/utilities/tasks/setup.py b/utilities/tasks/setup.py index 6a50c82cd..7b1d3c0e4 100644 --- a/utilities/tasks/setup.py +++ b/utilities/tasks/setup.py @@ -55,6 +55,7 @@ def prerelease_local_scheme(version): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], install_requires=[ # Packages required by both producer and consumer side installations