fix(download): retrieve full folder to resolve type error

Retrieve the full Folder object from FoldersApi instead of using the
FolderSimple returned by find_sub_folder when resolving DOI subfolders.
This fixes a type checker error under the upgraded pyright, and avoids
a potential AttributeError at runtime due to FolderSimple lacking the
path attribute.

Also upgrade dependencies and bump version to 1.3.16 in pyproject.toml.
This commit is contained in:
2026-06-12 10:25:03 +09:00
parent 5bdf837941
commit 809140dfbc
2 changed files with 12 additions and 11 deletions
+3 -2
View File
@@ -98,9 +98,10 @@ class DownloadCommand(BaseCommand):
cls.__multiple_download(connection, context) cls.__multiple_download(connection, context)
return return
else: else:
folder = r_parent_folder.find_sub_folder(r_basename) folder_simple = r_parent_folder.find_sub_folder(r_basename)
if folder is None: if folder_simple is None:
raise IllegalArgumentException(f"File or folder `{subpath_clean}` not found.") raise IllegalArgumentException(f"File or folder `{subpath_clean}` not found.")
folder = FoldersApi(connection).retrieve(folder_simple.id)
is_folder = True is_folder = True
# For a DOI target the whole folder is the download target. # For a DOI target the whole folder is the download target.
+9 -9
View File
@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "mdrs-client-python" name = "mdrs-client-python"
version = "1.3.15" version = "1.3.16"
description = "The mdrs-client-python is python library and a command-line client for up- and downloading files to and from MDRS based repository." description = "The mdrs-client-python is python library and a command-line client for up- and downloading files to and from MDRS based repository."
authors = ["Yoshihiro OKUMURA <yoshihiro.okumura@riken.jp>"] authors = ["Yoshihiro OKUMURA <yoshihiro.okumura@riken.jp>"]
license = "MIT" license = "MIT"
@@ -24,20 +24,20 @@ packages = [
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.10" python = "^3.10"
requests = "^2.32.3" requests = "^2.34.2"
requests-toolbelt = "^1.0.0" requests-toolbelt = "^1.0.0"
python-dotenv = "^1.1.0" python-dotenv = "^1.1.0"
pydantic = "^2.11.4" pydantic = "^2.13.4"
pydantic-settings = "^2.9.1" pydantic-settings = "^2.14.1"
PyJWT = "^2.10.1" PyJWT = "^2.13.0"
validators = "^0.34.0" validators = "^0.35.0"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
black = "^24.10.0" black = "^26.5.1"
flake8 = "^7.2.0" flake8 = "^7.2.0"
Flake8-pyproject = "^1.2.3" Flake8-pyproject = "^1.2.3"
isort = "^5.13.2" isort = "^8.0.1"
pyright = "^1.1.400" pyright = "^1.1.401"
[tool.poetry.scripts] [tool.poetry.scripts]
mdrs = 'mdrsclient.__main__:main' mdrs = 'mdrsclient.__main__:main'