Skip to content

Commit 7b9fe15

Browse files
Merge pull request #8919 from ThomasWaldmann/py314
support Python 3.14
2 parents cd07d84 + 2924fc5 commit 7b9fe15

8 files changed

Lines changed: 24 additions & 16 deletions

File tree

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
branch = True
3-
disable_warnings = module-not-measured
3+
disable_warnings = module-not-measured, no-ctracer
44
source = src/borg
55
omit =
66
*/borg/__init__.py

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ jobs:
8484
- os: ubuntu-24.04
8585
python-version: '3.13'
8686
toxenv: py313-fuse3
87+
- os: ubuntu-24.04
88+
python-version: '3.14-dev'
89+
toxenv: py314-fuse3
8790

8891
env:
8992
TOXENV: ${{ matrix.toxenv }}

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ classifiers = [
2323
"Programming Language :: Python :: 3.11",
2424
"Programming Language :: Python :: 3.12",
2525
"Programming Language :: Python :: 3.13",
26+
"Programming Language :: Python :: 3.14",
2627
"Topic :: Security :: Cryptography",
2728
"Topic :: System :: Archiving :: Backup",
2829
]
@@ -159,7 +160,7 @@ ignore_missing_imports = true
159160

160161
[tool.tox]
161162
requires = ["tox>=4.19", "pkgconfig", "cython", "wheel", "setuptools_scm"]
162-
env_list = ["py{310,311,312,313}-{none,fuse2,fuse3}", "docs", "ruff", "mypy", "bandit"]
163+
env_list = ["py{310,311,312,313,314}-{none,fuse2,fuse3}", "docs", "ruff", "mypy", "bandit"]
163164

164165
[tool.tox.env_run_base]
165166
package = "editable-legacy" # without this it does not find setup_docs when running under fakeroot
@@ -171,15 +172,15 @@ pass_env = ["*"] # fakeroot -u needs some env vars
171172
pass_env = ["*"] # needed by tox4, so env vars are visible for building borg
172173

173174
# Environment-specific configurations
174-
[tool.tox.env."py{310,311,312,313}-fuse2"]
175+
[tool.tox.env."py{310,311,312,313,314}-fuse2"]
175176
set_env = {BORG_FUSE_IMPL = "llfuse"}
176177
deps = ["-rrequirements.d/development.txt", "llfuse"]
177178

178-
[tool.tox.env."py{310,311,312,313}-fuse3"]
179+
[tool.tox.env."py{310,311,312,313,314}-fuse3"]
179180
set_env = {BORG_FUSE_IMPL = "pyfuse3"}
180181
deps = ["-rrequirements.d/development.txt", "pyfuse3"]
181182

182-
[tool.tox.env."py{310,311,312,313}-none"]
183+
[tool.tox.env."py{310,311,312,313,314}-none"]
183184
deps = ["-rrequirements.d/development.txt"]
184185

185186
[tool.tox.env.ruff]

requirements.d/development.lock.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ wheel==0.45.1
55
virtualenv==20.30.0
66
build==1.2.2
77
pkgconfig==1.5.5
8-
tox==4.24.2
9-
pytest==8.3.5
10-
pytest-xdist==3.6.1
11-
pytest-cov==6.0.0
8+
tox==4.26.0
9+
pytest==8.4.0
10+
pytest-xdist==3.7.0
11+
pytest-cov==6.2.1
1212
pytest-benchmark==5.1.0
13-
Cython==3.0.12
13+
Cython==3.1.2
1414
pre-commit==4.2.0

src/borg/archiver/debug_cmd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ def do_debug_convert_profile(self, args):
305305
"""convert Borg profile to Python profile"""
306306
import marshal
307307

308-
with args.output, args.input:
309-
marshal.dump(msgpack.unpack(args.input, use_list=False, raw=False), args.output)
308+
with open(args.output, "wb") as wfd, open(args.input, "rb") as rfd:
309+
marshal.dump(msgpack.unpack(rfd, use_list=False, raw=False), wfd)
310310

311311
def build_parser_debug(self, subparsers, common_parser, mid_common_parser):
312312
debug_epilog = process_epilog(
@@ -596,5 +596,5 @@ def build_parser_debug(self, subparsers, common_parser, mid_common_parser):
596596
help="convert Borg profile to Python profile (debug)",
597597
)
598598
subparser.set_defaults(func=self.do_debug_convert_profile)
599-
subparser.add_argument("input", metavar="INPUT", type=argparse.FileType("rb"), help="Borg profile")
600-
subparser.add_argument("output", metavar="OUTPUT", type=argparse.FileType("wb"), help="Output file")
599+
subparser.add_argument("input", metavar="INPUT", type=str, help="Borg profile")
600+
subparser.add_argument("output", metavar="OUTPUT", type=str, help="Output file")

src/borg/testsuite/archiver/debug_cmds_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import json
22
import os
33
import pstats
4+
import sys
5+
6+
import pytest
47

58
from ...constants import * # NOQA
69
from .. import changedir
@@ -10,6 +13,7 @@
1013
pytest_generate_tests = lambda metafunc: generate_archiver_tests(metafunc, kinds="local,remote,binary") # NOQA
1114

1215

16+
@pytest.mark.skipif(sys.version_info[:3] >= (3, 14, 0), reason="cProfile.Profile broken in Python 3.14.0b2")
1317
def test_debug_profile(archivers, request):
1418
archiver = request.getfixturevalue(archivers)
1519
create_test_files(archiver.input_path)

src/borg/testsuite/legacyrepository_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ def test_remote_rpc_exception_transport(remote_repository):
976976
remote_repository.call("inject_exception", {"kind": "divide"})
977977
except LegacyRemoteRepository.RPCError as e:
978978
assert e.unpacked
979-
assert e.get_message() == "ZeroDivisionError: integer division or modulo by zero\n"
979+
assert e.get_message().startswith("ZeroDivisionError:")
980980
assert e.exception_class == "ZeroDivisionError"
981981
assert len(e.exception_full) > 0
982982

src/borg/testsuite/repository_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def test_remote_rpc_exception_transport(remote_repository):
224224
remote_repository.call("inject_exception", {"kind": "divide"})
225225
except RemoteRepository.RPCError as e:
226226
assert e.unpacked
227-
assert e.get_message() == "ZeroDivisionError: integer division or modulo by zero\n"
227+
assert e.get_message().startswith("ZeroDivisionError:")
228228
assert e.exception_class == "ZeroDivisionError"
229229
assert len(e.exception_full) > 0
230230

0 commit comments

Comments
 (0)