Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 31 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
FORCE_COLOR: '1' # Make tools pretty.
PIP_DISABLE_PIP_VERSION_CHECK: '1'
PIP_NO_PYTHON_VERSION_WARNING: '1'
PYTHON_LATEST: '3.13'
PYTHON_LATEST: '3.12'
jobs:
lint:
name: Check linting
Expand Down Expand Up @@ -45,10 +45,6 @@ jobs:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
use-cython: ['true', 'false']
experimental: [false]
include:
- python-version: 'pypy3.9'
use-cython: false
experimental: true
env:
USE_CYTHON: ${{ matrix.use-cython }}
continue-on-error: ${{ matrix.experimental }}
Expand All @@ -71,6 +67,36 @@ jobs:
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
test-pypy:
name: 'Python pypy3.9/Cython: false'
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
env:
USE_CYTHON: 'false'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: pypy3.9
cache: pip
cache-dependency-path: requirements/test.txt
- name: Install dependencies
id: install
continue-on-error: true
run: |
pip install -r requirements/test.txt
pip install .
- name: Run tests
if: steps.install.outcome == 'success'
run: scripts/tests
- name: Enforce coverage
if: steps.install.outcome == 'success'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
check: # This job does nothing and is only used for the branch protection
name: ✅ Ensure the required checks passing
if: always()
Expand Down
1 change: 1 addition & 0 deletions faust/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
"""Python Stream processing."""

# :copyright: (c) 2017-2020, Robinhood Markets, Inc.
# All rights reserved.
# :license: BSD (3 Clause), see LICENSE for more details.
Expand Down
10 changes: 5 additions & 5 deletions faust/stores/aerospike.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _get(self, key: bytes) -> Optional[bytes]:
key = (self.namespace, self.table_name, key)
fun = self.client.get
try:
(key, meta, bins) = self.aerospike_fun_call_with_retry(fun=fun, key=key)
key, meta, bins = self.aerospike_fun_call_with_retry(fun=fun, key=key)
if bins:
return bins[self.BIN_KEY]
return None
Expand Down Expand Up @@ -173,7 +173,7 @@ def _itervalues(self) -> Iterator[bytes]:
fun=fun, namespace=self.namespace, set=self.table_name
)
for result in scan.results():
(key, meta, bins) = result
key, meta, bins = result
if bins:
yield bins[self.BIN_KEY]
else:
Expand All @@ -193,8 +193,8 @@ def _iteritems(self) -> Iterator[Tuple[bytes, bytes]]:
fun=fun, namespace=self.namespace, set=self.table_name
)
for result in scan.results():
(key_data, meta, bins) = result
(ns, set, policy, key) = key_data
key_data, meta, bins = result
ns, set, policy, key = key_data

if bins:
bins = bins[self.BIN_KEY]
Expand All @@ -214,7 +214,7 @@ def _contains(self, key: bytes) -> bool:
try:
if self.app.conf.store_check_exists:
key = (self.namespace, self.table_name, key)
(key, meta) = self.aerospike_fun_call_with_retry(
key, meta = self.aerospike_fun_call_with_retry(
fun=self.client.exists, key=key
)
if meta:
Expand Down
6 changes: 3 additions & 3 deletions faust/transport/drivers/aiokafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
import aiokafka
import aiokafka.abc
import opentracing
from packaging.version import Version

_AIOKAFKA_HAS_API_VERSION = Version(aiokafka.__version__) < Version("0.13.0")
from aiokafka import TopicPartition
from aiokafka.consumer.group_coordinator import OffsetCommitRequest
from aiokafka.coordinator.assignors.roundrobin import RoundRobinPartitionAssignor
Expand All @@ -55,6 +52,7 @@
from mode.utils.objects import cached_property
from mode.utils.times import Seconds, humanize_seconds_ago, want_seconds
from opentracing.ext import tags
from packaging.version import Version
from yarl import URL

from faust.auth import (
Expand Down Expand Up @@ -88,6 +86,8 @@
from faust.types.transports import ConsumerT, PartitionerT, ProducerT
from faust.utils.tracing import noop_span, set_current_span, traced_from_parent_span

_AIOKAFKA_HAS_API_VERSION = Version(aiokafka.__version__) < Version("0.13.0")

__all__ = ["Consumer", "Producer", "Transport"]

# if not hasattr(aiokafka, '__robinhood__'): # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/transport/drivers/test_aiokafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import faust
from faust import auth
from faust.exceptions import ImproperlyConfigured, NotReady
from faust.transport.drivers.aiokafka import _AIOKAFKA_HAS_API_VERSION
from faust.sensors.monitor import Monitor
from faust.transport.drivers import aiokafka as mod
from faust.transport.drivers.aiokafka import (
_AIOKAFKA_HAS_API_VERSION,
SLOW_PROCESSING_CAUSE_AGENT,
SLOW_PROCESSING_CAUSE_STREAM,
SLOW_PROCESSING_EXPLAINED,
Expand Down
Loading