Update deps, allow Python 3.9, drop Fedora 32 (#5121)

* Update deps + allow Python 3.9

* Add in updates from Jack's branch

* Fix multiple target for cross-reference warnings

* Update a few more Python 3.8 occurrences

* Bump further

* Don't install tox in CodeQL environment

* Bump Python version in docs to 3.9.7

* more bumps

* Add missing pin

* Stop using the deprecated distro.linux_distribution()

* Suppress deprecation warning

* Fix OpenSUSE Leap instructions

* Drop Fedora 32

* Add Python 3.10-dev to CI

* meh

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
palmtree5
2021-09-06 08:43:29 -08:00
committed by GitHub
parent 0dded8aa47
commit 3254698c78
14 changed files with 141 additions and 90 deletions

View File

@@ -531,7 +531,7 @@ async def test_config_value_atomicity(config):
await asyncio.sleep(0.1)
await config.foo.set(foo)
tasks.append(func())
tasks.append(asyncio.create_task(func()))
await asyncio.wait(tasks, return_when=asyncio.ALL_COMPLETED)
@@ -549,7 +549,7 @@ async def test_config_ctxmgr_atomicity(config):
foo.append(0)
await asyncio.sleep(0.1)
tasks.append(func())
tasks.append(asyncio.create_task(func()))
await asyncio.wait(tasks, return_when=asyncio.ALL_COMPLETED)

View File

@@ -1,5 +1,9 @@
import importlib.metadata
import pkg_resources
import os
import sys
import pytest
from redbot import core
from redbot.core import VersionInfo
@@ -39,7 +43,24 @@ def test_version_info_gt():
assert VersionInfo.from_str(version_tests[1]) > VersionInfo.from_str(version_tests[0])
def test_python_version_has_upper_and_lower_bound():
def test_python_version_has_lower_bound():
"""
Due to constant issues in support with Red being installed on a Python version that was not
supported by any Red version, it is important that we have both an upper and lower bound set.
"""
requires_python = importlib.metadata.metadata("Red-DiscordBot")["Requires-Python"]
assert requires_python is not None
# `pkg_resources` needs a regular requirement string, so "x" serves as requirement's name here
req = pkg_resources.Requirement.parse(f"x{requires_python}")
assert any(op in (">", ">=") for op, version in req.specs)
@pytest.mark.skipif(
os.getenv("TOX_RED", False) and sys.version_info >= (3, 10),
reason="Testing on yet to be supported Python version.",
)
def test_python_version_has_upper_bound():
"""
Due to constant issues in support with Red being installed on a Python version that was not
supported by any Red version, it is important that we have both an upper and lower bound set.
@@ -50,4 +71,3 @@ def test_python_version_has_upper_and_lower_bound():
# `pkg_resources` needs a regular requirement string, so "x" serves as requirement's name here
req = pkg_resources.Requirement.parse(f"x{requires_python}")
assert any(op in ("<", "<=") for op, version in req.specs)
assert any(op in (">", ">=") for op, version in req.specs)