Skip to content

Commit 1dcb8e0

Browse files
authored
Merge pull request #76 from zytedata/modernize
Add Python 3.12 and 3.13, drop Python 3.8, update tool versions
2 parents b25fb2b + b95d703 commit 1dcb8e0

File tree

16 files changed

+51
-54
lines changed

16 files changed

+51
-54
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1919
with:
20-
python-version: '3.x'
20+
python-version: '3.13'
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ['3.8', '3.9', '3.10', '3.11']
19+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
- name: Install dependencies
@@ -42,13 +42,13 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
python-version: ['3.11']
45+
python-version: ['3.12'] # Keep in sync with .readthedocs.yml
4646
tox-job: ["mypy", "docs"]
4747

4848
steps:
49-
- uses: actions/checkout@v2
49+
- uses: actions/checkout@v4
5050
- name: Set up Python ${{ matrix.python-version }}
51-
uses: actions/setup-python@v2
51+
uses: actions/setup-python@v5
5252
with:
5353
python-version: ${{ matrix.python-version }}
5454
- name: Install dependencies

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
repos:
22
- repo: https://github.com/PyCQA/isort
3-
rev: 5.13.1
3+
rev: 5.13.2
44
hooks:
55
- id: isort
66
- repo: https://github.com/psf/black
7-
rev: 24.3.0
7+
rev: 24.10.0
88
hooks:
99
- id: black
1010
- repo: https://github.com/pycqa/flake8
11-
rev: 7.0.0
11+
rev: 7.1.1
1212
hooks:
1313
- id: flake8
1414
- repo: https://github.com/adamchainz/blacken-docs
15-
rev: 1.16.0
15+
rev: 1.19.0
1616
hooks:
1717
- id: blacken-docs
1818
additional_dependencies:
19-
- black==24.3.0
19+
- black==24.10.0

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build:
77
tools:
88
# For available versions, see:
99
# https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python
10-
python: "3.11" # Keep in sync with .github/workflows/test.yml
10+
python: "3.12" # Keep in sync with .github/workflows/test.yml
1111
python:
1212
install:
1313
- requirements: docs/requirements.txt

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Changes
55
------------------
66

77
* Improved how the :ref:`default retry policy <default-retry-policy>` handles
8-
:ref:`temporary download errors <zyte-api-temporary-download-errors>`.
8+
:ref:`temporary download errors <zapi-temporary-download-errors>`.
99
Before, 3 HTTP 429 responses followed by a single HTTP 520 response would
1010
have prevented a retry. Now, unrelated responses and errors do not count
1111
towards the HTTP 520 retry limit.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Installation
3535
3636
pip install zyte-api
3737
38-
.. note:: Python 3.8+ is required.
38+
.. note:: Python 3.9+ is required.
3939

4040
.. install-end
4141

docs/conf.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import sys
1515
from pathlib import Path
1616

17-
import sphinx_rtd_theme
18-
1917
sys.path.insert(0, os.path.abspath("../"))
2018

2119

@@ -58,7 +56,7 @@
5856
# You can specify multiple suffix as a list of string:
5957
#
6058
# source_suffix = ['.rst', '.md']
61-
source_suffix = ".rst"
59+
source_suffix = {".rst": "restructuredtext"}
6260

6361
# The master toctree document.
6462
master_doc = "index"
@@ -86,11 +84,6 @@
8684
#
8785
html_theme = "sphinx_rtd_theme"
8886

89-
# Add any paths that contain custom themes here, relative to this directory.
90-
# Add path to the RTD explicitly to robustify builds (otherwise might
91-
# fail in a clean Debian build env)
92-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
93-
9487
# Theme options are theme-specific and customize the look and feel of a theme
9588
# further. For a list of options available for each theme, see the
9689
# documentation.

docs/use/api.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,40 +134,40 @@ The number of concurrent connections if enforced across all method calls,
134134
including different sessions of the same client.
135135

136136
For guidelines on how to choose the optimal value for you, and other
137-
optimization tips, see :ref:`zyte-api-optimize`.
137+
optimization tips, see :ref:`zapi-optimize`.
138138

139139

140140
Errors and retries
141141
==================
142142

143143
Methods of :class:`ZyteAPI` and :class:`AsyncZyteAPI` automatically handle
144-
retries for :ref:`rate-limiting <zyte-api-rate-limit>` and :ref:`unsuccessful
145-
<zyte-api-unsuccessful-responses>` responses, as well as network errors.
144+
retries for :ref:`rate-limiting <zapi-rate-limit>` and :ref:`unsuccessful
145+
<zapi-unsuccessful-responses>` responses, as well as network errors.
146146

147147
.. _retry-policy:
148148
.. _default-retry-policy:
149149

150150
The default retry policy, :data:`~zyte_api.zyte_api_retrying`, does the
151151
following:
152152

153-
- Retries :ref:`rate-limiting responses <zyte-api-rate-limit>` forever.
153+
- Retries :ref:`rate-limiting responses <zapi-rate-limit>` forever.
154154

155155
- Retries :ref:`temporary download errors
156-
<zyte-api-temporary-download-errors>` up to 3 times.
156+
<zapi-temporary-download-errors>` up to 3 times.
157157

158158
- Retries network errors until they have happened for 15 minutes straight.
159159

160160
All retries are done with an exponential backoff algorithm.
161161

162162
.. _aggressive-retry-policy:
163163

164-
If some :ref:`unsuccessful responses <zyte-api-unsuccessful-responses>` exceed
164+
If some :ref:`unsuccessful responses <zapi-unsuccessful-responses>` exceed
165165
maximum retries with the default retry policy, try using
166166
:data:`~zyte_api.aggressive_retrying` instead, which modifies the default retry
167167
policy as follows:
168168

169169
- Temporary download error are retried 7 times. :ref:`Permanent download
170-
errors <zyte-api-permanent-download-errors>` also count towards this retry
170+
errors <zapi-permanent-download-errors>` also count towards this retry
171171
limit.
172172

173173
- Retries permanent download errors up to 3 times.

docs/use/cli.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The input file can be either of the following:
3333
:http:`request:browserHtml` set to ``True``.
3434

3535
- A `JSON Lines <https://jsonlines.org/>`_ file with a object of :ref:`Zyte
36-
API request parameters <zyte-api-reference>` per line. For example:
36+
API request parameters <zapi-reference>` per line. For example:
3737

3838
.. code-block:: json
3939
@@ -84,19 +84,19 @@ order and hence distribute the load somewhat evenly:
8484
zyte-api urls.txt --shuffle …
8585
8686
For guidelines on how to choose the optimal ``--n-conn`` value for you, and
87-
other optimization tips, see :ref:`zyte-api-optimize`.
87+
other optimization tips, see :ref:`zapi-optimize`.
8888

8989

9090
Errors and retries
9191
==================
9292

9393
``zyte-api`` automatically handles retries for :ref:`rate-limiting
94-
<zyte-api-rate-limit>` and :ref:`unsuccessful
95-
<zyte-api-unsuccessful-responses>` responses, as well as network errors,
94+
<zapi-rate-limit>` and :ref:`unsuccessful
95+
<zapi-unsuccessful-responses>` responses, as well as network errors,
9696
following the :ref:`default retry policy <default-retry-policy>`.
9797

9898
Use ``--dont-retry-errors`` to disable the retrying of error responses, and
99-
retrying only :ref:`rate-limiting responses <zyte-api-rate-limit>`:
99+
retrying only :ref:`rate-limiting responses <zapi-rate-limit>`:
100100

101101
.. code-block:: shell
102102

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ profile = "black"
33
multi_line_output = 3
44

55
[tool.black]
6-
target-version = ["py38", "py39", "py310", "py311", "py312"]
6+
target-version = ["py39", "py310", "py311", "py312", "py313"]

0 commit comments

Comments
 (0)