Skip to content

Commit 8917e73

Browse files
committed
Prepare Python SDK v2 runtime refresh
1 parent 5b3fb00 commit 8917e73

16 files changed

Lines changed: 143 additions & 1043 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,28 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ubuntu-latest, windows-latest]
15-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
15+
python-version: ['3.10', '3.12', '3.13', '3.14']
1616
env:
17-
POETRY_VERSION: "1.8.5"
17+
POETRY_VERSION: "2.4.1"
1818

1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121
with:
2222
lfs: true
2323

24-
- uses: actions/setup-node@v4
24+
- uses: actions/setup-node@v6
2525
with:
26-
node-version: '20'
26+
node-version: '24'
2727
- name: Install Transloadit CLI
2828
run: npm install -g transloadit
2929

3030
- name: Set up Python
31-
uses: actions/setup-python@v4
31+
uses: actions/setup-python@v6
3232
with:
3333
python-version: ${{ matrix.python-version }}
3434
architecture: x64
35-
cache: 'pip'
35+
cache: 'poetry'
36+
cache-dependency-path: poetry.lock
3637

3738
- name: Install Poetry
3839
run: python -m pip install --upgrade "poetry==${{ env.POETRY_VERSION }}"
@@ -41,7 +42,7 @@ jobs:
4142
run: poetry install
4243

4344
- name: Test with coverage
44-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
45+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
4546
run: |
4647
poetry run pytest --cov=transloadit \
4748
--cov-report=xml \
@@ -54,13 +55,13 @@ jobs:
5455
TEST_NODE_PARITY: 1
5556

5657
- name: Test without coverage
57-
if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12'
58+
if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.14'
5859
run: poetry run pytest tests
5960

6061
- name: Upload coverage reports
6162
# Only upload coverage if we have a token (skip for Dependabot PRs)
62-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && (github.event_name != 'pull_request' || github.actor != 'dependabot[bot]')
63-
uses: codecov/codecov-action@v4
63+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' && (github.event_name != 'pull_request' || github.actor != 'dependabot[bot]')
64+
uses: codecov/codecov-action@v6
6465
with:
6566
token: ${{ secrets.CODECOV_TOKEN }}
6667
files: ./coverage.xml
@@ -70,17 +71,17 @@ jobs:
7071

7172
- name: Upload coverage reports (tokenless)
7273
# Use tokenless upload for Dependabot PRs
73-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
74-
uses: codecov/codecov-action@v4
74+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' && github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
75+
uses: codecov/codecov-action@v6
7576
with:
7677
files: ./coverage.xml
7778
flags: unittests
7879
name: python-sdk
7980
fail_ci_if_error: false
8081

8182
- name: Upload coverage artifacts
82-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
83-
uses: actions/upload-artifact@v4
83+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
84+
uses: actions/upload-artifact@v7
8485
with:
8586
name: coverage-reports
8687
path: |
@@ -92,27 +93,28 @@ jobs:
9293
needs: python
9394
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
9495
env:
95-
POETRY_VERSION: "1.8.5"
96+
POETRY_VERSION: "2.4.1"
9697
PYTHON_SDK_E2E: "1"
9798
TRANSLOADIT_KEY: ${{ secrets.TRANSLOADIT_KEY }}
9899
TRANSLOADIT_SECRET: ${{ secrets.TRANSLOADIT_SECRET }}
99100
steps:
100-
- uses: actions/checkout@v4
101+
- uses: actions/checkout@v6
101102
with:
102103
lfs: true
103104

104-
- uses: actions/setup-node@v4
105+
- uses: actions/setup-node@v6
105106
with:
106-
node-version: '20'
107+
node-version: '24'
107108
- name: Install Transloadit CLI
108109
run: npm install -g transloadit
109110

110111
- name: Set up Python
111-
uses: actions/setup-python@v4
112+
uses: actions/setup-python@v6
112113
with:
113-
python-version: '3.12'
114+
python-version: '3.14'
114115
architecture: x64
115-
cache: 'pip'
116+
cache: 'poetry'
117+
cache-dependency-path: poetry.lock
116118

117119
- name: Install Poetry
118120
run: python -m pip install --upgrade "poetry==${{ env.POETRY_VERSION }}"

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v6
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v2
42+
uses: github/codeql-action/init@v4
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v2
53+
uses: github/codeql-action/autobuild@v4
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://git.io/JvXDl
@@ -64,4 +64,4 @@ jobs:
6464
# make release
6565

6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v2
67+
uses: github/codeql-action/analyze@v4

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### 2.0.0 / 2026-05-20 ###
2+
* **Breaking Change**: Raised the supported Python runtime floor from 3.9+ to 3.10+ so the SDK no longer has to retain vulnerable locked dependency versions for EOL Python 3.9.
3+
* Raised the runtime HTTP stack to patched versions by requiring `requests` 2.33+ and adding an explicit `urllib3` 2.7+ floor.
4+
* Updated development and documentation tooling, including `pytest` 9.0.3, `Sphinx` 8.1.3, `coverage` 7.14, `tox` 4.54, and `requests-mock` 1.12.
5+
* Updated CI and local Docker test coverage to a representative Python 3.10, 3.12, 3.13, and 3.14 matrix.
6+
* Migrated package metadata to the modern `[project]` format used by Poetry 2.
7+
* Refreshed GitHub Actions, release documentation, and Sphinx docs that still referenced older runtime/tooling assumptions.
8+
19
### 1.0.4 / 2026-05-20 ###
210
* Refreshed locked runtime and development dependencies, including `aiohttp` 3.13.5, `idna` 3.15, `pygments` 2.20.0, Python-version-specific `requests` updates, and `tuspy` 1.1.0.
311
* Updated development tooling to Python 3.9-compatible majors: `pytest` 8.4, `pytest-cov` 7.1, `Sphinx` 7.4, and `sphinx-autobuild` 2024.10.

CONTRIBUTING.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
- Push access to `transloadit/python-sdk`
88
- PyPI API token with publish rights (`PYPI_TOKEN`), exported or stored in `.env`
99

10-
**Steps for version `1.0.3` (example)**
10+
**Steps for version `2.0.0` (example)**
1111
1. Bump version in `pyproject.toml`, `transloadit/__init__.py`, and `tests/test_request.py`.
12-
2. Add the `### 1.0.3 / YYYY-MM-DD ###` entry to `CHANGELOG.md`.
12+
2. Add the `### 2.0.0 / YYYY-MM-DD ###` entry to `CHANGELOG.md`.
1313
3. Run the matrix (add `PYTHON_SDK_E2E=1` if you want the live upload):
1414
```bash
15-
./scripts/test-in-docker.sh --python 3.12
15+
./scripts/test-in-docker.sh --python 3.14
1616
```
17-
4. Commit on `main`: `git commit -am "Release v1.0.3"`
17+
4. Commit on `main`: `git commit -am "Release v2.0.0"`
1818
5. Tag & push:
1919
```bash
20-
git tag v1.0.3
20+
git tag v2.0.0
2121
git push origin main --tags
2222
```
2323
6. Publish to PyPI via Docker helper (ensures clean tree & version alignment):
@@ -26,17 +26,22 @@
2626
```
2727
7. Publish the GitHub release (pulls notes from the changelog section):
2828
```bash
29-
NOTES=$(python - <<'PY'
29+
NOTES=$(python3 - <<'PY'
3030
import pathlib, re
31-
version = "1.0.3"
31+
version = "2.0.0"
3232
text = pathlib.Path("CHANGELOG.md").read_text()
3333
pattern = rf"^### {re.escape(version)}.*?(?=^### |\Z)"
3434
match = re.search(pattern, text, flags=re.MULTILINE | re.DOTALL)
3535
print(match.group(0).strip() if match else "")
3636
PY
3737
)
38-
gh release create v1.0.3 --title "v1.0.3" --notes "$NOTES"
38+
gh release create v2.0.0 --title "v2.0.0" --notes "$NOTES"
3939
```
4040
8. Verify the Read the Docs build kicked off: <https://transloadit.readthedocs.io/en/latest/>
41+
9. Verify the published package and the security posture:
42+
```bash
43+
python3 -m pip index versions pytransloadit | head
44+
gh api repos/transloadit/python-sdk/dependabot/alerts --jq 'map(select(.state == "open")) | length'
45+
```
4146

4247
Additional background lives here: <https://github.com/transloadit/team-internals/blob/HEAD/_howtos/2020-12-14-maintain-python-sdk.md>.

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG PYTHON_VERSION=3.12
3+
ARG PYTHON_VERSION=3.14
44
FROM python:${PYTHON_VERSION}-slim AS base
55

66
ENV DEBIAN_FRONTEND=noninteractive \
@@ -20,15 +20,15 @@ RUN apt-get update \
2020

2121
RUN git lfs install --system
2222

23-
# Install Node.js 20 (for Smart CDN parity tests) and supporting CLI tooling
24-
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
23+
# Install Node.js 24 (for Smart CDN parity tests) and supporting CLI tooling
24+
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
2525
&& apt-get update \
2626
&& apt-get install -y --no-install-recommends nodejs \
2727
&& npm install -g transloadit \
2828
&& rm -rf /var/lib/apt/lists/*
2929

3030
# Install Poetry so we match the GitHub Actions toolchain
3131
RUN pip install --no-cache-dir --upgrade pip \
32-
&& pip install --no-cache-dir poetry
32+
&& pip install --no-cache-dir poetry==2.4.1
3333

3434
WORKDIR /workspace

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A **Python** Integration for [Transloadit](https://transloadit.com)'s file uploa
1111

1212
This is a **Python** SDK to make it easy to talk to the [Transloadit](https://transloadit.com) REST API.
1313

14-
Only Python 3.9+ versions are supported.
14+
Only Python 3.10+ versions are supported.
1515

1616
## Install
1717

@@ -56,18 +56,18 @@ scripts/test-in-docker.sh
5656

5757
This script will:
5858

59-
- build images for the Python versions we test in CI (3.9–3.13)
60-
- install Poetry, Node.js 20, and the Transloadit CLI
59+
- build images for the Python versions we test in CI (3.10, 3.12, 3.13, and 3.14)
60+
- install Poetry, Node.js 24, and the Transloadit CLI
6161
- pass credentials from `.env` (if present) so end-to-end tests can run against real Transloadit accounts
6262

63-
Signature parity tests use `npx transloadit smart_sig` under the hood, matching the reference implementation used by our other SDKs. Our GitHub Actions workflow also runs the E2E upload against Python 3.12 on every push/PR using a dedicated Transloadit test account (wired through the `TRANSLOADIT_KEY` and `TRANSLOADIT_SECRET` secrets).
63+
Signature parity tests use `npx transloadit smart_sig` under the hood, matching the reference implementation used by our other SDKs. Our GitHub Actions workflow also runs the E2E upload against Python 3.14 on every push/PR using a dedicated Transloadit test account (wired through the `TRANSLOADIT_KEY` and `TRANSLOADIT_SECRET` secrets).
6464

65-
Pass `--python 3.12` (or set `PYTHON_VERSIONS`) to restrict the matrix, or append a custom command after `--`, for example `scripts/test-in-docker.sh -- pytest -k smartcdn`.
65+
Pass `--python 3.14` (or set `PYTHON_VERSIONS`) to restrict the matrix, or append a custom command after `--`, for example `scripts/test-in-docker.sh -- pytest -k smartcdn`.
6666

6767
To exercise the optional end-to-end upload against a real Transloadit account, provide `TRANSLOADIT_KEY` and `TRANSLOADIT_SECRET` (via environment variables or `.env`) and set `PYTHON_SDK_E2E=1`:
6868

6969
```bash
70-
PYTHON_SDK_E2E=1 scripts/test-in-docker.sh --python 3.12 -- pytest tests/test_e2e_upload.py
70+
PYTHON_SDK_E2E=1 scripts/test-in-docker.sh --python 3.14 -- pytest tests/test_e2e_upload.py
7171
```
7272

7373
The test uploads `chameleon.jpg`, resizes it, and asserts on the live assembly results.

docs/source/conf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def __getattr__(cls, name):
7272
# built documents.
7373
#
7474
# The short X.Y version.
75-
version = u'0.0.1'
75+
version = '2.0'
7676
# The full version, including alpha/beta/rc tags.
77-
release = u'0.0.1'
77+
release = '2.0.0'
7878

7979
# The language for content autogenerated by Sphinx. Refer to documentation
8080
# for a list of supported languages.
@@ -185,4 +185,3 @@ def __getattr__(cls, name):
185185
'Miscellaneous'),
186186
]
187187

188-

docs/source/index.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Welcome to transloadit's Python SDK documentation!
88

99
|Build Status|
1010

11-
.. |Build Status| image:: https://travis-ci.org/transloadit/python-sdk.svg?branch=main
12-
:target: https://travis-ci.org/transloadit/python-sdk
11+
.. |Build Status| image:: https://github.com/transloadit/python-sdk/actions/workflows/ci.yml/badge.svg
12+
:target: https://github.com/transloadit/python-sdk/actions/workflows/ci.yml
1313

1414
`Transloadit`_ is a service that helps you handle file uploads, resize,
1515
crop and watermark your images, make GIFs, transcode your videos,
@@ -19,6 +19,8 @@ short, `Transloadit`_ is the Swiss Army Knife for your files.
1919
This is a **Python** SDK to make it easy to talk to the `Transloadit`_
2020
REST API.
2121

22+
Only Python 3.10+ versions are supported.
23+
2224
.. _Transloadit: https://transloadit.com
2325

2426
.. toctree::
@@ -59,10 +61,10 @@ Usage
5961
assembly.add_step('resize', '/image/resize', {'width': 70, 'height': 70})
6062
assembly_response = assembly.create(retries=5, wait=True)
6163
62-
print assembly_response.data.get('assembly_id')
64+
print(assembly_response.data.get('assembly_id'))
6365
6466
# or
65-
print assembly_response.data['assembly_id']
67+
print(assembly_response.data['assembly_id'])
6668
6769
Example
6870
-------

docs/source/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pypandoc==1.17
2-
Sphinx==7.4.7
2+
Sphinx==8.1.3

0 commit comments

Comments
 (0)