Python 2 Cleanup tracking issue
See original GitHub issueA list of cleanups and improvements we can make when dropping python 2.
Relates to #767. Maintainers, please add items to this list / edit the list to link PRs.
Easy changes:
If you’re a new contributor, these are a great place to start.
- Adjust (#1337) https://github.com/cocotb/cocotb/blob/9caf77cb6ceae739858ecd4a3760631470aac77c/setup.py#L59
- Change minimum supported version in documentation (gh-1341)
- Remove 2.7 version from Travis CI setup
- Remove reference from
tox.ini
- Remove function
isclose
fromtests/test_cases/test_cocotb/test_cocotb.py
(#1489) - Combine
cocotb_test
andcocotb_test_35
testbenches (#1489) - Remove
from __future__ import
line from Python files (but notMakefile.pylib.*
) (gh-1579) - Remove
(object)
fromclass MyClass(object):
(gh-1579) - use
type(self)
instead ofself.__class__
. (gh-1579) - Use
__class__.__qualname__
instead of__class__.__name__
- Remove all
__nonzero__
functions which alias__bool__
(gh-1579) - Remove 2x “# NOTE: isclose is a Python 3.5+ feature” from
documentation/source/coroutines.rst
(gh-1576) - Update/check installation instructions in documentation and READM
- Remove the conditional compilation here: https://github.com/cocotb/cocotb/blob/ad1e718eab6a107b56c47032f53f282f7d2dbae0/examples/endian_swapper/cosim/io.c#L116.
- Marginal:
- make
u""
strings normal strings (e.g. indocumentation/source/conf.py
) (gh-1579) - Move to format string language instead of using old modulus string formatting.
- make
More involved
- Delete https://github.com/cocotb/cocotb/blob/master/cocotb/share/lib/simulator/simulatormodule_python2.c, and merge https://github.com/cocotb/cocotb/blob/master/cocotb/share/lib/simulator/simulatormodule_python3.c with https://github.com/cocotb/cocotb/blob/master/cocotb/share/lib/simulator/simulatormodule.c (#1342)
- Removes internal uses of
cocotb./_py_compat
(#1434) - Remove
cocotb.outcome
hacks for python 2 (re__traceback__
)s (gh-1338) - Clean up “Before Python 3.3” part in
documentation/source/coroutines.rst
(#1341) - Remove
PY_MAJOR_VERSION < 3
code ingpi_embed.c
- Remove or deprecate function
ReturnValue
incocotb/cocotb/result.py
(#1489)- Remove usage of function
ReturnValue
in our tests and examples - Remove internal uses of
ReturnValue
(gh-1440)
- Remove usage of function
- Replace
reject_remaining_kwargs
with direct syntax (#1339) - Change coroutines to use
async def
, to teach good practice, in:-
tests(filed separately as gh-1731) - docs (gh-1576)
-
examples(filed separately as gh-1730)
-
Very involved
- Fix all of the “binary string” interfaces to actually use
bytes
-
cocotb.utils.hexdump
(gh-1519) -
cocotb.utils.hexdiffs
(gh-1519) -
BinaryValue.buff
(gh-1514) -
cocotb.generators.byte
(gh-1493)(gh-1514) - All of the drivers that produce binary data streams (#1545, gh-1514) (h
-
- Change all library coroutines to use
async def
, for speed (gh-1523) -
Add type annotations (for user-facing code)Filed separately as gh-1582
Issue Analytics
- State:
- Created 4 years ago
- Comments:25 (25 by maintainers)
Top Results From Across the Web
multiprocessing cleanup occasionally throws exception
Approximately 3,300 runs on Python 2.7.9 on the same machine have not resulted in any crashes. I now built 3.4.3 from source using...
Read more >Should we auto-close Python 2.7 bugs in 2020? - Core Workflow
If a Python2-only issue is active for less than 6 months, I suggest to leave it open and wait until it becomes inactive...
Read more >Issue 5679: cleanUp stack for unittest - Python tracker
[see the two where-it-breaks sequences below]. The issue is that cleanups are not connected to the inheritance heirarchy.
Read more >Issue 17703: Trashcan mechanism segfault during interpreter ...
This issue tracker has been migrated to GitHub, and is currently read-only. ... It's the only way to do module cleanup in Python...
Read more >Issue 22427: TemporaryDirectory attempts to clean up twice
Issue 22427: TemporaryDirectory attempts to clean up twice - Python tracker. This issue tracker has been migrated to GitHub, and is currently ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eric-wieser I was documenting the interfaces on #1526 when I ran into this, which is why it has no annotations.
Not all of those are strictly cleanup:
from __future__ import
line from Python files (but notMakefile.pylib.*
)(object)
fromdef MyClass(object):
__class__.__qualname__
instead of__class__.__name__