Idea #21356
closed
Remove use of the future library across all our Python tools
Added by Brett Smith 11 months ago.
Updated 3 months ago.
Release relationship:
Auto
Description
This library was an aid for Python 2/3 compatibility and should no longer be needed. It is no longer maintained, so we need to clean this up to support more modern Python versions. None of our software should list it in install_requires
.
- Description updated (diff)
- Target version changed from Future to Development 2024-05-08 sprint
- Assigned To set to Brett Smith
- Status changed from New to In Progress
21356-clean-imports @ 873fcf181c037cc1e42419bfeaf5bb70c9d9e239 - developer-run-tests: #4193 - failed only on #21660
- All agreed upon points are implemented / addressed.
- And then some. This removes all Python 2/3 compatibility imports: all usage of the
future
and siX
compatibility libraries, as well as imports from __future__
and builtins
that are noops under Python 3. After this branch, git grep -E '\b(from|import) +(__future__|builtins|future|six)\b'
returns no results.
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- Code is tested and passing, both automated and manual, what manual testing was done is described
- Documentation has been updated.
- Behaves appropriately at the intended scale (describe intended scale).
- Probably slightly improves performance by avoiding list allocations where iteration is sufficient.
- Considered backwards and forwards compatibility issues between client and server.
- Super technically every time I change
basestring
to str
that's a potential compatibility break, because bytes
also counts as basestring
. However, in most cases I was able to convince myself that the code was only intended to handle str
in Python 3 anyway, so that seemed like the clearest shift. There was one module deep in the CWL weeds where that wasn't true and so the checks became isinstance(x, (bytes, str))
.
- Follows our coding standards and GUI style guidelines.
- Yes, and did some opportunistic imports cleanup to better follow PEP 8.
Brett Smith wrote in #note-5:
21356-clean-imports @ 873fcf181c037cc1e42419bfeaf5bb70c9d9e239 - developer-run-tests: #4193 - failed only on #21660
- All agreed upon points are implemented / addressed.
- And then some. This removes all Python 2/3 compatibility imports: all usage of the
future
and siX
compatibility libraries, as well as imports from __future__
and builtins
that are noops under Python 3. After this branch, git grep -E '\b(from|import) +(__future__|builtins|future|six)\b'
returns no results.
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- Code is tested and passing, both automated and manual, what manual testing was done is described
- Documentation has been updated.
- Behaves appropriately at the intended scale (describe intended scale).
- Probably slightly improves performance by avoiding list allocations where iteration is sufficient.
- Considered backwards and forwards compatibility issues between client and server.
- Super technically every time I change
basestring
to str
that's a potential compatibility break, because bytes
also counts as basestring
. However, in most cases I was able to convince myself that the code was only intended to handle str
in Python 3 anyway, so that seemed like the clearest shift. There was one module deep in the CWL weeds where that wasn't true and so the checks became isinstance(x, (bytes, str))
.
- Follows our coding standards and GUI style guidelines.
- Yes, and did some opportunistic imports cleanup to better follow PEP 8.
This LGTM
- Status changed from In Progress to Resolved
Also available in: Atom
PDF