Skip to content

Commit eec49c9

Browse files
TPT-4765: Raise minimum supported Python to 3.11 (#757)
* TPT-4765: Require Python 3.11 * TPT-4765: Default E2E workflow to Python 3.11
1 parent c204913 commit eec49c9

10 files changed

Lines changed: 12 additions & 38 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: ubuntu-latest
6060
strategy:
6161
matrix:
62-
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
62+
python-version: ['3.11', '3.12', '3.13', '3.14', '3.15']
6363
steps:
6464
- uses: actions/checkout@v7
6565
- uses: actions/setup-python@v7

‎.github/workflows/e2e-test.yml‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ on:
4141
python-version:
4242
description: 'Specify the Python version to use for running tests. Leave empty to use the default Python version configured in the environment'
4343
required: false
44-
run-eol-python-version:
45-
description: 'Indicates whether to run tests using an End-of-Life (EOL) Python version. Defaults to "false". Choose "true" to include tests for deprecated Python versions'
46-
required: false
47-
default: 'false'
48-
type: choice
49-
options:
50-
- 'true'
51-
- 'false'
5244
test_report_upload:
5345
description: 'Indicates whether to upload the test report to object storage. Defaults to "false"'
5446
type: choice
@@ -63,8 +55,7 @@ on:
6355
- dev
6456

6557
env:
66-
DEFAULT_PYTHON_VERSION: "3.13"
67-
EOL_PYTHON_VERSION: "3.10"
58+
DEFAULT_PYTHON_VERSION: "3.11"
6859
EXIT_STATUS: 0
6960

7061
jobs:
@@ -89,7 +80,7 @@ jobs:
8980
- name: Setup Python
9081
uses: actions/setup-python@v7
9182
with:
92-
python-version: ${{ inputs.run-eol-python-version == 'true' && env.EOL_PYTHON_VERSION || inputs.python-version || env.DEFAULT_PYTHON_VERSION }}
83+
python-version: ${{ inputs.python-version || env.DEFAULT_PYTHON_VERSION }}
9384

9485
- name: Install Python deps
9586
run: pip install -U setuptools wheel boto3 certifi

‎.github/workflows/release-cross-repo-test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Set up Python
2828
uses: actions/setup-python@v7
2929
with:
30-
python-version: '3.10'
30+
python-version: '3.13'
3131

3232
- name: Checkout ansible repo
3333
uses: actions/checkout@v7

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Source of Truth
44

55
- This is the official synchronous Python SDK for the Linode API. Supported
6-
Python versions come from [pyproject.toml](pyproject.toml) (`>=3.10`).
6+
Python versions come from [pyproject.toml](pyproject.toml) (`>=3.11`).
77
- Make changes only in canonical source trees such as `linode_api4/`, `test/`,
88
`docs/`, `examples/`, and `.github/`. Do not edit generated copies or output in
99
`build/`, `dist/`, `docs/build/`, `docs/_build/`, or `linode_api4.egg-info/`.

‎linode_api4/groups/linode.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def stackscripts(self, *filters, **kwargs):
9797
:returns: A list of StackScripts matching the query.
9898
:rtype: PaginatedList of StackScript
9999
"""
100-
# python2 can't handle *args and a single keyword argument, so this is a workaround
101100
if "mine_only" in kwargs:
102101
if kwargs["mine_only"]:
103102
new_filter = Filter({"mine": True})

‎linode_api4/login_client.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
import re
22
from datetime import datetime, timedelta
33
from enum import Enum
4+
from urllib.parse import urlencode, urlparse, urlunparse
45

56
import requests
67

78
from linode_api4.errors import ApiError
89

9-
try:
10-
from urllib.parse import urlencode, urlparse, urlunparse
11-
except ImportError:
12-
from urllib import urlencode
13-
14-
from urlparse import urlparse, urlunparse
15-
1610

1711
class AllWrapper:
1812
def __repr__(self):

‎linode_api4/objects/account.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,6 @@ def set_thumbnail(self, thumbnail):
494494
"Content-type": "image/png",
495495
}
496496

497-
# TODO this check needs to be smarter - python2 doesn't do it right
498497
if not isinstance(thumbnail, bytes):
499498
with open(thumbnail, "rb") as f:
500499
thumbnail = f.read()

‎linode_api4/objects/linode.py‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import copy
44
import string
5-
import sys
65
import warnings
76
from dataclasses import dataclass, field
87
from datetime import datetime
@@ -1292,15 +1291,10 @@ def resize(
12921291

12931292
@staticmethod
12941293
def generate_root_password():
1295-
def _func(value):
1296-
if sys.version_info[0] < 3:
1297-
value = int(value.encode("hex"), 16)
1298-
return value
1299-
13001294
password = "".join(
13011295
[
1302-
PASSWORD_CHARS[_func(c) % len(PASSWORD_CHARS)]
1303-
for c in urandom(randint(50, 110))
1296+
PASSWORD_CHARS[value % len(PASSWORD_CHARS)]
1297+
for value in urandom(randint(50, 110))
13041298
]
13051299
)
13061300

‎linode_api4/objects/serializable.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,6 @@ class StrEnum(str, Enum):
272272
"""
273273
Used for enums that are of type string, which is necessary
274274
for implicit JSON serialization.
275-
276-
NOTE: Replace this with StrEnum once Python 3.10 has been EOL'd.
277-
See: https://docs.python.org/3/library/enum.html#enum.StrEnum
278275
"""
279276

280277
def __new__(cls, *values):

‎pyproject.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name = "linode_api4"
88
authors = [{ name = "Linode", email = "devs@linode.com" }]
99
description = "The official Python SDK for Linode API v4"
1010
readme = "README.rst"
11-
requires-python = ">=3.10"
11+
requires-python = ">=3.11"
1212
keywords = [
1313
"akamai",
1414
"Akamai Connected Cloud",
@@ -25,11 +25,11 @@ classifiers = [
2525
"License :: OSI Approved :: BSD License",
2626
"Programming Language :: Python",
2727
"Programming Language :: Python :: 3",
28-
"Programming Language :: Python :: 3.10",
2928
"Programming Language :: Python :: 3.11",
3029
"Programming Language :: Python :: 3.12",
3130
"Programming Language :: Python :: 3.13",
3231
"Programming Language :: Python :: 3.14",
32+
"Programming Language :: Python :: 3.15",
3333
]
3434
dependencies = ["requests", "polling", "deprecated"]
3535
dynamic = ["version"]
@@ -49,7 +49,7 @@ int-test = [
4949
"cryptography",
5050
]
5151
lint = [
52-
"black>=23.1.0",
52+
"black>=26.10.1",
5353
"isort>=5.12.0",
5454
"autoflake>=2.0.1",
5555
"pylint",
@@ -85,7 +85,7 @@ line_length = 80
8585

8686
[tool.black]
8787
line-length = 80
88-
target-version = ["py310", "py311", "py312", "py313", "py314"]
88+
target-version = ["py311", "py312", "py313", "py314", "py315"]
8989

9090
[tool.autoflake]
9191
expand-star-imports = true

0 commit comments

Comments
 (0)