Skip to content

Commit

Permalink
Fix the incompatibility with Python 3.12 and drop the support for 3.7
Browse files Browse the repository at this point in the history
### Motivation

The `avro` component cannot be installed with Python 3.12 because the
depended `fastavro` dependency is 1.7.3, which is not compatible with
Python 3.12. However, the newer fastavro dependencies all do not support
Python 3.7, which has already reached the EOL (2023-06-27).

### Modifications

- Upgrade the fastavro dependency to 1.9.2
- Add the workflows to run tests for the lowest and highest supported
  Python versions (3.8 and 3.12).
- Fix the documents
  • Loading branch information
BewareMyPower committed Dec 25, 2023
1 parent d278416 commit 2b80847
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci-build-release-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- {name: 'manylinux2014', py_suffix: ''}
- {name: 'manylinux_musl', py_suffix: '-alpine'}
python:
- {version: '3.7', spec: 'cp37-cp37m'}
- {version: '3.8', spec: 'cp38-cp38'}
- {version: '3.9', spec: 'cp39-cp39'}
- {version: '3.10', spec: 'cp310-cp310'}
Expand Down Expand Up @@ -103,7 +102,6 @@ jobs:
fail-fast: false
matrix:
py:
- {version: '3.7', version_long: '3.7.15'}
- {version: '3.8', version_long: '3.8.13'}
- {version: '3.9', version_long: '3.9.14'}
- {version: '3.10', version_long: '3.10.7'}
Expand Down Expand Up @@ -156,7 +154,6 @@ jobs:
fail-fast: false
matrix:
python:
- {version: '3.7'}
- {version: '3.8'}
- {version: '3.9'}
- {version: '3.10'}
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/ci-pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,22 @@ jobs:
pulsar
unit-tests:
name: Run unit tests
name: Run unit tests for Python ${{matrix.version}}
runs-on: ubuntu-22.04
timeout-minutes: 120

strategy:
fail-fast: false
matrix:
version: ['3.8', '3.12']

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "${{matrix.version}}"

- name: Install Pulsar C++ client
run: build-support/install-dependencies.sh
Expand All @@ -66,7 +75,8 @@ jobs:

- name: Python install
run: |
./setup.py bdist_wheel
python3 -m pip install -U pip setuptools wheel requests
python3 setup.py bdist_wheel
WHEEL=$(find dist -name '*.whl')
pip3 install ${WHEEL}[avro]
Expand All @@ -90,7 +100,7 @@ jobs:
- name: Test functions install
run: |
WHEEL=$(find dist -name '*.whl')
pip3 install ${WHEEL}[functions] --force-reinstall
pip3 install ${WHEEL}[all] --force-reinstall
linux-wheel:
name: Wheel ${{matrix.image.name}} - Py ${{matrix.python.version}} - ${{matrix.cpu.platform}}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Pulsar Python clients support a variety of Pulsar features to enable building ap

## Requirements

- Python >= 3.7
- Python 3.8, 3.9, 3.10, 3.11, 3.12
- A C++ compiler that supports C++11
- CMake >= 3.18
- [Pulsar C++ client library](https://github.com/apache/pulsar-client-cpp)
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ stay open for at least 72 hours ***
Python wheels:
https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-python-X.Y.Z-candidate-N/
The supported python versions are 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12. The
The supported python versions are 3.8, 3.9, 3.10, 3.11 and 3.12. The
supported platforms and architectures are:
- Windows x86_64 (windows/)
- glibc-based Linux x86_64 (linux-glibc-x86_64/)
Expand Down
1 change: 1 addition & 0 deletions build-support/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set -e -x

cd `dirname $0`

python3 -m pip install pyyaml
CPP_CLIENT_VERSION=$(./dep-version.py pulsar-cpp ../dependencies.yaml)
PYBIND11_VERSION=$(./dep-version.py pybind11 ../dependencies.yaml)
source ./dep-url.sh
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def build_extension(self, ext):
# avro dependencies
extras_require["avro"] = sorted(
{
"fastavro==1.7.3"
"fastavro>=1.9.2"
}
)

Expand Down

0 comments on commit 2b80847

Please sign in to comment.