amazon-subscriptions 1.0.1__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/.github/workflows/automerge-schedule.yml +1 -0
  2. amazon_subscriptions-1.1.0/.github/workflows/mr-test.yml +120 -0
  3. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/.gitignore +1 -0
  4. amazon_subscriptions-1.1.0/.release-please-manifest.json +3 -0
  5. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/CHANGELOG.md +12 -0
  6. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/PKG-INFO +3 -3
  7. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/README.md +1 -1
  8. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/models.py +5 -5
  9. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/deliveries.py +2 -2
  10. amazon_subscriptions-1.1.0/codecov.yml +22 -0
  11. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/mise.toml +3 -0
  12. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/pyproject.toml +5 -4
  13. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/uv.lock +226 -202
  14. amazon_subscriptions-1.0.1/.github/workflows/mr-test.yml +0 -73
  15. amazon_subscriptions-1.0.1/.release-please-manifest.json +0 -3
  16. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/.github/workflows/lint.yml +0 -0
  17. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/.github/workflows/pr-conventional-title.yml +0 -0
  18. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/.github/workflows/publish.yml +0 -0
  19. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/.github/workflows/release-please.yml +0 -0
  20. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/.markdownlint-cli2.yaml +0 -0
  21. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/.yamllint.yml +0 -0
  22. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/CONTRIBUTING.md +0 -0
  23. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/LICENSE +0 -0
  24. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/__init__.py +0 -0
  25. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/cli.py +0 -0
  26. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/client.py +0 -0
  27. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/dates.py +0 -0
  28. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/exceptions.py +0 -0
  29. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/locales/__init__.py +0 -0
  30. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/locales/base.py +0 -0
  31. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/locales/en.py +0 -0
  32. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/__init__.py +0 -0
  33. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/acp.py +0 -0
  34. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/detail.py +0 -0
  35. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/matching.py +0 -0
  36. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/product.py +0 -0
  37. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/selectors.py +0 -0
  38. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/subscriptions.py +0 -0
  39. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/parse/util.py +0 -0
  40. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/amazon_subscriptions/serialize.py +0 -0
  41. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/lychee.toml +0 -0
  42. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/release-please-config.json +0 -0
  43. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/renovate.json +0 -0
  44. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/scripts/anonymize_fixtures.py +0 -0
  45. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/scripts/extract_product_fixture.py +0 -0
  46. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/scripts/privacy_scan.py +0 -0
  47. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/scripts/vendor/README.md +0 -0
  48. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/scripts/vendor/anonymize_test_resources.py +0 -0
  49. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/__init__.py +0 -0
  50. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/conftest.py +0 -0
  51. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/deliveries-page-2.html +0 -0
  52. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/delivery-1.html +0 -0
  53. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/delivery-2.html +0 -0
  54. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/landing.html +0 -0
  55. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/product-alternative-offer.html +0 -0
  56. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/product-no-buybox.html +0 -0
  57. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/product-rrp.html +0 -0
  58. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/product-single-offer.html +0 -0
  59. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/product-unavailable.html +0 -0
  60. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/product-was.html +0 -0
  61. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/product.html +0 -0
  62. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/fixtures/de/subscription-detail.html +0 -0
  63. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_cli.py +0 -0
  64. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_client.py +0 -0
  65. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_dates.py +0 -0
  66. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_locale.py +0 -0
  67. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_matching.py +0 -0
  68. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_parse_deliveries.py +0 -0
  69. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_parse_detail.py +0 -0
  70. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_parse_product.py +0 -0
  71. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_parse_subscriptions.py +0 -0
  72. {amazon_subscriptions-1.0.1 → amazon_subscriptions-1.1.0}/tests/test_serialize.py +0 -0
@@ -10,6 +10,7 @@ jobs:
10
10
  automerge:
11
11
  if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
12
12
  runs-on: ubuntu-latest
13
+ permissions: {}
13
14
  steps:
14
15
  - name: Enable auto-merge on release-please PR
15
16
  env:
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: MR Test
3
+
4
+ on:
5
+ workflow_dispatch:
6
+ push:
7
+ branches:
8
+ - main
9
+ pull_request:
10
+ branches:
11
+ - main
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ test:
22
+ runs-on: ubuntu-latest
23
+ timeout-minutes: 15
24
+ permissions:
25
+ contents: read
26
+ # Codecov upload via OIDC, no token needed.
27
+ id-token: write
28
+ strategy:
29
+ fail-fast: false
30
+ matrix:
31
+ # The oldest supported version (requires-python) and the one of mise.toml.
32
+ python: ["3.11", "3.14"]
33
+ env:
34
+ UV_PYTHON: ${{ matrix.python }}
35
+ steps:
36
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
37
+ with:
38
+ persist-credentials: false
39
+
40
+ - uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
41
+
42
+ - name: Install dependencies
43
+ run: mise run install
44
+
45
+ - name: Lint
46
+ run: mise run lint
47
+
48
+ - name: Test
49
+ run: mise run test-coverage
50
+
51
+ - name: Upload coverage to Codecov
52
+ uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
53
+ with:
54
+ use_oidc: true
55
+ fail_ci_if_error: false
56
+ files: coverage.xml
57
+
58
+ # Codecov reports its result as the check runs codecov/project and
59
+ # codecov/patch. This job waits for them, so a coverage drop fails the
60
+ # required job. It is skipped along with the tests, and passes with a warning
61
+ # if Codecov doesn't report in time.
62
+ coverage:
63
+ name: Coverage
64
+ runs-on: ubuntu-latest
65
+ needs: [test]
66
+ if: github.event_name == 'pull_request' && needs.test.result == 'success'
67
+ timeout-minutes: 10
68
+ permissions:
69
+ checks: read
70
+ steps:
71
+ - name: Wait for Codecov
72
+ env:
73
+ GH_TOKEN: ${{ github.token }}
74
+ REPO: ${{ github.repository }}
75
+ SHA: ${{ github.event.pull_request.head.sha }}
76
+ run: |
77
+ for _ in $(seq 30); do
78
+ checks=$(gh api --paginate --slurp "repos/$REPO/commits/$SHA/check-runs?per_page=100" | jq -c '
79
+ [.[].check_runs[] | select(.app.slug == "codecov" and (.name == "codecov/project" or .name == "codecov/patch"))]
80
+ | group_by(.name) | map(max_by(.id))')
81
+ if [[ $(jq '[.[] | select(.status == "completed")] | length' <<<"$checks") == 2 ]]; then
82
+ jq -r '.[] | "\(.name): \(.conclusion) (\(.output.title))"' <<<"$checks"
83
+ failed=$(jq -r '.[] | select(.conclusion != "success" and .conclusion != "neutral") | .name' <<<"$checks")
84
+ if [[ -n "$failed" ]]; then
85
+ echo "::error::Coverage check failed: ${failed//$'\n'/, }. Details are linked in the checks of this pull request."
86
+ exit 1
87
+ fi
88
+ exit 0
89
+ fi
90
+ sleep 10
91
+ done
92
+ echo "::warning::Codecov didn't report within 5 minutes, coverage is not checked."
93
+
94
+ build:
95
+ runs-on: ubuntu-latest
96
+ timeout-minutes: 10
97
+ steps:
98
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
99
+ with:
100
+ persist-credentials: false
101
+
102
+ - uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
103
+
104
+ - name: Build
105
+ run: uv build
106
+
107
+ lint:
108
+ uses: ./.github/workflows/lint.yml
109
+
110
+ # One status check for the ruleset, whatever jobs are added later.
111
+ required:
112
+ runs-on: ubuntu-latest
113
+ needs: [test, coverage, build, lint]
114
+ if: always()
115
+ steps:
116
+ - name: Check result
117
+ run: |
118
+ if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
119
+ exit 1
120
+ fi
@@ -8,6 +8,7 @@ dist/
8
8
  .ruff_cache/
9
9
  .mypy_cache/
10
10
  .coverage
11
+ coverage.xml
11
12
  htmlcov/
12
13
 
13
14
  # Debug output of amazon-orders (real, unanonymized pages)
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.1.0"
3
+ }
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.0](https://github.com/udondan/amazon-subscriptions/compare/v1.0.1...v1.1.0) (2026-11-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * drop support for Python 3.10 ([#28](https://github.com/udondan/amazon-subscriptions/issues/28)) ([fb02fae](https://github.com/udondan/amazon-subscriptions/commit/fb02fae0056b17c39251f1c949449e22dfef5621))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update certifi and pillow to patched versions ([#25](https://github.com/udondan/amazon-subscriptions/issues/25)) ([907956f](https://github.com/udondan/amazon-subscriptions/commit/907956f96158a162edc41abe1086d012823292b2))
14
+
3
15
  ## [1.0.1](https://github.com/udondan/amazon-subscriptions/compare/v1.0.0...v1.0.1) (2026-10-28)
4
16
 
5
17
 
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: amazon-subscriptions
3
- Version: 1.0.1
3
+ Version: 1.1.0
4
4
  Summary: Read Amazon Subscribe & Save subscriptions and upcoming deliveries as JSON (read-only)
5
5
  Author: Daniel Schroeder
6
6
  License-Expression: MIT
7
7
  License-File: LICENSE
8
- Requires-Python: >=3.10
8
+ Requires-Python: >=3.11
9
9
  Requires-Dist: amazon-orders<6,>=5.2.0
10
10
  Requires-Dist: beautifulsoup4==4.15.0
11
11
  Requires-Dist: click==8.5.0
@@ -21,7 +21,7 @@ English is supported; so far it is tested with amazon.de. See [Other sites](#oth
21
21
 
22
22
  ## Installation
23
23
 
24
- Requires Python 3.10 or later. Install the CLI from [PyPI](https://pypi.org/project/amazon-subscriptions/) with
24
+ Requires Python 3.11 or later. Install the CLI from [PyPI](https://pypi.org/project/amazon-subscriptions/) with
25
25
  [uv](https://docs.astral.sh/uv/):
26
26
 
27
27
  ```sh
@@ -8,7 +8,7 @@ English is supported; so far it is tested with amazon.de. See [Other sites](#oth
8
8
 
9
9
  ## Installation
10
10
 
11
- Requires Python 3.10 or later. Install the CLI from [PyPI](https://pypi.org/project/amazon-subscriptions/) with
11
+ Requires Python 3.11 or later. Install the CLI from [PyPI](https://pypi.org/project/amazon-subscriptions/) with
12
12
  [uv](https://docs.astral.sh/uv/):
13
13
 
14
14
  ```sh
@@ -1,16 +1,16 @@
1
1
  import datetime
2
2
  from dataclasses import dataclass, field
3
3
  from decimal import Decimal
4
- from enum import Enum
4
+ from enum import StrEnum
5
5
 
6
6
 
7
- class IntervalUnit(str, Enum):
7
+ class IntervalUnit(StrEnum):
8
8
  DAY = "day"
9
9
  WEEK = "week"
10
10
  MONTH = "month"
11
11
 
12
12
 
13
- class SubscriptionStatus(str, Enum):
13
+ class SubscriptionStatus(StrEnum):
14
14
  ACTIVE = "active"
15
15
  PAUSED = "paused"
16
16
  #: The subscribed product is not available, e.g. a backup product is sent instead.
@@ -19,7 +19,7 @@ class SubscriptionStatus(str, Enum):
19
19
  UNKNOWN = "unknown"
20
20
 
21
21
 
22
- class ListPriceType(str, Enum):
22
+ class ListPriceType(StrEnum):
23
23
  """What the list price of a product page is, by its label."""
24
24
 
25
25
  #: Recommended retail price, "RRP" on English pages.
@@ -30,7 +30,7 @@ class ListPriceType(str, Enum):
30
30
  WAS = "was"
31
31
 
32
32
 
33
- class ListPriceSource(str, Enum):
33
+ class ListPriceSource(StrEnum):
34
34
  """The block of a product page the list price was read from."""
35
35
 
36
36
  #: The price block of the offer in the buybox.
@@ -3,7 +3,7 @@
3
3
  import json
4
4
  import logging
5
5
  import re
6
- from datetime import date, datetime, timedelta, timezone
6
+ from datetime import UTC, date, datetime, timedelta
7
7
  from decimal import Decimal
8
8
  from urllib.parse import parse_qs, urlparse
9
9
 
@@ -157,7 +157,7 @@ def _date_of_epoch_ms(epoch_ms: str) -> date | None:
157
157
  """
158
158
  if not epoch_ms.isdigit():
159
159
  return None
160
- return (datetime.fromtimestamp(int(epoch_ms) / 1000, tz=timezone.utc) + timedelta(hours=12)).date()
160
+ return (datetime.fromtimestamp(int(epoch_ms) / 1000, tz=UTC) + timedelta(hours=12)).date()
161
161
 
162
162
 
163
163
  def _parse_delivery_date(text: str | None) -> date | None:
@@ -0,0 +1,22 @@
1
+ ---
2
+ codecov:
3
+ # The Coverage job of the MR Test workflow waits for the Codecov checks, so
4
+ # Codecov must not wait for the other checks in turn.
5
+ require_ci_to_pass: false
6
+ notify:
7
+ wait_for_ci: false
8
+ # Both Python versions of the test matrix upload a report. Codecov reports
9
+ # only once both arrived, so the Coverage job doesn't read a partial result.
10
+ after_n_builds: 2
11
+
12
+ coverage:
13
+ status:
14
+ project:
15
+ default:
16
+ # The coverage of the whole project may drop by up to 1 % against main.
17
+ target: auto
18
+ threshold: 1%
19
+ patch:
20
+ default:
21
+ # At least 80 % of the lines a pull request changes must be tested.
22
+ target: 80%
@@ -26,3 +26,6 @@ run = [
26
26
 
27
27
  [tasks.test]
28
28
  run = "uv run pytest"
29
+
30
+ [tasks.test-coverage]
31
+ run = "uv run pytest --cov=amazon_subscriptions --cov-report=xml --cov-report=term"
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "amazon-subscriptions"
3
- version = "1.0.1"
3
+ version = "1.1.0"
4
4
  description = "Read Amazon Subscribe & Save subscriptions and upcoming deliveries as JSON (read-only)"
5
5
  readme = "README.md"
6
6
  license = "MIT"
7
7
  authors = [{ name = "Daniel Schroeder" }]
8
- requires-python = ">=3.10"
8
+ requires-python = ">=3.11"
9
9
  dependencies = [
10
10
  "amazon-orders>=5.2.0,<6",
11
11
  "beautifulsoup4==4.15.0",
@@ -19,6 +19,7 @@ amazon-subscriptions = "amazon_subscriptions.cli:cli"
19
19
  dev = [
20
20
  "mypy==2.3.1",
21
21
  "pytest==9.1.1",
22
+ "pytest-cov==7.1.0",
22
23
  "responses==0.26.3",
23
24
  "ruff==0.16.9",
24
25
  "types-requests==2.33.0.20260906",
@@ -33,14 +34,14 @@ packages = ["amazon_subscriptions"]
33
34
 
34
35
  [tool.ruff]
35
36
  line-length = 119
36
- target-version = "py310"
37
+ target-version = "py311"
37
38
  extend-exclude = ["scripts/vendor"]
38
39
 
39
40
  [tool.ruff.lint]
40
41
  select = ["E", "F", "W", "I", "N", "UP", "B", "SIM", "RUF"]
41
42
 
42
43
  [tool.mypy]
43
- python_version = "3.10"
44
+ python_version = "3.11"
44
45
  strict = true
45
46
  files = ["amazon_subscriptions"]
46
47