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

make tests compatible with Python 3.11 #517

Merged
merged 1 commit into from Mar 28, 2023

Conversation

dotlambda
Copy link
Contributor

Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)
Description:

@asyncio.coroutine was deprecated since Python 3.8 and removed in Python 3.11.

dotlambda added a commit to dotlambda/nixpkgs that referenced this pull request Jan 20, 2023
RossComputerGuy pushed a commit to ExpidusOS/nixpkgs that referenced this pull request Jan 23, 2023
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Feb 20, 2023
https://build.opensuse.org/request/show/1066735
by user dgarcia + dimstar_suse
- Add python-311.patch to fix tests for python 3.11
  gh#urwid/urwid#517
@penguinolog
Copy link
Collaborator

This PR fixes issue with asyncio removed code. Broken compatibility with EOL python releases (before introduce of async def) should be ignored.

penguinolog pushed a commit to penguinolog/urwid that referenced this pull request Mar 28, 2023
CI related:
Update `tox.ini` and `.travis.yml` to run python3 only tests
Python 3.11 tests is commented-out on travis until urwid#517 is not merged

Manual changes:
* `setup.py`: classifiers, remove python2 compatibility code
* `docs/manual/wcur2.py`: looks like file was never completed, syntax is invalid
* `urwid.compat`: removed `ord2`, `bytes3`, `text_type`, `xrange` and `text_types`

Automatic changes (no manual editing, AST validated equality:
* removed `u` prefix from all strings: not allowed in modern python code
* `bytes()` -> `b''`
* `== None` -> `is None`
* subclassing of `object`
* `super(<Class>`, self>)` ->`super()`
* `from __future__ import ...` python3 compatibility imports
* `set(<Iterable[Hashable]>)` -> `{<Hashable>}`
* partial f-strings conversion
* (`IOError`, `select.error`, `socket.error`) -> `OSError`
@penguinolog penguinolog mentioned this pull request Mar 28, 2023
4 tasks
@penguinolog penguinolog merged commit b593cf7 into urwid:master Mar 28, 2023
@dotlambda dotlambda deleted the python311-compat branch March 28, 2023 18:15
penguinolog pushed a commit to penguinolog/urwid that referenced this pull request Mar 28, 2023
CI related:
Update `tox.ini` and `.travis.yml` to run python3 only tests
Python 3.11 tests is commented-out on travis until urwid#517 is not merged

Manual changes:
* `setup.py`: classifiers, remove python2 compatibility code
* `docs/manual/wcur2.py`: looks like file was never completed, syntax is invalid
* `urwid.compat`: removed `ord2`, `bytes3`, `text_type`, `xrange` and `text_types`

Automatic changes (no manual editing, AST validated equality:
* removed `u` prefix from all strings: not allowed in modern python code
* `bytes()` -> `b''`
* `== None` -> `is None`
* subclassing of `object`
* `super(<Class>`, self>)` ->`super()`
* `from __future__ import ...` python3 compatibility imports
* `set(<Iterable[Hashable]>)` -> `{<Hashable>}`
* partial f-strings conversion
* (`IOError`, `select.error`, `socket.error`) -> `OSError`
penguinolog pushed a commit to penguinolog/urwid that referenced this pull request Mar 29, 2023
CI related:
Update `tox.ini` and `.travis.yml` to run python3 only tests
Python 3.11 tests is commented-out on travis until urwid#517 is not merged

Manual changes:
* `setup.py`: classifiers, remove python2 compatibility code
* `docs/manual/wcur2.py`: looks like file was never completed, syntax is invalid
* `urwid.compat`: removed `ord2`, `bytes3`, `text_type`, `xrange` and `text_types`

Automatic changes (no manual editing, AST validated equality:
* removed `u` prefix from all strings: not allowed in modern python code
* `bytes()` -> `b''`
* `== None` -> `is None`
* subclassing of `object`
* `super(<Class>`, self>)` ->`super()`
* `from __future__ import ...` python3 compatibility imports
* `set(<Iterable[Hashable]>)` -> `{<Hashable>}`
* partial f-strings conversion
* (`IOError`, `select.error`, `socket.error`) -> `OSError`
penguinolog pushed a commit to penguinolog/urwid that referenced this pull request Mar 29, 2023
CI related:
Update `tox.ini` and `.travis.yml` to run python3 only tests
Python 3.11 tests is commented-out on travis until urwid#517 is not merged

Manual changes:
* `setup.py`: classifiers, remove python2 compatibility code
* `docs/manual/wcur2.py`: looks like file was never completed, syntax is invalid
* `urwid.compat`: removed `ord2`, `bytes3`, `text_type`, `xrange` and `text_types`

Automatic changes (no manual editing, AST validated equality:
* removed `u` prefix from all strings: not allowed in modern python code
* `bytes()` -> `b''`
* `== None` -> `is None`
* subclassing of `object`
* `super(<Class>`, self>)` ->`super()`
* `from __future__ import ...` python3 compatibility imports
* `set(<Iterable[Hashable]>)` -> `{<Hashable>}`
* partial f-strings conversion
* (`IOError`, `select.error`, `socket.error`) -> `OSError`
penguinolog pushed a commit to penguinolog/urwid that referenced this pull request Mar 31, 2023
CI related:
Update `tox.ini` and `.travis.yml` to run python3 only tests
Python 3.11 tests is commented-out on travis until urwid#517 is not merged

Manual changes:
* `setup.py`: classifiers, remove python2 compatibility code
* `docs/manual/wcur2.py`: looks like file was never completed, syntax is invalid
* `urwid.compat`: removed `ord2`, `bytes3`, `text_type`, `xrange` and `text_types`

Automatic changes (no manual editing, AST validated equality:
* removed `u` prefix from all strings: not allowed in modern python code
* `bytes()` -> `b''`
* `== None` -> `is None`
* subclassing of `object`
* `super(<Class>`, self>)` ->`super()`
* `from __future__ import ...` python3 compatibility imports
* `set(<Iterable[Hashable]>)` -> `{<Hashable>}`
* partial f-strings conversion
* (`IOError`, `select.error`, `socket.error`) -> `OSError`
penguinolog added a commit that referenced this pull request Mar 31, 2023
* Initial migration to the python 3.7: Semi-automatic changes

CI related:
Update `tox.ini` and `.travis.yml` to run python3 only tests
Python 3.11 tests is commented-out on travis until #517 is not merged

Manual changes:
* `setup.py`: classifiers, remove python2 compatibility code
* `docs/manual/wcur2.py`: looks like file was never completed, syntax is invalid
* `urwid.compat`: removed `ord2`, `bytes3`, `text_type`, `xrange` and `text_types`

Automatic changes (no manual editing, AST validated equality:
* removed `u` prefix from all strings: not allowed in modern python code
* `bytes()` -> `b''`
* `== None` -> `is None`
* subclassing of `object`
* `super(<Class>`, self>)` ->`super()`
* `from __future__ import ...` python3 compatibility imports
* `set(<Iterable[Hashable]>)` -> `{<Hashable>}`
* partial f-strings conversion
* (`IOError`, `select.error`, `socket.error`) -> `OSError`

* Switch to f-strings (automatic changes)

* Remove `urwid.compat.B`

* Remove `urwid.compat.with_metaclass`

* use native `super()` instead of `self.__super`

* Remove `urwid.compat.chr2`

* Remove `urwid.split_repr.python3_repr`

* Use native `@classmethod` and `@property` where overload is not possible

* Add `from __future__ import annotations`

* automatically sort imports

* Add DeprecationWarning to the deprecated methods

most IDE's will recognize it and annotate during new code usage
call with "warnings as errors" mode will help to refactor other users

* Address comments

* replace homepage address in all files
* remove outdated comments in compat.py
* make wcur2.py correct python code. For example subclass
* replace `self.__super` by `super()` in examples
* fix asyncio_socket_server.py: magic with `asyncio` became wrong

* Remove `widget.update_wrapper`: this was backport of python `functools.update_wrapper`

* display_common.py: fix trivial typo in _colors calculation

* use `sorted` method instead of list construction with later sorting

* Address comments

* `wcur2` include in docs
* warning on `signals.Signals.emit`

---------

Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants