Skip to content

Commit 4094f75

Browse files
Release 4.1.0
### Added - Python 3.13 support. ### Changed - `amazoncaptcha` is now an optional dependency. Install with `pip install amazon-orders[captcha]` to enable Captcha auto-solve (only compatible with Python <=3.12. When not installed, Captcha challenges fall back to manual entry. ### Deprecated - Captcha auto-solve via `amazoncaptcha` is likely to be removed in the future, since Amazon has continued to phase out OCR-style Captchas in favor of WAF.
1 parent 3881751 commit 4094f75

11 files changed

Lines changed: 122 additions & 21 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
os: [ ubuntu-latest, macos-latest, windows-latest ]
3131
python-version: [ "3.12" ]
3232
include:
33+
- python-version: "3.13"
34+
os: ubuntu-latest
3335
- python-version: "3.11"
3436
os: ubuntu-latest
3537
- python-version: "3.9"
@@ -51,6 +53,31 @@ jobs:
5153
- name: Test
5254
run: make test
5355

56+
build-captcha:
57+
name: Build (3.12, [captcha] extra)
58+
59+
env:
60+
FORCE_COLOR: 1
61+
PYTHONUNBUFFERED: 1
62+
PYTHONDONTWRITEBYTECODE: 1
63+
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/checkout@v6
68+
- name: Set up Python 3.12
69+
uses: actions/setup-python@v6
70+
with:
71+
python-version: "3.12"
72+
- name: Install jpeg
73+
run: sudo apt-get install -y libjpeg-dev zlib1g-dev
74+
- name: Install with [captcha] extra
75+
run: |
76+
python -m pip install --upgrade pip
77+
python -m pip install ".[dev,captcha]"
78+
- name: Test
79+
run: python -m pytest -v --ignore=tests/integration
80+
5481
validate:
5582
name: Validate
5683
uses: ./.github/workflows/validate.yml

.github/workflows/release.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ on:
1717

1818
permissions:
1919
contents: write
20-
pull-requests: read
2120

2221
jobs:
2322
prereq:
@@ -26,11 +25,9 @@ jobs:
2625
bump_type: ${{ inputs.bump_type }}
2726
version_file: 'amazonorders/__init__.py'
2827
version_pattern: 's/^__version__ = ".*"/__version__ = "${VERSION}"/'
29-
additional_bump_command: |
30-
sed -i "s/==${OLD_VERSION}/==${NEW_VERSION}/g" docs/index.rst
31-
grep -q "==${NEW_VERSION}" docs/index.rst || { echo "::error::Version bump failed in docs/index.rst"; exit 1; }
32-
sed -i "s/==${OLD_VERSION}/==${NEW_VERSION}/g" README.md
33-
grep -q "==${NEW_VERSION}" README.md || { echo "::error::Version bump failed in README.md"; exit 1; }
28+
additional_bump_files: |
29+
docs/index.rst
30+
README.md
3431
repo_slug: alexdlaird/amazon-orders
3532
secrets:
3633
bot_app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
@@ -98,8 +95,6 @@ jobs:
9895
needs: [prereq, release]
9996
if: always() && needs.prereq.result == 'success'
10097
uses: alexdlaird/.github/.github/workflows/release-cleanup.yml@main
101-
with:
102-
squash_boundary: ${{ needs.prereq.outputs.squash_boundary }}
10398
secrets:
10499
bot_app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
105100
bot_private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,32 @@ All notable changes to this project will be documented in this file.
44

55
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased](https://github.com/alexdlaird/amazon-orders/compare/4.0.19...HEAD)
7+
## [Unreleased](https://github.com/alexdlaird/amazon-orders/compare/4.1.0...HEAD)
8+
9+
## [4.1.0](https://github.com/alexdlaird/amazon-orders/compare/4.0.19...4.1.0) - 2026-05-03
10+
11+
### Added
12+
13+
- Python 3.13 support.
14+
15+
### Changed
16+
17+
- `amazoncaptcha` is now an optional dependency. Install with `pip install amazon-orders[captcha]` to enable Captcha auto-solve (only compatible with Python <=3.12. When not installed, Captcha challenges fall back to manual entry.
18+
19+
### Deprecated
20+
21+
- Captcha auto-solve via `amazoncaptcha` is likely to be removed in the future, since Amazon has continued to phase out OCR-style Captchas in favor of WAF.
822

923
## [4.0.19](https://github.com/alexdlaird/amazon-orders/compare/4.0.18...4.0.19) - 2026-04-29
1024

1125
### Added
1226

1327
- Build and stability improvements.
1428

29+
### Added
30+
31+
- Build and stability improvements.
32+
1533
## [4.0.18](https://github.com/alexdlaird/amazon-orders/compare/4.0.17...4.0.18) - 2025-12-06
1634

1735
### Added

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,20 @@ pip install amazon-orders --upgrade
2525

2626
That's it! `amazon-orders` is now available as a package to your Python projects and from the command line.
2727

28-
If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.0.*`, not `==4.0.19`) to
28+
If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.0.*`, not `==4.1.0`) to
2929
ensure you always get the latest stable release.
3030

31+
To enable Captcha auto-solve on Python <=3.12 (via the optional [`amazoncaptcha`](https://pypi.org/project/amazoncaptcha/)
32+
dependency), install with the `captcha` extra:
33+
34+
```sh
35+
pip install "amazon-orders[captcha]" --upgrade
36+
```
37+
38+
Without this extra, Captcha challenges fall back to manual entry. `amazoncaptcha` is not available on Python 3.13+;
39+
see [Captcha Blocking Login](https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login) for
40+
details.
41+
3142
## Basic Usage
3243

3344
You'll use [`AmazonSession`](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession) to

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
| Version | Supported |
66
|---------|--------------------|
7-
| 4.0.x | :white_check_mark: |
8-
| < 4.0 | :x: |
7+
| 4.1.x | :white_check_mark: |
8+
| < 4.1 | :x: |
99

1010
## Reporting a Vulnerability
1111

amazonorders/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__copyright__ = "Copyright (c) 2024-2025 Alex Laird"
22
__license__ = "MIT"
3-
__version__ = "4.0.19"
3+
__version__ = "4.1.0"

amazonorders/forms.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99

1010
import pyotp
1111
from PIL import Image
12-
from amazoncaptcha import AmazonCaptcha
1312
from bs4 import Tag
1413
from requests import Response
1514

15+
try:
16+
from amazoncaptcha import AmazonCaptcha
17+
except ImportError: # pragma: no cover
18+
AmazonCaptcha = None # type: ignore[assignment, misc]
19+
1620
from amazonorders import util
1721
from amazonorders.conf import AmazonOrdersConfig
1822
from amazonorders.exception import AmazonOrdersAuthError, AmazonOrdersError
@@ -26,7 +30,9 @@ class AuthForm(ABC):
2630
"""
2731
The base class of an authentication ``<form>`` that can be submitted.
2832
29-
The base implementation will attempt to auto-solve Captcha. If this fails, it will
33+
The base implementation will attempt to auto-solve Captcha when the optional
34+
``amazoncaptcha`` dependency is installed (``pip install amazon-orders[captcha]``,
35+
available on Python <=3.12 only). If auto-solve is unavailable or fails, it will
3036
use the default image view to show the Captcha prompt, and it will also pass the
3137
image URL to :func:`~amazonorders.session.IODefault.prompt` as ``img_url``.
3238
"""
@@ -131,13 +137,22 @@ def _solve_captcha(self,
131137
"Call AuthForm.select_form() first."
132138
) # pragma: no cover
133139

134-
captcha_response = AmazonCaptcha.fromlink(url).solve()
140+
if AmazonCaptcha is not None:
141+
captcha_response = AmazonCaptcha.fromlink(url).solve()
142+
else:
143+
captcha_response = None
144+
135145
if not captcha_response or captcha_response.lower() == "not solved":
136146
img_response = self.amazon_session.session.get(url)
137147
img = Image.open(BytesIO(img_response.content))
138148
img.show()
139149

140-
self.amazon_session.io.echo("Info: The Captcha couldn't be auto-solved.")
150+
if AmazonCaptcha is None:
151+
self.amazon_session.io.echo(
152+
"Info: Captcha auto-solve is unavailable. Install with "
153+
"`pip install amazon-orders[captcha]` to enable it (only compatible with Python <=3.12.")
154+
else:
155+
self.amazon_session.io.echo("Info: The Captcha couldn't be auto-solved.")
141156

142157
captcha_response = self.amazon_session.io.prompt("Enter the characters shown in the image",
143158
img_url=url)

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ using ``pip``:
4444
4545
That's it! ``amazon-orders`` is now available as a package to your Python projects and from the command line.
4646

47-
If pinning, be sure to use a wildcard for the `minor version <https://semver.org/>`_ (ex. ``==4.0.*``, not ``==4.0.19``)
47+
If pinning, be sure to use a wildcard for the `minor version <https://semver.org/>`_ (ex. ``==4.0.*``, not ``==4.1.0``)
4848
to ensure you always get the latest stable release.
4949

5050
Basic Usage

docs/troubleshooting.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ and still other—like `Amazon's puzzle-based WAF Captchas <https://docs.aws.ama
4747
—require JavaScript and can't be solved at all by ``amazon-orders`` and block it from being able to log in (see `issue #45 <https://github.com/alexdlaird/amazon-orders/issues/45>`_
4848
for more details).
4949

50+
Auto-solving of legacy text-based Captchas is provided by the `amazoncaptcha <https://pypi.org/project/amazoncaptcha/>`_
51+
library, which is an optional dependency. To enable it on **Python <=3.12**, install with the ``captcha``
52+
extra:
53+
54+
.. code-block:: shell
55+
56+
pip install amazon-orders[captcha]
57+
58+
.. note::
59+
60+
The ``[captcha]`` extra is **only available on Python <=3.12+**. ``amazoncaptcha`` pins ``pillow<9.6.0``, which is
61+
incompatible with Python 3.13 until that constraint is lifted from the upstream dependency.
62+
63+
When this extra is not installed, Captcha challenges fall back to manually entering the
64+
solution. As Amazon has largely phased out this style of Captcha in favor of WAF, auto-solve may be removed
65+
entirely in a future major release.
66+
5067
To attempt to fully automate login, you need to minimize how often (if at all) you are presented with Captcha
5168
challenges. There is no perfect workaround to this, as when and how challenges are presented is at the discretion of
5269
Amazon, but there are at least a few ways you can try to reduce the likelihood you will be presented with

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ requires-python = ">=3.9"
1010
dependencies = [
1111
"click>=7.1",
1212
"requests>=2.23",
13-
"amazoncaptcha>=0.4",
13+
"Pillow>=9.0.1",
1414
"beautifulsoup4>=4.12",
1515
"PyYAML>=5.1",
1616
"python-dateutil>=2.8",
@@ -27,18 +27,23 @@ classifiers = [
2727
"Programming Language :: Python :: 3.10",
2828
"Programming Language :: Python :: 3.11",
2929
"Programming Language :: Python :: 3.12",
30+
"Programming Language :: Python :: 3.13",
3031
"Topic :: Software Development :: Libraries :: Python Modules",
3132
]
3233

3334
[project.optional-dependencies]
35+
captcha = [
36+
"amazoncaptcha>=0.4",
37+
]
3438
dev = [
3539
"pytest",
3640
"coverage[toml]",
3741
"flake8",
3842
"flake8-pyproject",
3943
"pep8-naming",
4044
"responses",
41-
"lxml"
45+
"lxml",
46+
"amazoncaptcha>=0.4; python_version < '3.13'",
4247
]
4348
integration = [
4449
"pytest-rerunfailures",

0 commit comments

Comments
 (0)