Skip to content

Commit

Permalink
feat: add Python 3.11 support
Browse files Browse the repository at this point in the history
Read the Python support from the .python-version file to keep a single
source of truth.
  • Loading branch information
Kyle-Verhoog committed Sep 26, 2023
1 parent c2580e7 commit cc8af27
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
13 changes: 10 additions & 3 deletions riotfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
from riot import latest


SUPPORTED_PYTHON_VERSIONS = ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
with open("tests/.python-version", "r") as f:
SUPPORTED_PYTHON_VERSIONS = [
"%s.%s" % (v[0], v[1])
for v in [v.split(".") for v in sorted(f.read().splitlines())]
]


venv = Venv(
venvs=[
Expand All @@ -15,9 +20,11 @@
"sphinx": "==5.1.1",
"alabaster": "==0.7.12",
},
pys=SUPPORTED_PYTHON_VERSIONS[2:],
pys=[p for p in SUPPORTED_PYTHON_VERSIONS if p >= "3.6"],
),
Venv(
pys=[p for p in SUPPORTED_PYTHON_VERSIONS if p <= "3.5"],
),
Venv(pys=SUPPORTED_PYTHON_VERSIONS[:2]),
],
pkgs={"pytest": latest},
command="pytest {cmdargs}",
Expand Down
18 changes: 10 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
long_description = f.read()


with open("tests/.python-version", "r") as f:
python_versions = sorted(f.read().splitlines())

min_python_version = python_versions[0].split(".")

setup(
name="envier",
description="Python application configuration via the environment",
Expand All @@ -14,19 +19,16 @@
author_email="[email protected]",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
+ [
"Programming Language :: Python :: %s.%s" % (v[0], v[1])
for v in [v.split(".") for v in python_versions]
],
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
packages=find_packages(exclude=["tests*"]),
python_requires=">=2.7",
python_requires=">=%s.%s" % (min_python_version[0], min_python_version[1]),
install_requires=["typing; python_version<'3.5'"],
extras_require={"mypy": ["mypy"]},
setup_requires=["setuptools_scm"],
Expand Down

0 comments on commit cc8af27

Please sign in to comment.