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
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,17 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "ubuntu-24.04-arm", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's extremely advisable to extract such changes into a separate PR.
I assume dropping Python 3.8 support was needed to bump the sdk version, but it would have been much better if we had a separate PR for it first.

python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
exclude:
- os: "macos-latest"
python-version: "pypy3.10"
- os: "windows-latest"
python-version: "pypy3.10"
# Workaround for https://github.com/actions/setup-python/issues/696
- os: "macos-latest"
python-version: 3.8
- os: "macos-latest"
python-version: 3.9
include:
# Workaround for https://github.com/actions/setup-python/issues/696
- os: "macos-13"
python-version: 3.8
- os: "macos-13"
python-version: 3.9
steps:
Expand Down Expand Up @@ -129,7 +125,7 @@ jobs:
run: nox -vs integration -p ${{ matrix.python-version }} -- -m "not require_secrets"
- name: Run integration tests (with secrets)
# Limit CI workload by running integration tests with secrets only on edge Python versions.
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' && contains(fromJSON('["3.8", "pypy3.10", "3.13"]'), matrix.python-version) }}
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' && contains(fromJSON('["3.9", "pypy3.10", "3.13"]'), matrix.python-version) }}
run: nox -vs integration -p ${{ matrix.python-version }} -- -m "require_secrets" --cleanup
test-docker:
timeout-minutes: 90
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ doc/source/main_help.rst
doc/source/subcommands
Dockerfile
b2/licenses_output.txt
*.spec
*.spec
.env
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ With `nox`, you can run different sessions (default are `lint` and `test`):

* `format` -> Format the code.
* `lint` -> Run linters.
* `test` (`test-3.8`, `test-3.9`, `test-3.10`, `test-3.11`) -> Run test suite.
* `test` (`test-3.9`, `test-3.10`, `test-3.11`) -> Run test suite.
* `cover` -> Perform coverage analysis.
* `build` -> Build the distribution.
* `generate_dockerfile` -> generate dockerfile
Expand Down
3 changes: 1 addition & 2 deletions b2/_internal/_cli/argcompleters.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,11 @@ def b2uri_file_completer(prefix: str, parsed_args, **kwargs):
from b2sdk.v3 import LIST_FILE_NAMES_MAX_LIMIT, unprintable_to_hex

from b2._internal._cli.b2api import _get_b2api_for_profile
from b2._internal._utils.python_compat import removeprefix
from b2._internal._utils.uri import parse_b2_uri

api = _get_b2api_for_profile(getattr(parsed_args, 'profile', None))
if prefix.startswith('b2://'):
prefix_without_scheme = removeprefix(prefix, 'b2://')
prefix_without_scheme = prefix.removeprefix('b2://')
if '/' not in prefix_without_scheme:
return [
f'b2://{unprintable_to_hex(bucket.name)}/'
Expand Down
4 changes: 2 additions & 2 deletions b2/_internal/_cli/b2args.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import argparse
import functools
from os import environ
from typing import Optional, Tuple, Union
from typing import Optional, Union

from b2._internal._cli.arg_parser_types import wrap_with_argument_type_error
from b2._internal._cli.argcompleters import b2uri_file_completer, bucket_name_completer
Expand Down Expand Up @@ -242,5 +242,5 @@ def add_b2id_or_file_like_b2_uri_or_bucket_name_argument(
return arg


def get_keyid_and_key_from_env_vars() -> Tuple[Optional[str], Optional[str]]:
def get_keyid_and_key_from_env_vars() -> tuple[Optional[str], Optional[str]]:
return environ.get(B2_APPLICATION_KEY_ID_ENV_VAR), environ.get(B2_APPLICATION_KEY_ENV_VAR)
22 changes: 0 additions & 22 deletions b2/_internal/_utils/python_compat.py

This file was deleted.

2 changes: 1 addition & 1 deletion b2/_internal/_utils/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

import dataclasses
import re
from collections.abc import Sequence
from functools import singledispatchmethod
from pathlib import Path
from typing import Sequence

from b2sdk.v3 import (
B2Api,
Expand Down
7 changes: 3 additions & 4 deletions b2/_internal/console_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import warnings

from b2._internal._cli.autocomplete_cache import AUTOCOMPLETE # noqa
from b2._internal._utils.python_compat import removeprefix

AUTOCOMPLETE.autocomplete_from_cache()

Expand Down Expand Up @@ -49,7 +48,7 @@
from concurrent.futures import Executor, Future, ThreadPoolExecutor
from contextlib import suppress
from enum import Enum
from typing import Any, BinaryIO, List
from typing import Any, BinaryIO

import b2sdk
import requests
Expand Down Expand Up @@ -782,7 +781,7 @@ def _setup_parser(cls, parser):
super()._setup_parser(parser)

def get_b2_uri_from_arg(self, args: argparse.Namespace) -> B2URI:
return B2URI(removeprefix(args.bucketName or '', 'b2://'), args.folderName or '')
return B2URI((args.bucketName or '').removeprefix('b2://'), args.folderName or '')


class B2IDOrB2URIMixin:
Expand Down Expand Up @@ -884,7 +883,7 @@ def _setup_parser(cls, parser):
add_normalized_argument(
lifecycle_group,
'--lifecycle-rules',
type=functools.partial(validated_loads, expected_type=List[LifecycleRule]),
type=functools.partial(validated_loads, expected_type=list[LifecycleRule]),
help='(deprecated; use --lifecycle-rule instead) List of lifecycle rules in JSON format.',
)

Expand Down
3 changes: 1 addition & 2 deletions b2/_internal/version_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

import pathlib
import re
from typing import List

RE_VERSION = re.compile(r'[_]*b2v(\d+)')


def get_versions() -> List[str]:
def get_versions() -> list[str]:
return [path.name for path in sorted(pathlib.Path(__file__).parent.glob('*b2v*'))]


Expand Down
1 change: 1 addition & 0 deletions changelog.d/+b2sdk_testing.infrastructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use b2sdk pytest plugin and utilities in tests.
1 change: 1 addition & 0 deletions changelog.d/+python38.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dropped support for python 3.8.
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
[
'pypy3.9',
'pypy3.10',
'3.8',
'3.9',
'3.10',
'3.11',
Expand Down
Loading
Loading