Skip to content

minimal set of changes to pass pylint 2.11.1 tests#2401

Merged
jdtournier merged 1 commit intomasterfrom
pylint_2.11_master
Nov 24, 2021
Merged

minimal set of changes to pass pylint 2.11.1 tests#2401
jdtournier merged 1 commit intomasterfrom
pylint_2.11_master

Conversation

@jdtournier
Copy link
Member

Follows on from discussion on #2392. Pushing to a new branch / pull request to preserve the changes originally submitted by @maxpietsch, many of which may be appropriate for dev.

This PR disables a lot of warnings to allow compatibility with Python 2. These will be re-enabled on dev with a view to dropping Python 2 support in future releases. Minor fixes have been applied where that could be done safely without affecting Python 2 compatibility, and where the changes would be expected to carry over to dev anyway.

Most of the changes boil down to disabling the warnings at the file level, along with a note to deal with them in dev. The rationale is to help identify these when merging to dev - it's otherwise difficult to work out which warnings need to be addressed and which are expected to remain disabled, when these warnings are added in the global disable line in the pylint.rc, or on a line-by-line basis. Hopefully it'll simplify the merge to dev, which I don't anticipate will be straightforward...

This disables a lot of changes to allow compatibility with Python 2.
These will be re-enabled on dev with a view to dropping Python 2 support
in future releases.
Copy link
Member

@maxpietsch maxpietsch left a comment

Choose a reason for hiding this comment

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

Looks all good to me, pylint passes, script tests pass except some 5ttgen tests because I don't have freesurfer installed.

Copy link
Member

@Lestropie Lestropie left a comment

Choose a reason for hiding this comment

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

Code looks good to me. Max's tests should suffice, the FreeSurfer-dependent parts are unlikely to suddenly expose a Python failure.

Hopefully it'll simplify the merge to dev, which I don't anticipate will be straightforward...

Not looking forward to it. I need to do a comprehensive read of all of the Python code; would actually like to implement code checks to identify and remove various code that's there for Python2 compatibility (e.g. make sure distutils.spawn.find_executable() should no longer be used). But these comde comments should actually help a little. Also need to decide on philosopohy around how things like string data and encoding/decoding will be managed throughout.

@jdtournier
Copy link
Member Author

Thanks @maxpietsch. I've also run the scripts tests on my system, using both Python 2 & 3. I get failures with 5ttgen and dwibiascorrect due to the absence of FreeSurfer and ANTs respectively, but nothing suspicious otherwise. Same result with both versions of Python.

I'll wait till @Lestropie gives the OK from his side, just on the off-chance there are still concerns.

@jdtournier jdtournier merged commit 7e58811 into master Nov 24, 2021
@jdtournier jdtournier deleted the pylint_2.11_master branch November 24, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants