Skip to content

Commit 8bc3374

Browse files
committed
Merge PR burnash#1541: Support Python 3.12 and 3.13
This PR adds Python 3.12 and 3.13 support while dropping end-of-life Python 3.8. It updates multiple development dependencies to versions compatible with newer Python releases. Key changes: - Adds Python 3.12 and 3.13 to supported versions - Removes Python 3.8 from CI/testing - Updates dependencies: isort, black, mypy, bandit, google-auth, etc. - All 149 tests pass on Python 3.12/3.13 Status: Safe to merge - well tested, configuration/version updates only
2 parents c6fb9ff + 01bea39 commit 8bc3374

10 files changed

Lines changed: 30 additions & 25 deletions

File tree

.github/workflows/main.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python: ["3.8", "3.9", "3.10", "3.11", "3.x"]
20+
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.x"]
2121
steps:
2222
- uses: actions/checkout@v4
2323
- uses: actions/setup-python@v5
@@ -26,6 +26,7 @@ jobs:
2626
- run: pip install -U pip
2727
- run: pip install -U bandit pyupgrade pip-audit tox setuptools
2828
- run: bandit --recursive --skip B105,B110,B311,B605,B607 --exclude ./.tox .
29+
if: ${{ matrix.python >= '3.9' }}
2930
- run: tox -e lint
3031
- run: tox -e py
3132
- run: shopt -s globstar && pyupgrade --py3-only **/*.py # --py36-plus

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup python
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.9"
20+
python-version: "3.10"
2121
- name: Setup tox
2222
run: pip install tox
2323
- name: Run linter

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ tests/creds.json
99

1010
# virtualenv
1111
env/
12+
.venv*/
1213

1314
# tox
1415
.tox/

HISTORY.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ Release History
4747
------------------
4848

4949
* remove dependency on requests-2.27.0
50+
* Full Changelog: https://github.com/burnash/gspread/compare/v6.1.3...v6.1.4
5051

51-
6.1.3 (2024-10-03)
52+
6.1.3 (2024-10-04)
5253
------------------
5354

5455
* ignore jinja CVE by @lavigne958 in https://github.com/burnash/gspread/pull/1481
@@ -129,7 +130,7 @@ New Contributor
129130
* Bump isort from 5.11.4 to 5.12.0 by @dependabot in https://github.com/burnash/gspread/pull/1165
130131
* bump flake8 to 6.0.0 by @alifeee in https://github.com/burnash/gspread/pull/1236
131132
* merge master into 6.0.0 by @lavigne958 in https://github.com/burnash/gspread/pull/1241
132-
* Remplace named tuples with enums by @lavigne958 in https://github.com/burnash/gspread/pull/1250
133+
* Replace named tuples with enums by @lavigne958 in https://github.com/burnash/gspread/pull/1250
133134
* Feature/add type hints worksheets by @lavigne958 in https://github.com/burnash/gspread/pull/1254
134135
* Implement hex color conversion by @idonec in https://github.com/burnash/gspread/pull/1270
135136
* remove lastUpdateTime by @alifeee in https://github.com/burnash/gspread/pull/1295
@@ -455,7 +456,7 @@ ter Christian Clauss <cclauss@me.com> 1630103641 +0200 (#869 by @cclaus)
455456

456457
* fix editor_users_emails - get only from list not all users added to spreadsheet (#939 by @Lukasz)
457458

458-
* add shadow method to get a named range from a speadsheet instance (#941 by @lavigne958)
459+
* add shadow method to get a named range from a spreadsheet instance (#941 by @lavigne958)
459460

460461
* auto_resize_columns (#948 by @FelipeSantos75)
461462

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Features:
3232
pip install gspread
3333
```
3434

35-
Requirements: Python 3.8+.
35+
Requirements: Python 3.9+.
3636

3737
## Basic Usage
3838

@@ -64,7 +64,7 @@ wks.format('A1:B1', {'textFormat': {'bold': True}})
6464

6565
### Upgrade from Python 3.7
6666

67-
Python 3.7 is [end-of-life](https://devguide.python.org/versions/). gspread v6 requires a minimum of Python 3.8.
67+
Python 3.8 is [end-of-life](https://devguide.python.org/versions/). gspread v6 requires a minimum of Python 3.9.
6868

6969
### Change `Worksheet.update` arguments
7070

lint-requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
bandit==1.7.10
2-
black==24.8.0
3-
codespell==2.2.5
1+
bandit==1.8.2
2+
black==25.1.0
3+
codespell==2.4.1
44
flake8==7.1.1
5-
isort==5.12.0
6-
mypy==1.11.2
5+
isort==6.0.0
6+
mypy==1.14.1
77
mypy-extensions==1.0.0
88
typing_extensions==4.12.2

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ keywords = ["spreadsheets", "google-spreadsheets", "google-sheets"]
1414
classifiers = [
1515
"Programming Language :: Python",
1616
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.8",
1817
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
2122
"License :: OSI Approved :: MIT License",
2223
"Operating System :: OS Independent",
2324
"Development Status :: 5 - Production/Stable",
@@ -27,8 +28,8 @@ classifiers = [
2728
"Topic :: Office/Business :: Financial :: Spreadsheet",
2829
"Topic :: Software Development :: Libraries :: Python Modules",
2930
]
30-
dependencies = ["google-auth>=1.12.0", "google-auth-oauthlib>=0.4.1"]
31-
requires-python = ">=3.8"
31+
dependencies = ["google-auth>=2.38.0", "google-auth-oauthlib>=1.2.1"]
32+
requires-python = ">=3.9"
3233
dynamic = ["version", "description"]
3334

3435
[project.urls]

test-requirements.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
google-auth==1.12.0
2-
google-auth-oauthlib==0.4.1
3-
vcrpy
1+
google-auth==2.38.0
2+
google-auth-oauthlib==1.2.1
3+
vcrpy==7.0.0
44
pytest
55
pytest-vcr
6-
urllib3==1.26.15
6+
urllib3==1.26.20; python_version == "3.9"
7+
urllib3==2.3.0; python_version >= "3.10"

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_method_name(self_id: str) -> str:
4343

4444

4545
def ignore_retry_requests(
46-
response: Dict[str, Dict[str, int]]
46+
response: Dict[str, Dict[str, int]],
4747
) -> Optional[Dict[str, Dict[str, int]]]:
4848
SKIP_RECORD = [408, 429]
4949
if response["status"]["code"] in SKIP_RECORD:

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py38,py39,py310,py311,py312
2+
envlist = py39,py310,py311,py312,py313
33
skip_missing_interpreters = true
44

55
# Used to run tests, **do not** set GS_CREDS_FILENAME to run off-line tests
@@ -14,21 +14,21 @@ commands = pytest {posargs} tests/
1414

1515
[flake8]
1616
extend-ignore = E203
17-
extend-exclude = .tox,./env,./gspread/__init__.py
17+
extend-exclude = .tox,./env,./gspread/__init__.py,./.venv*
1818
max-line-length = 255
1919
max-complexity = 10
2020
show-source = True
2121
statistics = True
2222

2323
[isort]
24-
extend_skip=.tox,./env,./gspread/__init__.py
25-
profile=black
24+
extend_skip_glob = .tox,./env,.venv*,./gspread/__init__.py
25+
profile = black
2626

2727
# Used by the CI to check code format/security
2828
[testenv:lint]
2929
description = Run code linters
3030
deps = -r lint-requirements.txt
31-
commands = black --check --diff --extend-exclude="./env|gspread/__init__.py" .
31+
commands = black --check --diff --color --extend-exclude="./env|gspread/__init__.py" .
3232
codespell --skip=".tox,.git,./docs/build,.mypy_cache,./env" .
3333
flake8 .
3434
isort --check-only .

0 commit comments

Comments
 (0)