Skip to content

Updates Sir-lancebot To Python3.9.4#683

Closed
Shivansh-007 wants to merge 14 commits into
python-discord:mainfrom
Shivansh-007:update/python3.9
Closed

Updates Sir-lancebot To Python3.9.4#683
Shivansh-007 wants to merge 14 commits into
python-discord:mainfrom
Shivansh-007:update/python3.9

Conversation

@Shivansh-007
Copy link
Copy Markdown
Contributor

@Shivansh-007 Shivansh-007 commented Apr 15, 2021

Closes #549

This PR upgrades the Python version we use for the bot to Python 3.9.4. One of the major upgrades this offers for us is that we can now use list[dict[str, str]] rather than importing typing module and then doing those ugly typing.List[Typing.Dict[str, str]] annotations.

Changes to be aware of

  • Bumps Python to 3.9 in Pipfile & lock and Docker.

  • Bumps all dependencies to the latest version, which support python3.9 and solve the breaking changes only

  • Adds super class call to LinePaginator, discord.py adds linesep argument to the Paginator in v1.7.0.

  • typing module has deprecated Iterator, Mapping, Callable, Container in python3.9, and they have to be imported from collections.abc rather now.

  • asyncio.ensure_future has been changed to asyncio.create_task as it​ is a higher level function and is more readable, and preferred over ​asyncio.ensure_future

  • loop.run_in_executor has been changed to asyncio.to_thread. It is mainly used for running IO-bound functions in a separate thread to avoid blocking the event loop, and essentially works as a high-level version of run_in_executor() that can directly take keyword arguments.

Dependency Tracker

[REMOVED] All dependencies have been tested and updated by myself and @ToxicKidz

@Shivansh-007 Shivansh-007 marked this pull request as draft April 15, 2021 05:10
@Shivansh-007 Shivansh-007 marked this pull request as ready for review April 16, 2021 06:08
@Shivansh-007
Copy link
Copy Markdown
Contributor Author

Merged python-discord/sir-lancebot:main into the PR branch to make the PR up to date with all the changes, the merge introduces no breaking change.

Copy link
Copy Markdown
Contributor

@HassanAbouelela HassanAbouelela left a comment

Choose a reason for hiding this comment

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

Preliminary block on this PR (I have not reviewed the actual content yet). This PR can not be merged yet, for the same reason our other projects can not be migrated. A lot of the dependencies you've bumped do not have wheels for 3.9 yet, which means these changes are not acceptable through no fault of your own. Without wheels, you need build tools, which significantly hurts people contributing on systems that don't have them by default (such as windows), and will not work in our CI. You can test the state of these current deps using the docker image.

@Shivansh-007
Copy link
Copy Markdown
Contributor Author

A lot of the dependencies you've bumped do not have wheels for 3.9 yet

This is not entirely correct, I tested it on docker and with pipenv, the only dependency which doesn't have python3.9 wheels is pycares.

@Xithrius Xithrius added area: backend Related to internal functionality and utilities status: stalled Something is blocking further progress type: enhancement Changes or improvements to existing features labels Apr 16, 2021
@Xithrius
Copy link
Copy Markdown
Contributor

Way too many conflicts. Best to make a new PR.

@Xithrius Xithrius closed this May 29, 2021
@Shivansh-007 Shivansh-007 deleted the update/python3.9 branch May 29, 2021 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Related to internal functionality and utilities status: stalled Something is blocking further progress type: enhancement Changes or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate an upgrade to Python 3.9.4

4 participants