Make some dependency changes, support Python 3.10 and 3.11 #5611
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!5611
Loading…
Reference in a new issue
No description provided.
Delete branch "dep_changes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the changes
This PR makes a bunch of dependency changes (not just updates) and enables support for Python 3.10.
Added primary dependencies:
typing_extensions(we don't use it but we probably will in the future)yarl(we use it in our code so it shouldn't be transitive)aiodns,Brotli,orjson(some of the speedup dependencies foraiohttpanddiscord.py)Replaced dependencies:
apsw-wheelswithapswappdirsreplaced byplatformdirsNot that I don't go through changelogs of all our dependencies but I'm not a fan of this.
chardetreplaced bycharset-normalizer(transitive dependency ofaiohttp)fuzzywuzzyreplaced byrapidfuzzRemoved dependencies:
aiosqlite(this library is not used by Red anymore)PyNaCl(transitive dependency ofdiscord.py[voice]which we don't actually use)python-Levenshtein-wheels(transitive dependency offuzzywuzzywhich we replaced withrapidfuzz)The PyNaCl removal is still up for consideration, I'm not entirely sure why we have it added if we're using LL rather than d.py's own voice functionality.
Test run of updated install instructions:
Have the changes in this PR been tested?
Yes
I'm using a fork for testing some things that includes this PR, and I received this error with a brand new Python 3.10 install (installed through Brew) with a brand new venv. This is also a new Red install inside that venv. I had existing instances already configured on this device with alternate python installs and alternate venvs.
I copied my config.json from the Application Support directory to the Preferences directory and I was able to use redbot-setup.
@aikaterna thanks for testing! This should be resolved now.
I encountered the same issue on another Mac that had a Python 3.9 venv, while running
redbotand notredbot-setupbut using the changes in https://github.com/Cog-Creators/Red-DiscordBot/pull/5611/commits/7e740624382745c1e2a5198bab426e109abd4852 has resolved it.Posting the traceback for information only, in case you were interested.
Getting this traceback in my console whenever I get a CommandNotFound when I try this PR out:
Haven't run bumpdeps for the extras but I assume some of them are out of date already.
Not too sure about this one, but I have it running locally with 12.4.1 and had no issues.
I usually like to be a little more prepared with tracebacks and such when making a report like this, but I haven't been able to test the conditions fully so I thought I'd leave a note here instead. When I was installing this PR on a device that is Linux aarch64, but that is not supported by Red, I was unable to compile rapidfuzz==2.0.8 due to some compilation changes they made in the 2.x.x series, and had to use/install rapidfuzz==1.9.1 instead to get things to compile. This may not apply or may not be an issue at all on other supported OSes on aarch64, but it may be good to test this dep/PR on a system that qualifies as that designation to make sure there's no issues.
@aikaterna I was able to run this just fine on my Linux aarch64 without needing to downgrade dependencies - let me know if you want me to test anything.
That's great to hear, thanks for commenting. If everything worked properly in the regular install/build process then that's all I was concerned about.
I ran it on this branch of my fork, but I didn't change anything about rapidfuzz.
I was able to test installing this on a 32 bit Raspbian OS 11 install and it encountered build issues with ninja 1.10.2.3 which is the last pypi published version. I git cloned their newest release on their github @ 1.11 and I was able to build it with their python wrapper script with no issues (except for a couple warnings) although I couldn't get it to link properly/have this install use ninja 1.11 instead. Attached are the logs from the standard install process in case it provides any more pertinent info for this situation.
https://gist.githubusercontent.com/aikaterna/2b056087e34df2f31e5fe750c3673713/raw/5830661c0b830d007cff9a8d680c61aec6edf38a/raspbian_11_build.txt
https://gist.githubusercontent.com/aikaterna/b470fad8cef535d956475a75c3b6c2f8/raw/df19a98e047a9d7514ed2b1c213968756ee70730/ninja_1-11_build.txt
Ideally, we should switch from
apsw-wheelstoapswPyPI package in this PR as well.Right now there are no wheels for manylinux aarch64 (which is going to be fixed in next apsw release, whenever that happens) and macOS arm64 (I'm unaware of any plans for adding this right now). Before I do such change, I'll have to test that these projects are buildable from source on those platforms as well as on RPi OS 10 armv7l which can't use piwheels due to a non-default Python version being used there.
Adding a note here - the requirements in this PR are one build behind on Red-Lavalink, which will break audio compatibility with discord.py v2.
Are any PRs aside from #5924 blocking this?
Until today,
pycaresrelease soft-blocked this PR as there was no release with 3.11 wheels for macOS arm64. That has been addressed now though.Ideally, I would like to wait for Python 3.11.1 to be available on Chocolatey. However, this at the very least depends on:
It may take a while so we might need to just stick to 3.10.8 on Windows for now though. I don't want to use Python 3.11.0 as usually a lot of issues found in RC versions get deferred to
.1release.Other than that, I'll be going through changelogs of our dependencies probably sometime next week to see if there are any breaking changes I might have not accounted for already as I lost track of when was the last time I looked through them.
Ready for review. Install instructions tests pass in CI, I looked through changelogs of the updated dependencies, as well as the deprecations and removals in Python 3.10 and 3.11 changelogs.
Things to look out for during the review:
Note that the changes related to the import system (e.g.
<frozen importlib._bootstrap>:283: DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead) will come in a separate PR.Did some basic testing of stuff I usually do with Red on 3.8.5 with this PR, seems like everything is still working as I expect it to.
It works without any error on macOS on both 3.8 and 3.11.
Looks good to me go Python 3.11 go