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

Removal of python-future compatibility code #531

Merged
merged 23 commits into from
Mar 1, 2024

Conversation

knabar
Copy link
Member

@knabar knabar commented Feb 6, 2024

This PR implements issue #528 to review the OMERO.web source code to update all paths with either Python 2 or Python 2/3 logic to pure Python 3+, similar to @sbesson's work for OMERO.py at ome/omero-py#390.

@knabar knabar force-pushed the maint-python2-cleanup branch from 13115ca to 43a887f Compare February 7, 2024 20:52
@knabar
Copy link
Member Author

knabar commented Feb 7, 2024

@sbesson I have gotten to the point where tests are now failing because the underlying omero-py is not Python 3.12 compatible, so we have to coordinate somehow

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a code review perspective, the series of changes proposed here look good and I think we are ready to include this the nightly OME CI builds and schedule a formal round of functional testing.

For #531, one possible temporary approach to run the tests on Python 3.12 would be sbesson@2edac67. Once we have an omero-py release with Python 3.12 support, this commit will need to be reverted. I suspect we'll also want to update

"omero-py>=5.7.0",
.

omeroweb/settings.py Show resolved Hide resolved
tox.ini Show resolved Hide resolved
@knabar knabar force-pushed the maint-python2-cleanup branch from f0c5f6b to 52c84a6 Compare February 8, 2024 15:49
@knabar knabar marked this pull request as ready for review February 8, 2024 15:58
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the caveat that the temporary commit pointing to my branch should be updated before merging, all changes look sensible to me from an initial code review. I'll let the OME team schedule the functional testing of this set of maintenance/Python 3.12 support PR.

@jburel
Copy link
Member

jburel commented Feb 9, 2024

2edac67 broke today's installation of omero-server. It highlights an issue in the ci-build

@sbesson
Copy link
Member

sbesson commented Feb 9, 2024

I think the issue is with 52c84a6 rather than the tox.ini change which is unused by OME CI as far as I know. Here's the failing workflow as I understand it:

I suspect force pushing away 52c84a6 should be sufficient to keep testing this PR through GitHub actions (as per the tox.ini workflow) and meet the requirement of the OME Jenkins pipeline.

@jburel
Copy link
Member

jburel commented Feb 9, 2024

I have now removed the excluded label since I found the issue in the CI job leading to the unexpected behaviour

@jburel
Copy link
Member

jburel commented Feb 9, 2024

Sorry yes, wrong cut and paste.
Problem is sorted now
note that this is not due to the misconfiguration of the JENKINS_URL

No need to force push the commit

@jburel
Copy link
Member

jburel commented Feb 9, 2024

The JENKINS_URL has been reviewed in ome/devspace@1859719

@jburel
Copy link
Member

jburel commented Feb 9, 2024

See ome/devspace@096b024 for the adjustment (new CI)
Similar changes made to merge-ci https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-server/402/

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build OMERO-python-superbuild-push#2. See the console output for more details.
Possible conflicts:

--conflicts

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build OMERO-python-superbuild-push#452. See the console output for more details.
Possible conflicts:

--conflicts

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build OMERO-python-superbuild-push#3. See the console output for more details.
Possible conflicts:

--conflicts

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build OMERO-python-superbuild-push#453. See the console output for more details.
Possible conflicts:

--conflicts

@snoopycrimecop
Copy link
Member

snoopycrimecop commented Feb 12, 2024

Conflicting PR. Removed from build OMERO-python-superbuild-push#454. See the console output for more details.
Possible conflicts:

--conflicts Conflict resolved in build OMERO-python-superbuild-push#4. See the console output for more details.

@knabar knabar added this to the 5.25.0 milestone Feb 26, 2024
@jburel
Copy link
Member

jburel commented Feb 27, 2024

What is the reason for dropping Python 3.8 from the testing matrix?

@knabar
Copy link
Member Author

knabar commented Feb 27, 2024

What is the reason for dropping Python 3.8 from the testing matrix?

Just an oversight, I made a mistake undoing the removal.

@@ -296,8 +295,8 @@ def set_if(k, v, func=lambda a: a is not None):

def decode(shape_field):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment line 382 could probably be removed now

# Handle string for python2 and bytes python3. TODO: lower level fix

@knabar knabar requested a review from jburel March 1, 2024 12:56
Copy link
Member

@pwalczysko pwalczysko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Copy link
Member

@will-moore will-moore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.
Just one TODO to cleanup but not a blocker 👍

if value is not None and isinstance(value, str) and len(value) > 0:
value = str(
smart_str(value)
) # TODO: This is probably a noop now
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if isinstance(value, str) then we don't need to do anything - can pass here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably left it in because I wasn't sure that smart_str would not do something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting this is a deprecated form (scheduled for removal in a future version) so I would not spend extensive time fixing it.

@knabar knabar merged commit 4d8d25e into ome:master Mar 1, 2024
10 checks passed
@knabar knabar deleted the maint-python2-cleanup branch March 11, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

6 participants