ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
21 stars 32 forks source link

Add support for Python 3.11 #385

Closed sbesson closed 10 months ago

sbesson commented 11 months ago

Python 3.11 has been released over a year ago and is available across several operating systems. This PR includes a minimal set of changes allowing OMERO.py to be functinal with Python 3.11.

Summary of changes

The biggest impact of the Python 3.11 was found to be in the dependencies of OMERO.py rather than the codebase itself

Testing

With this PR included, all CI builds and tests should keep passing. In addition, tt should be possible to use OMERO.py as a client as well as deploying OMERO.server in a Python 3.11 virtual environment.

Impact & open questions

jburel commented 11 months ago

https://github.com/ome/omero-py/commit/614a2e2cb0904fe9514353281d9bd1a0bd23a8a5 directly impacts OMERO.py integration tests maintained under https://github.com/ome/openmicroscopy. If no objection, I can open a companion Pull Request with the corresponding adjustments to use pytest-mock. Unlike the GitHub worklow builds, this might require additional infrastructure work to install the new dependency in the Jenkins CI environment where the integration tests are executed

It will make sense to adjust the tests under https://github.com/ome/openmicroscopy. We have several repositories using mox3 e.g. omego, scc, cli-render. Is the idea to dispatch the work?

The OMERO-test-integration and OMERO-training jobs will need to be adjusted.

Regarding the test mentioned above test/unit/clitest/test_admin.py. The tests could probably be migrated under https://github.com/ome/openmicroscopy. Outside the scope of this PR

jburel commented 11 months ago

mox3 should also be removed from https://github.com/ome/omero-py/blob/d22225fb21994e53569e9eab162eae29402b4b6d/docs/conf.py#L61

jburel commented 11 months ago

tests_require=[ 'pytest', 'mox3', ], in setup.py will need to be adjusted accordingly

sbesson commented 11 months ago

It will make sense to adjust the tests under https://github.com/ome/openmicroscopy.

Opened as https://github.com/ome/openmicroscopy/pull/6369. I can open associated devspace PRs if needed but eventually defer to you guys on when/how these changes should be integrated into the CI environment.

We have several repositories using mox3 e.g. omego, scc, cli-render. Is the idea to dispatch the work?

The primary intent was to have OMERO working on Python 3.11. The mox3 removal really comes as a requirement as soon as tests are executed against Python 3.11 but I can certainly look into auditing the OMERO plugin repositories as I expect the changes are minimal. omego and scc are outside this scope of this work from my side.

jburel commented 11 months ago

Regarding devspace, i will update my working branch (rocky9 support) which is what we are moving towards

sbesson commented 11 months ago
tests_require=[ 'pytest', 'mox3', ], in setup.py will need to be adjusted accordingly

As shown by the builds of https://github.com/ome/omero-py/pull/385/commits/8360c3fc1772875021c17dbc41dc7174362e417f, an unfortunate side-effect is that the omero admin unit tests currently skipped by GitHub Actions and discussed in the description of this PR depended on mox3 for the MockCLI class.

https://github.com/ome/omero-py/pull/385/commits/d378c3907d322eece79b07713b77792d97156fa0 tackles the problem by rewriting these tests to use the mock package and get rid entirely of test/unit/clitest/mocks.py. These tests are passing in my local environment so hopefully they are in much better place to be migrated into the appropriate location as a follow-up of this work.

jburel commented 11 months ago

Note that b4a5342 is required to get the test green in omero-web with Python 3.11 cc @knabar

jburel commented 10 months ago

Discussed today. Merging and tagging as 5.17.0