fractal-analytics-platform / fractal-tasks-core

Main tasks for the Fractal analytics platform
https://fractal-analytics-platform.github.io/fractal-tasks-core/
BSD 3-Clause "New" or "Revised" License
12 stars 6 forks source link

Review support for Python 3.9.0 and 3.9.1 #543

Closed tcompa closed 8 months ago

tcompa commented 10 months ago

fractal-tasks-core likely wouldn't work with Python 3.9.0 or 3.9.1 (see https://github.com/fractal-analytics-platform/fractal-demos/issues/65).

We should verify that this is the case, and that 3.9.2 is supported. After that, I'd be in favor of requiring Python>=3.9.2 for fractal-tasks-core. This means that if fractal-server runs with 3.9.0 and the task collection is triggered with no special required python_version, task collection will fail (which is much better than the current situation, where task collection succeeds but then tasks fail).

jluethi commented 10 months ago

Let's test. I've not seen the fractal-tasks-core package actually fail with this, only some of the other task packages

tcompa commented 8 months ago
conda create --name py390 python==3.9.0
conda activate py390
pip install -e .[fractal-tasks]
pip install pytest devtools jsonschema requests wget pooch
pytest -x -v
...
======================================================================= 276 passed, 2 skipped, 1 xpassed, 478 warnings in 142.69s (0:02:22) ========================================================================

And the same for 3.9.1.

Here are the pytest logs (with warnings) for 3.9.1:

View pytest output ====================================================================================================================== warnings summary ======================================================================================================================= tests/test_unit_parse_yokogawa_metadata.py: 393 warnings tests/tasks/test_registration.py: 4 warnings tests/tasks/test_unit_task.py: 4 warnings tests/tasks/test_workflows.py: 8 warnings tests/tasks/test_workflows_cellpose_segmentation.py: 2 warnings tests/tasks/test_workflows_multiplexing.py: 12 warnings /home/tommaso/miniconda3/envs/py391/lib/python3.9/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated. Please use `np.result_type` or `np.promote_types`. See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information. (Deprecated NumPy 1.25) return np.find_common_type(types, []) tests/tasks/test_import.py::test_napari_tools_menu /home/tommaso/miniconda3/envs/py391/lib/python3.9/site-packages/napari_tools_menu/__init__.py:10: UserWarning: Importing QT failed; now introducing dummy definitions of QMenu class and register_function decorator. warnings.warn("Importing QT failed; now introducing dummy definitions of QMenu class and register_function decorator.") tests/tasks/test_import.py::test_napari_tools_menu /home/tommaso/miniconda3/envs/py391/lib/python3.9/site-packages/napari_tools_menu/__init__.py:221: UserWarning: Error in monkey patching napari. Please let @haesleinleinhuepf know at https://github.com/haesleinhuepf/napari-tools-menu/issues warnings.warn("Error in monkey patching napari. Please let @haesleinleinhuepf know at\nhttps://github.com/haesleinhuepf/napari-tools-menu/issues") tests/tasks/test_import.py::test_napari_skimage_regionprops /home/tommaso/miniconda3/envs/py391/lib/python3.9/site-packages/napari_skimage_regionprops/_table.py:7: UserWarning: No Qt bindings could be found warnings.warn(str(e)) tests/tasks/test_registration.py: 2 warnings tests/tasks/test_unit_task.py: 2 warnings tests/tasks/test_workflows.py: 4 warnings tests/tasks/test_workflows_cellpose_segmentation.py: 1 warning tests/tasks/test_workflows_multiplexing.py: 6 warnings /home/tommaso/Fractal/fractal-tasks-core/fractal_tasks_core/lib_ROI_overlaps.py:337: DeprecationWarning: In a future version, `df.iloc[:, i] = newvals` will attempt to set the values inplace instead of always setting a new array. To retain the old behavior, use either `df[df.columns[i]] = newvals` or, if columns are non-unique, `df.isetitem(i, newvals)` df.loc[well, :] = df_well.values tests/tasks/test_registration.py::test_multiplexing_registration tests/tasks/test_registration.py::test_multiplexing_registration tests/tasks/test_registration.py::test_multiplexing_registration tests/tasks/test_unit_registration_helper_functions.py::test_add_zero_translation_columns tests/tasks/test_unit_registration_helper_functions.py::test_add_zero_translation_columns tests/tasks/test_unit_registration_helper_functions.py::test_apply_registration_to_single_ROI_table tests/tasks/test_unit_registration_helper_functions.py::test_failure_apply_registration_to_single_ROI_table /home/tommaso/miniconda3/envs/py391/lib/python3.9/site-packages/pandas/core/algorithms.py:522: DeprecationWarning: np.find_common_type is deprecated. Please use `np.result_type` or `np.promote_types`. See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information. (Deprecated NumPy 1.25) common = np.find_common_type([values.dtype, comps_array.dtype], []) tests/tasks/test_registration.py::test_multiplexing_registration tests/tasks/test_unit_registration_helper_functions.py::test_calculate_min_max_across_dfs tests/tasks/test_unit_registration_helper_functions.py::test_apply_registration_to_single_ROI_table tests/tasks/test_unit_registration_helper_functions.py::test_failure_apply_registration_to_single_ROI_table /home/tommaso/Fractal/fractal-tasks-core/fractal_tasks_core/tasks/apply_registration_to_ROI_tables.py:206: RuntimeWarning: invalid value encountered in maximum np.maximum(max_df.values, table.values), tests/tasks/test_registration.py::test_multiplexing_registration tests/tasks/test_unit_registration_helper_functions.py::test_calculate_min_max_across_dfs tests/tasks/test_unit_registration_helper_functions.py::test_apply_registration_to_single_ROI_table tests/tasks/test_unit_registration_helper_functions.py::test_failure_apply_registration_to_single_ROI_table /home/tommaso/Fractal/fractal-tasks-core/fractal_tasks_core/tasks/apply_registration_to_ROI_tables.py:211: RuntimeWarning: invalid value encountered in minimum np.minimum(min_df.values, table.values), tests/tasks/test_workflows_cellpose_segmentation.py: 6 warnings tests/tasks/test_workflows_napari_workflows.py: 4 warnings /home/tommaso/miniconda3/envs/py391/lib/python3.9/site-packages/anndata/_core/anndata.py:522: FutureWarning: The dtype argument is deprecated and will be removed in late 2024. warnings.warn( tests/tasks/test_workflows_napari_workflows.py::test_napari_workflow tests/tasks/test_workflows_napari_workflows.py::test_napari_workflow tests/tasks/test_workflows_napari_workflows.py::test_relabeling[wf_relab_2-measurement_only.yaml-input_specs1-output_specs1-True] tests/tasks/test_workflows_napari_workflows.py::test_relabeling[wf_relab_2-measurement_only.yaml-input_specs1-output_specs1-True] tests/tasks/test_workflows_napari_workflows.py::test_relabeling[wf_relab_3-labeling_and_measurement.yaml-input_specs2-output_specs2-False] tests/tasks/test_workflows_napari_workflows.py::test_relabeling[wf_relab_3-labeling_and_measurement.yaml-input_specs2-output_specs2-False] tests/tasks/test_workflows_napari_workflows.py::test_napari_workflow_CYX tests/tasks/test_workflows_napari_workflows.py::test_napari_workflow_CYX /home/tommaso/miniconda3/envs/py391/lib/python3.9/site-packages/anndata/_core/anndata.py:183: ImplicitModificationWarning: Transforming to str index. warnings.warn("Transforming to str index.", ImplicitModificationWarning) tests/tasks/test_workflows_napari_workflows.py::test_relabeling[wf_relab_2-measurement_only.yaml-input_specs1-output_specs1-True] tests/tasks/test_workflows_napari_workflows.py::test_relabeling[wf_relab_2-measurement_only.yaml-input_specs1-output_specs1-True] tests/tasks/test_workflows_napari_workflows.py::test_relabeling[wf_relab_3-labeling_and_measurement.yaml-input_specs2-output_specs2-False] tests/tasks/test_workflows_napari_workflows.py::test_relabeling[wf_relab_3-labeling_and_measurement.yaml-input_specs2-output_specs2-False] /home/tommaso/miniconda3/envs/py391/lib/python3.9/site-packages/napari_skimage_regionprops/_regionprops.py:61: UserWarning: 2D labels are present in 3D label image, 'convex_area' not calculated warnings.warn("2D labels are present in 3D label image, 'convex_area' not calculated") -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ============================================================================================= 276 passed, 2 skipped, 1 xpassed, 478 warnings in 160.43s (0:02:40) =============================================================================================