Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8986cb3
Fix macOS CI: add homebrew bison to GITHUB_PATH
greggdonovan Jan 14, 2026
1cbc574
pypi: python 3.8 -> 3.10
greggdonovan Jan 15, 2026
42b5763
doc: specify python 3.10+
greggdonovan Jan 15, 2026
585d829
docker: python 3.10+
greggdonovan Jan 15, 2026
6a80b86
fb303: python 3.10+
greggdonovan Jan 15, 2026
ab1189a
Remove py:old_style generator option
greggdonovan Jan 15, 2026
c44734f
py: drop Python 2 setup logic
greggdonovan Jan 15, 2026
987a88c
py: remove py 2.x comment
greggdonovan Jan 15, 2026
7c3fa6b
py: remove py 2.x comment
greggdonovan Jan 15, 2026
ce9f416
configure: simplify Python 3 detection
greggdonovan Jan 15, 2026
b382cbe
chore: update python shebangs to python3
greggdonovan Jan 15, 2026
8cc0954
py: harden socket test and improve RunClientServer/TestServer
greggdonovan Jan 15, 2026
d308917
py: require tornado>=6.3.0 in ci and tests
greggdonovan Jan 15, 2026
1e153a9
build: require Python 3.10+ and drop py2 packaging
greggdonovan Jan 16, 2026
100692a
py: accept enum names in generated setters
greggdonovan Jan 16, 2026
58595f0
py: modernize Tornado server and HTTP TLS setup
greggdonovan Jan 16, 2026
e8078b2
tests: drop legacy py2 fallbacks and default to python3
greggdonovan Jan 16, 2026
1f066c8
tests: improve local thrift discovery for feature scripts
greggdonovan Jan 16, 2026
ff5c654
build: drop py3 conditionals and unify python targets
greggdonovan Jan 17, 2026
1d7d103
tests: remove py3 suite and known-failure entries
greggdonovan Jan 17, 2026
0a0a989
py: fix TLS version handling and close leaked sockets
greggdonovan Jan 17, 2026
a4f53d8
py(tornado): drop io_loop argument
greggdonovan Jan 17, 2026
8fd2f54
ci: set PY_PREFIX for python install; trim appveyor noise
greggdonovan Jan 17, 2026
7d5b938
py: avoid deprecated ssl.match_hostname
greggdonovan Jan 17, 2026
db102a9
py: keep legacy TLSv1.1/1 contexts
greggdonovan Jan 17, 2026
c97fcb9
tests(py): skip TLSv1.1 when no ciphers available
greggdonovan Jan 17, 2026
71de4f4
py(ssl): enforce TLS 1.2+ and tighten tests
greggdonovan Jan 17, 2026
48762d7
py(http): enforce TLS 1.2+ and add tests
greggdonovan Jan 17, 2026
bd310fb
ci(py): add security scan target and uv setup
greggdonovan Jan 17, 2026
b50afc9
chore: ignore local python build artifacts
greggdonovan Jan 17, 2026
c70d430
Remove legacy ssl_match_hostname dependencies
greggdonovan Jan 18, 2026
64c7960
Simplify fastbinary extension for Python 3
greggdonovan Jan 18, 2026
dfbc4eb
Simplify basic auth header encoding
greggdonovan Jan 18, 2026
d38671b
Handle unknown enum values in Python generator
greggdonovan Jan 18, 2026
8b5413e
Stabilize socket timeout tests
greggdonovan Jan 19, 2026
3b31403
Add timeouts to flaky Python tests
greggdonovan Jan 21, 2026
4147a1b
Add comprehensive type checking tests with Astral's ty
greggdonovan Jan 31, 2026
651ee67
Fix ty type checker path for CI environment
greggdonovan Jan 31, 2026
0ead50b
Remove obsolete Python generator options from tests
greggdonovan Jan 31, 2026
9d98b7e
Fix ty type checker errors for generated Python code
greggdonovan Jan 31, 2026
50e511c
Add class-level attribute declarations for immutable structs
greggdonovan Jan 31, 2026
fa45165
Fix type hints for init parameters and instance attributes
greggdonovan Jan 31, 2026
1cb8fe9
Add comment explaining generated TestServer directory
greggdonovan Jan 31, 2026
f1fda23
Use official astral-sh/setup-uv action for uv installation
greggdonovan Jan 31, 2026
43497ec
Fix test_ciphers to force TLS 1.2 only for NULL cipher test
greggdonovan Jan 31, 2026
7f6986f
Increase server shutdown timeout in TNonblockingServer test
greggdonovan Jan 31, 2026
ef09748
Fix TNonblockingServer test shutdown sequence
greggdonovan Jan 31, 2026
00089c0
Fix bugs and issues found during code review
greggdonovan Feb 6, 2026
c7259eb
Fix testException__traceback__ test to match generator changes
greggdonovan Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up uv
uses: astral-sh/setup-uv@v5

- name: Python setup
run: |
python -m pip install --upgrade pip setuptools wheel flake8 "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1"
Expand Down Expand Up @@ -609,6 +612,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up uv
uses: astral-sh/setup-uv@v5

- name: Python setup
run: |
python -m pip install --upgrade pip setuptools wheel flake8 "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.8"
python-version: "3.10"

- name: Build
run: |
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ project.lock.json
.vscode
.vs

/.venv*
/build-cmake/
/lib/py/src/protocol/*.so
# Generated from test/test_thrift_file/TestServer.thrift during make check
/lib/py/test/TestServer/

/aclocal/libtool.m4
/aclocal/lt*.m4
/autoscan.log
Expand Down
2 changes: 1 addition & 1 deletion LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ Thrift's core protocol is TBinary, supported by all languages except for JavaScr
<td align=left><a href="https://github.com/apache/thrift/blob/master/lib/py/README.md">Python</a></td>
<!-- Since -----------------><td>0.2.0</td>
<!-- Build Systems ---------><td><img src="/doc/images/cgrn.png" alt="Yes"/></td><td><img src="/doc/images/cgrn.png" alt="Yes"/></td>
<!-- Language Levels -------><td>2.7.12, 3.5.2</td><td>2.7.15, 3.6.8</td>
<!-- Language Levels -------><td>3.10</td><td>3.14</td>
<!-- Field types -----------><td><img src="/doc/images/cred.png" alt=""/></td>
<!-- Low-Level Transports --><td><img src="/doc/images/cgrn.png" alt="Yes"/></td><td><img src="/doc/images/cred.png" alt=""/></td><td><img src="/doc/images/cred.png" alt=""/></td><td><img src="/doc/images/cred.png" alt=""/></td><td><img src="/doc/images/cgrn.png" alt="Yes"/></td><td><img src="/doc/images/cgrn.png" alt="Yes"/></td>
<!-- Transport Wrappers ----><td><img src="/doc/images/cred.png" alt=""/></td><td><img src="/doc/images/cgrn.png" alt="Yes"/></td><td><img src="/doc/images/cgrn.png" alt="Yes"/></td><td><img src="/doc/images/cgrn.png" alt="Yes"/></td>
Expand Down
6 changes: 1 addition & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,10 @@ empty :=
space := $(empty) $(empty)
comma := ,

CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_NETSTD@ @MAYBE_NODETS@ @MAYBE_KOTLIN@ @MAYBE_SWIFT@
CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_PYTHON@ @MAYBE_RUBY@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_NETSTD@ @MAYBE_NODETS@ @MAYBE_KOTLIN@ @MAYBE_SWIFT@
CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS))

if WITH_PY3
CROSS_PY=$(PYTHON3)
else
CROSS_PY=$(PYTHON)
endif

if WITH_PYTHON
crossfeature: precross
Expand Down
4 changes: 1 addition & 3 deletions build/appveyor/MSVC-appveyor-full.bat
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ IF "%WITH_PYTHON%" == "ON" (
"!PYTHON_ROOT!\python.exe" -m ensurepip --upgrade || EXIT /B
"!PYTHON_ROOT!\python.exe" -m pip install --upgrade pip setuptools wheel || EXIT /B
"!PYTHON_ROOT!\python.exe" -m pip ^
install backports.ssl_match_hostname ^
ipaddress ^
tornado>=6.3.0 ^
install tornado>=6.3.0 ^
twisted>=24.3.0 ^
zope.interface>=6.1 || EXIT /B
)
Expand Down
2 changes: 1 addition & 1 deletion build/cmake/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON

# Python
option(WITH_PYTHON "Build Python Thrift library" ON)
find_package(Python3
find_package(Python3 3.10
COMPONENTS
Interpreter # for Python executable
Development # for Python.h
Expand Down
55 changes: 27 additions & 28 deletions build/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,31 +172,30 @@ Last updated: March 5, 2024

## Compiler/Language Versions per Dockerfile ##

| Tool | ubuntu-focal | ubuntu-jammy | ubuntu-noble | Notes |
| :-------- | :------------ | :------------ | :------------ | :---- |
| as of | Mar 06, 2018 | Jul 1, 2019 | | |
| as3 | 4.6.0 | 4.6.0 | | |
| C++ gcc | 9.4.0 | 11.4.0 | | |
| C++ clang | 13.0.0 | 13.0.0 | | |
| c\_glib | 3.2.12 | 3.2.12 | | |
| cl (sbcl) | | 1.5.3 | | |
| d | 2.087.0 | 2.087.0 | | |
| dart | 2.7.2-1 | 2.7.2-1 | | |
| delphi | | | | Not in CI |
| erlang | OTP-25.3.2.9 | OTP-25.3.2.9 | | |
| go | 1.21.7 | 1.21.7 | | |
| haxe | 4.2.1 | 4.2.1 | | |
| java | 17 | 17 | | |
| js | Node.js 16.20.2, npm 8.19.4 | | | Node.js 16.20.2, npm 8.19.4 |
| lua | 5.2.4 | 5.2.4 | | Lua 5.3: see THRIFT-4386 |
| netstd | 9.0 | 9.0 | 9.0 | |
| nodejs | 16.20.2 | 16.20.2 | | |
| ocaml | 4.08.1 | 4.13.1 | | |
| perl | 5.30.0 | 5.34.0 | | |
| php | 7.4.3 | 8.1.2 | 8.3 | |
| python2 | 2.7.18 | | | |
| python3 | 3.8.10 | 3.10.12 | | |
| ruby | 2.7.0p0 | 3.0.2p107 | | |
| rust | 1.83.0 | 1.83.0 | | |
| smalltalk | | | | Not in CI |
| swift | 5.7 | 5.7 | 6.1 | |
| Tool | ubuntu-focal | ubuntu-jammy | ubuntu-noble | Notes |
| :-------- | :------------ | :------------ | :------------ |:-----------------------------------------------|
| as of | Mar 06, 2018 | Jul 1, 2019 | | |
| as3 | 4.6.0 | 4.6.0 | | |
| C++ gcc | 9.4.0 | 11.4.0 | | |
| C++ clang | 13.0.0 | 13.0.0 | | |
| c\_glib | 3.2.12 | 3.2.12 | | |
| cl (sbcl) | | 1.5.3 | | |
| d | 2.087.0 | 2.087.0 | | |
| dart | 2.7.2-1 | 2.7.2-1 | | |
| delphi | | | | Not in CI |
| erlang | OTP-25.3.2.9 | OTP-25.3.2.9 | | |
| go | 1.21.7 | 1.21.7 | | |
| haxe | 4.2.1 | 4.2.1 | | |
| java | 17 | 17 | | |
| js | Node.js 16.20.2, npm 8.19.4 | | | Node.js 16.20.2, npm 8.19.4 |
| lua | 5.2.4 | 5.2.4 | | Lua 5.3: see THRIFT-4386 |
| netstd | 9.0 | 9.0 | 9.0 | |
| nodejs | 16.20.2 | 16.20.2 | | |
| ocaml | 4.08.1 | 4.13.1 | | |
| perl | 5.30.0 | 5.34.0 | | |
| php | 7.4.3 | 8.1.2 | 8.3 | |
| python | 3.10.14 | 3.10.12 | 3.12.3 | focal: built from source (ships with 3.8) |
| ruby | 2.7.0p0 | 3.0.2p107 | | |
| rust | 1.83.0 | 1.83.0 | | |
| smalltalk | | | | Not in CI |
| swift | 5.7 | 5.7 | 6.1 | |
40 changes: 30 additions & 10 deletions build/docker/ubuntu-focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,37 @@ RUN apt-get install -y --no-install-recommends \
re2c \
composer

# Python 3.10 built from source (Focal ships with 3.8, but we require 3.10+)
ENV PYTHON_VERSION=3.10.14
RUN apt-get install -y --no-install-recommends \
`# Python3 dependencies` \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-pip \
python3-setuptools \
python3-wheel

RUN python3 -m pip install --no-cache-dir --upgrade "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1"
`# Python build dependencies` \
libbz2-dev \
libffi-dev \
libgdbm-dev \
liblzma-dev \
libncurses5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
tk-dev \
uuid-dev \
xz-utils && \
cd /tmp && \
wget -q https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
tar xzf Python-${PYTHON_VERSION}.tgz && \
cd Python-${PYTHON_VERSION} && \
./configure --enable-optimizations --with-ensurepip=install && \
make -j$(nproc) && \
make altinstall && \
cd / && rm -rf /tmp/Python-${PYTHON_VERSION}* && \
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 1 && \
python3.10 -m pip install --upgrade pip && \
pip3.10 install --no-cache-dir \
setuptools \
wheel \
tornado>=6.3.0 \
twisted>=24.3.0 \
zope.interface>=6.1

RUN apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
Expand All @@ -281,7 +302,6 @@ USER root
RUN apt-get install -yq \
libedit-dev \
libz3-dev \
libpython2-dev \
libxml2-dev && \
cd / && \
wget --quiet https://download.swift.org/swift-5.7-release/ubuntu2004/swift-5.7-RELEASE/swift-5.7-RELEASE-ubuntu20.04.tar.gz && \
Expand Down
1 change: 0 additions & 1 deletion build/docker/ubuntu-jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ USER root
RUN apt-get install -yq \
libedit-dev \
libz3-dev \
libpython2-dev \
libxml2-dev && \
cd / && \
wget --quiet https://download.swift.org/swift-5.7-release/ubuntu2204/swift-5.7-RELEASE/swift-5.7-RELEASE-ubuntu22.04.tar.gz && \
Expand Down
4 changes: 2 additions & 2 deletions build/docker/ubuntu-noble/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ RUN apt-get install -y --no-install-recommends \
RUN apt-get install -y --no-install-recommends \
`# Static Code Analysis dependencies` \
cppcheck \
sloccount
sloccount

#RUN pip install flake8

# NOTE: this does not reduce the image size but adds an additional layer.
Expand Down
2 changes: 1 addition & 1 deletion compiler/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ THRIFT_ADD_COMPILER(netstd "Enable compiler for .NET Standard" ON)
THRIFT_ADD_COMPILER(ocaml "Enable compiler for OCaml" ON)
THRIFT_ADD_COMPILER(perl "Enable compiler for Perl" ON)
THRIFT_ADD_COMPILER(php "Enable compiler for PHP" ON)
THRIFT_ADD_COMPILER(py "Enable compiler for Python 2.0" ON)
THRIFT_ADD_COMPILER(py "Enable compiler for Python" ON)
THRIFT_ADD_COMPILER(rb "Enable compiler for Ruby" ON)
THRIFT_ADD_COMPILER(rs "Enable compiler for Rust" ON)
THRIFT_ADD_COMPILER(st "Enable compiler for Smalltalk" ON)
Expand Down
Loading
Loading