Skip to content

Commit df02db8

Browse files
committed
Chore: Use Python 3.14 as default version
Throughout the project we have scattered references to building with Python 3.9, in documentation, in our tox.ini, and in CI. The last of those is the most important, because it means our CI builds, tests, and lints against Python 3.9, rather than a more modern version of Python. This patch changes our defaults to Python 3.14. This is safe, because we still build our wheels against all versions of Python in CI. Unfortunately, in doing so, we bump the version of black and flake that we are using for format linting, so this patch also has to reformat a few test files. Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
1 parent 3f78f32 commit df02db8

9 files changed

Lines changed: 27 additions & 40 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ jobs:
194194
key: ${{ needs.blazingmq-dependency.outputs.deps_cache_key }}
195195
- name: Restore cached BlazingMQ build artifacts
196196
run: tar xzf blazingmq_artifacts.tar.gz
197-
- name: Set up Python 3.9
197+
- name: Set up Python 3.14
198198
uses: actions/setup-python@v5
199199
with:
200-
python-version: "3.9"
200+
python-version: "3.14"
201201
- name: Create virtual environment
202202
run: |
203203
python3 -m venv venv
@@ -245,7 +245,7 @@ jobs:
245245
- name: Set up Python
246246
uses: actions/setup-python@v5
247247
with:
248-
python-version: "3.9"
248+
python-version: "3.14"
249249
- name: Create virtual environment
250250
run: |
251251
python3 -m venv venv

‎docs/BUILD.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ CI to test on all other combinations in your pull request. See
88
`.github/workflows/build.yaml` for more details on how we build and
99
test on all supported interpreters and architectures.
1010

11-
The instructions below assume `PYEXEC=python3.9` and will focus on Linux only.
12-
This should be sufficient in most cases.
11+
The instructions below assume `PYEXEC=python3.14` and will focus on
12+
Linux only. This should be sufficient in most cases.
1313

1414
Before following any of the instructions, make sure to `git clone` the project onto the host machine.
1515

‎requirements-lint-docs.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
black
2-
flake8<5
2+
flake8
33
isort
44
mypy
55
recommonmark

‎tests/integration/test_basic.py‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ def callback(*args):
6868

6969
def test_session_stopped_atexit():
7070
# GIVEN
71-
program = textwrap.dedent(
72-
"""
71+
program = textwrap.dedent("""
7372
import blazingmq
7473
# make sure this works even if monkey-patched
7574
blazingmq._ext.ensure_stop_session = print
@@ -86,8 +85,7 @@ def event_handler(event):
8685
s = blazingmq.Session(event_handler, print)
8786
e.wait()
8887
atexit.register(print, "last atexit handler")
89-
"""
90-
)
88+
""")
9189

9290
# WHEN
9391
process = subprocess.Popen(
@@ -161,8 +159,7 @@ def test_session_reassignment():
161159

162160
def test_session_ref_cycle_interpreter_shutdown(capsys):
163161
# GIVEN
164-
program = textwrap.dedent(
165-
"""
162+
program = textwrap.dedent("""
166163
import blazingmq
167164
import os
168165
@@ -177,8 +174,7 @@ def on_session2(event):
177174
178175
session1.other = session2
179176
session2.other = session1
180-
"""
181-
)
177+
""")
182178

183179
# WHEN
184180
process = subprocess.Popen(

‎tests/integration/test_deadlock_detection.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727

2828
def test_deadlock_detection_warning(unique_queue):
2929
# GIVEN
30-
program = textwrap.dedent(
31-
"""
30+
program = textwrap.dedent("""
3231
import blazingmq
3332
3433
import resource
@@ -66,8 +65,7 @@ def main():
6665
main()
6766
message_processed.set()
6867
time.sleep(10)
69-
"""
70-
).format(unique_queue=unique_queue)
68+
""").format(unique_queue=unique_queue)
7169

7270
# WHEN
7371
process = subprocess.Popen(

‎tests/integration/test_examples.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929

3030

3131
def script_wrapper(queue, script):
32-
return textwrap.dedent(
33-
"""
32+
return textwrap.dedent("""
3433
import signal
3534
3635
import examples.{} as script
@@ -42,8 +41,7 @@ def script_wrapper(queue, script):
4241
signal.signal(signal.SIGTERM, script.on_signal)
4342
4443
script.main()
45-
"""
46-
).format(script, queue)
44+
""").format(script, queue)
4745

4846

4947
def run_wrapper(queue, script):

‎tests/unit/test_ball_log_redirection.py‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@
2727
)
2828
def test_ball_logger_redirection(diagnostics_enabled, logger_level, emitted):
2929
# GIVEN
30-
program = textwrap.dedent(
31-
"""
30+
program = textwrap.dedent("""
3231
import blazingmq._ext
3332
import logging
3433
logging.basicConfig(level='%s')
35-
"""
36-
% logger_level
37-
)
34+
""" % logger_level)
3835

3936
env = os.environ.copy()
4037
if diagnostics_enabled:
@@ -59,14 +56,12 @@ def test_ball_logger_redirection(diagnostics_enabled, logger_level, emitted):
5956

6057
def test_ball_logger_python_exception_handling():
6158
# GIVEN
62-
program = textwrap.dedent(
63-
"""
59+
program = textwrap.dedent("""
6460
import blazingmq._ext
6561
import logging
6662
logging.basicConfig(level="DEBUG")
6763
logging.setLogRecordFactory("something not callable")
68-
"""
69-
)
64+
""")
7065

7166
env = os.environ.copy()
7267
env["_PYBMQ_ENABLE_DIAGNOSTICS"] = "1"

‎tests/unit/test_messages.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class FakeSession:
157157
spy.assert_called_once()
158158
args, kwargs = spy.call_args
159159
assert not kwargs
160-
(msg, msg_handle) = args
160+
msg, msg_handle = args
161161
assert isinstance(msg, blazingmq.Message)
162162
assert isinstance(msg_handle, blazingmq.MessageHandle)
163163
assert msg.data == raw[0]

‎tox.ini‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py39,lint, lint-cython, lint-types, black, docs
2+
envlist = py314,lint, lint-cython, lint-types, black, docs
33
minversion = 3.2.1
44
isolated_build = true
55

@@ -32,45 +32,45 @@ description =
3232

3333
[testenv:.package]
3434
description = Isolated build environment
35-
basepython = python3.9
35+
basepython = python3.14
3636

37-
[testenv:py39-cov]
37+
[testenv:py314-cov]
3838
usedevelop = True
3939
commands = {[testenv]commands_cov}
4040
deps = -rrequirements-test-coverage.txt
4141

4242
[testenv:lint]
4343
description = Run lint checker on Python files
44-
basepython = python3.9
44+
basepython = python3.14
4545
deps = flake8
4646
skip_install = true
4747
commands = {basepython} -m flake8 --config={toxinidir}/.flake8 src
4848

4949
[testenv:lint-cython]
5050
description = Run lint checker on Cython files
51-
basepython = python3.9
51+
basepython = python3.14
5252
deps = flake8
5353
skip_install = true
5454
commands = {basepython} -m flake8 --config={toxinidir}/.flake8.cython src
5555

5656

5757
[testenv:lint-types]
5858
description = Run mypy checker on examples
59-
basepython = python3.9
59+
basepython = python3.14
6060
deps =
6161
mypy
6262
commands = {basepython} -m mypy --strict examples
6363

6464
[testenv:black]
6565
description = Check that python files are formatted with black
66-
basepython = python3.9
66+
basepython = python3.14
6767
deps = black
6868
skip_install = true
6969
commands = {basepython} -m black --check --verbose src tests
7070

7171
[testenv:docs]
7272
description = Generate library documentation
73-
basepython = python3.9
73+
basepython = python3.14
7474
deps = -rrequirements-lint-docs.txt
7575
commands = make -C docs html
7676
{basepython} -c 'print("documentation available under file://{toxworkdir}/docs_out/index.html")'

0 commit comments

Comments
 (0)