feat!: adopt Python 3.14 and 3.15 language features
Build and Push Docker Container / build-and-push (push) Successful in 2m25s

- Require Python 3.15 for the server and Python 3.14 for the CLI.
- Match the server requirement to quart_common's Python 3.15 features.
- Replace future annotations with native deferred evaluation.
- Defer CLI command dependencies and QR imports on Python 3.15.
- Enable argparse suggestions for mistyped CLI commands.
- Remove the obsolete tomllib import fallback.
- Update my_helpers and quart_common submodule references.
- Lock test dependencies and exclude them from Docker installations.
- Add regression coverage for lazy imports and deferred annotations.
- Document runtime requirements and standalone CLI validation.
- Validate 276 tests on Python 3.15 and 18 CLI tests on Python 3.14.

BREAKING CHANGE: The server now requires Python 3.15+ and the standalone CLI requires Python 3.14+.
This commit is contained in:
2026-10-26 14:47:29 +01:00
parent 3db374b1ab
commit 73fdeacbfe
38 changed files with 222 additions and 442 deletions
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import sys
from .cli import main
+2 -7
View File
@@ -1,13 +1,8 @@
from __future__ import annotations
import os
import sys
from pathlib import Path
try:
import tomllib
except ImportError: # pragma: no cover
tomllib = None
import tomllib
from .config import DEFAULT_CONFIG
from .http_client import NanoShareClient
@@ -24,7 +19,7 @@ def parse_registry_env(value: str) -> dict[str, str]:
return registry
def load_config(path: str | os.PathLike | None) -> dict:
if not path or tomllib is None:
if not path:
return {}
config_path = Path(path).expanduser()
if not config_path.is_file():
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import secrets
import threading
import webbrowser
+15 -2
View File
@@ -1,4 +1,13 @@
from __future__ import annotations
# Python 3.15 defers command-specific imports; 3.14 imports them normally.
__lazy_modules__ = [
"nanoshare_client.app",
"nanoshare_client.auth",
"nanoshare_client.client",
"nanoshare_client.completion",
"nanoshare_client.sync",
"nanoshare_client.table",
"nanoshare_client.watch",
]
import argparse
import json
@@ -120,7 +129,11 @@ def _add_common(parser: argparse.ArgumentParser) -> None:
parser.add_argument('--node', default=DEFAULT_NODE, help='NanoShare node name.')
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(prog='nanoshare', description='NanoShare CLI and folder sync client.')
parser = argparse.ArgumentParser(
prog='nanoshare',
description='NanoShare CLI and folder sync client.',
suggest_on_error=True,
)
sub = parser.add_subparsers(dest='command', required=True)
login = sub.add_parser('login', help='Login via browser and write CLI config.')
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import base64
import mimetypes
from pathlib import Path
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
_ZSH = r'''# nanoshare zsh completion -- add to ~/.zshrc: eval "$(nanoshare completion zsh)"
_nanoshare_files() {
local id path name size label
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from pathlib import Path
DEFAULT_CONFIG = Path('~/.config/nanoshare/config.toml').expanduser()
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import time
import uuid
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import hashlib
import json
import os
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from fnmatch import fnmatch
from pathlib import Path
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from pathlib import PurePosixPath
def split_remote_path(value: str, file_id: str = '') -> tuple[str, str]:
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import hashlib
import json
import os
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from collections.abc import Iterable
def _display_width(value: str) -> int:
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import sys
import threading
import time
+1 -1
View File
@@ -3,7 +3,7 @@ name = "nanoshare-cli"
version = "0.4.2"
description = "NanoShare desktop CLI and folder sync client"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.14"
dependencies = [
"httpx==0.28.1",
"watchdog==6.0.0",