-
Notifications
You must be signed in to change notification settings - Fork 33
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
Removal of python-future compatibility code #390
Conversation
Use isintance(x, bytes) and x.decode("utf-8")
Conflicting PR. Removed from build OMERO-python-superbuild-push#424. See the console output for more details.
|
For numerical division, use / when the result is expected to be a float or // when the floor division is desired For path concatenation, use / systematically
Use str when the input type is known to be a Python 3 string Otherwise handle both str and bytes types
ba20d6e
to
77dc7a5
Compare
This Dockerfile installs the unsupported Python 2.7 and 3.6 versions
Assigning a few people to start the code review. As discussed earlier today with @jburel, @joshmoore @pwalczysko @khaledk2 and @dominikl, the next proposed steps are:
|
Shouldn't block like
be adjusted too? (this is from |
|
The |
What about cases in |
Thanks for the feebdback. Pushed a few commits cleaning up additional Python 2/3 compatibility blocks.
In both cases, I limited the scope of this PR to non-breaking changes that would be amenable for a minor release. As for |
I was hoping to test with
|
@will-moore Glencoe Software is not using Conda so I cannot comment on the requirements to rebuild the In the spirit of the work announced recently, I have built a wheel package for testing these changes in a local Python 3.12 environment. The necessary additional patches are getting ported into the repository as we speak and we are working on getting new wheel packages for Python 3.12 released for Linux and macOS. For the latter, you might be able to give the artifacts of glencoesoftware/zeroc-ice-py-macos-universal2#2 a try. |
universal2 wheels for Ice on Python 3.12 have now been released: |
- use pre-built Ice wheel packages for Python 3.12
The last few commits consume the latest release of the pre-built Ice wheel packages and add Python 3.12 to the testing matrix. As indicated in https://docs.python.org/3/whatsnew/3.12.html, The workflow logs have several |
Similar to these, @sbesson? |
Exactly. We have quite a few of them in the docstrings of the slice generated API classes, most of them introduced in ome/openmicroscopy#4349. |
manylinux_2_28 (not usable on RHEL 7) wheels are also now available for Python 3.12: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to test locally with Python 3.12 but the newly added tests are green.
Browsing the code changes looks good - can't say I've checked every line but from what I see it's 👍
Pillow is a managed dependency of omero-py
@pwalczysko is there a quick summary of the functional testing that could be pasted here (and cross-referenced in ome/omero-web#531)? |
Testing was performed through https://docs.google.com/spreadsheets/d/1zI3vlcTLp7okz_Mi2LHK40NxwCkGXUGHgDqgCd7jP_A/edit?usp=sharing and there were no major issues connected with this PR. The minor issues were concerning the teting setup and older parts of the codebase. |
Fixes #389
Primarily motivated by the support of Python 3.12 in OMERO and given the current maintenance state of the python-future project, this reviews the OMERO.py source code to update all paths with either Python 2 or Python 2/3 logic to pure Python 3+.
future
dependency have been reviewed and cleaned up. The commits should contain some details but capturing a few specific notes on updates that might require particular attention during the reviewisbytes
andbytes_to_native_str
have been replaced byisinstance(x, bytes)
andx.decode('utf-8')
old_div
has been replaced by/
for path concatenation and either/
or//
for mathematical divisions depending on the use caselong
has been removed as it is no longer a basic type in Python 3basestring
has been replaced bystr
and/orbytes
depending on the use casebuiltins
have been cleaned up as they should be unnecessarysys.version_info
have been cleaned upThis branch has been minimally tested in an Ubuntu 22.04 deployment (Python 3.10) with OMERO.server and OMERO.web. There are a few initial questions:
future
dependency be fully removed fromsetup.py
or kept for compatibility with the downstream projects?Initially opening as a draft PR to allow and gather feedback. I propose to get in the nightly CI builds over the week-end to get extra coverage from the integration tests and fix additional outstanding issues and we can discuss the progress next week.