Skip to content

Commit 4987fb4

Browse files
committed
Make compatible with Python 3.14
By: - use asyncpg version that support 3.14 - drop fs package, it was unused - replace pkgutil with importlib
1 parent f041ab6 commit 4987fb4

5 files changed

Lines changed: 9 additions & 56 deletions

File tree

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ ignore =
7979
WPS436,
8080
; Found `noqa` comments overuse
8181
WPS402,
82+
; Sphinx understands those multiline strings as docstrings, so we need to ignore them for flake8
83+
WPS462,
8284

8385
per-file-ignores =
8486
; all tests

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ yarl = "^1.7.2"
2121
ujson = "^5.1.0"
2222
sqlalchemy = {extras = ["asyncio"], version = "^2.0.7"}
2323
alembic = "^1.10.2"
24-
asyncpg = "^0.29.0"
24+
asyncpg = "^0.31.0"
2525
python-multipart = "^0.0.6"
2626
aiofiles = "^23.1.0"
2727
asyncssh = "^2.13.1"
2828
pyyaml = "^6.0"
2929
arq = "0.25.0"
30-
fs = "^2.4.16"
3130
python-jose = {extras = ["cryptography"], version = "^3.3.0"}
3231
# poetry has upper limit for jsonschema, so lowering ourselves to it
3332
# unreleased poetry > 1.6.1 will use latest fastjsonschema

src/bartender/shared/dirac_config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import pkgutil
1+
from importlib.util import find_spec
22
from typing import Literal, Optional
33

44
from pydantic import BaseModel
55

6-
DIRAC_INSTALLED = (
7-
pkgutil.find_loader("DIRAC") is not None
8-
) # noqa: WPS462 sphinx understands
6+
DIRAC_INSTALLED = find_spec("DIRAC") is not None
97
"""True if DIRAC package is installed, False otherwise.""" # noqa: E501, WPS322, WPS428 sphinx understands
108

119

src/bartender/web/api/job/archive.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/bartender/web/api/job/views.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import zlib
22
from pathlib import Path
33
from shutil import rmtree
4-
from typing import Annotated, Optional, Set, Tuple
4+
from typing import Annotated, Literal, Optional, Set, Tuple
55

66
from aiofiles.os import unlink
77
from fastapi import (
@@ -36,7 +36,6 @@
3636
walk_dir,
3737
walk_dir_generator,
3838
)
39-
from bartender.web.api.job.archive import ArchiveFormat
4039
from bartender.web.api.job.interactive_apps import InteractiveAppResult, run
4140
from bartender.web.api.job.schema import JobModelDTO
4241
from bartender.web.api.job.sync import sync_state, sync_states
@@ -367,6 +366,9 @@ def _remove_archive(filename: str) -> None:
367366
Path(filename).unlink()
368367

369368

369+
ArchiveFormat = Literal[".zip", ".tar", ".tar.xz", ".tar.gz", ".tar.bz2"]
370+
371+
370372
@router.get(
371373
"/{jobid}/archive",
372374
responses={

0 commit comments

Comments
 (0)