Skip to content

Commit

Permalink
Add official support for Python 3.12 (#587)
Browse files Browse the repository at this point in the history
* Add official support for Python 3.12

* commit remaining lint changes
  • Loading branch information
wbarnha authored Dec 9, 2023
1 parent 53dfd18 commit 3554266
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
7 changes: 2 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.11'
PYTHON_LATEST: '3.12'

# For re-actors/checkout-python-sdist
sdist-artifact: python-package-distributions
Expand Down Expand Up @@ -45,16 +45,13 @@ jobs:
# for example if a test fails only when Cython is enabled
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
use-cython: ['true', 'false']
experimental: [false]
include:
- python-version: 'pypy3.9'
use-cython: false
experimental: true
- python-version: ~3.12.0-0
experimental: true
use-cython: false
- python-version: ~3.13.0-0
experimental: true
use-cython: false
Expand Down
2 changes: 1 addition & 1 deletion faust/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def _prepare_channel(
has_prefix=has_prefix,
**kwargs,
)
raise TypeError(f"Channel must be channel, topic, or str; not {type(channel)}")
raise TypeError(f"Channel must be channel, topic, or str, not {type(channel)}")

def __call__(
self,
Expand Down
2 changes: 1 addition & 1 deletion faust/cli/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _unknown_model(
alt = text.didyoumean(
registry,
lookup,
fmt_none=f"Please run `{self.prog_name} models` for a list.",
fmt_none=f'Please run "{self.prog_name} models" for a list.',
)
return click.UsageError(f"No model {name!r}. {alt}")

Expand Down
2 changes: 1 addition & 1 deletion faust/sensors/datadog.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def __init__(
self.rate = rate
if datadog is None:
raise ImproperlyConfigured(
f"{type(self).__name__} requires `pip install datadog`."
f'{type(self).__name__} requires "pip install datadog".'
)
super().__init__(**kwargs)

Expand Down
2 changes: 1 addition & 1 deletion faust/transport/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def wait_until_ebb(self) -> None:
start_time = time.time()
await self.flush_atmost(self.max_messages)
end_time = time.time()
logger.info(f"producer flush took {end_time-start_time}")
logger.info(f"producer flush took {end_time - start_time}")

@Service.task
async def _handle_pending(self) -> None:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
Expand Down Expand Up @@ -75,6 +76,8 @@ build-backend = "setuptools.build_meta"
ignore = [
"W503",
"E203",
"E231",
"E225",
"B305",
]
max-line-length = 88
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = W503, E203, B305
ignore = W503, E203, E231, E225, B305
max-line-length = 88

[mypy-tests.*]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/agents/test_replies.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def test_parallel_iterate(self):

if pending:
raise Exception(
f"Test did not return in 5s:\n"
f"Test did not return within 5s:\n"
f" DONE_TASKS={done}\n"
f" PENDING_TASKS={pending}\n"
f" size={p.size}\n"
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = 3.11,3.10,3.9,3.8,flake8,apicheck,configcheck,typecheck,docstyle,bandit,spell
envlist = 3.12,3.11,3.10,3.9,3.8,flake8,apicheck,configcheck,typecheck,docstyle,bandit,spell

[testenv]
deps=
Expand All @@ -17,6 +17,7 @@ recreate = False
commands = py.test --random-order --open-files -xvv --cov=faust tests/unit tests/functional tests/integration tests/meticulous/ tests/regression

basepython =
3.12,flake8,apicheck,linkcheck,configcheck,typecheck,docstyle,bandit,spell: python3.12
3.11,flake8,apicheck,linkcheck,configcheck,typecheck,docstyle,bandit,spell: python3.11
3.10,flake8,apicheck,linkcheck,configcheck,typecheck,docstyle,bandit,spell: python3.10
3.9,flake8,apicheck,linkcheck,configcheck,typecheck,docstyle,bandit,spell: python3.9
Expand Down

0 comments on commit 3554266

Please sign in to comment.