Compare commits

..

No commits in common. "main" and "v1.3.8" have entirely different histories.
main ... v1.3.8

7 changed files with 17 additions and 33 deletions

View File

@ -16,11 +16,7 @@
"mdrsclient",
"neurodata",
"Neuroinformatics",
"orcid",
"RIKEN"
],
"ignorePaths": [
".env",
"__pycache__"
]
"ignorePaths": [".env", "__pycache__"]
}

1
.gitignore vendored
View File

@ -161,4 +161,3 @@ cython_debug/
# mdrs-cli
.neurodatacli.config
poetry.toml

View File

@ -1 +1 @@
1.3.11
1.3.7

View File

@ -20,10 +20,8 @@ class UsersCurrentResponseLaboratory:
class UsersApiCurrentResponse:
id: int
username: str
first_name: str
last_name: str
full_name: str
email: str
orcid_id: str
laboratories: list[UsersCurrentResponseLaboratory]
is_staff: bool
is_active: bool

View File

@ -59,13 +59,8 @@ class DownloadCommand(BaseCommand):
@classmethod
def download(
cls,
remote_path: str,
local_path: str,
is_recursive: bool,
is_skip_if_exists: bool,
password: str | None,
excludes: list[str],
cls, remote_path: str, local_path: str, is_recursive: bool, is_skip_if_exists: bool, password: str | None,
excludes: list[str]
) -> None:
(remote, laboratory_name, r_path) = cls._parse_remote_host_with_path(remote_path)
r_path = r_path.rstrip("/")
@ -105,7 +100,7 @@ class DownloadCommand(BaseCommand):
folder_id: str,
basedir: str,
excludes: list[str],
is_skip_if_exists: bool,
is_skip_if_exists: bool
) -> None:
context = DownloadContext(False, is_skip_if_exists, [])
folder = folder_api.retrieve(folder_id)
@ -145,14 +140,11 @@ class DownloadCommand(BaseCommand):
try:
file_api.download(info.file, info.path)
except Exception:
print(f"Failed: ${info.path}")
if os.path.isfile(info.path):
os.remove(info.path)
return False
print(info.path)
return True
@classmethod
def __check_excludes(cls, excludes: list[str], laboratory: Laboratory, folder: Folder, file: File | None) -> bool:
path = f"/{laboratory.name}{folder.path}{file.name if file is not None else ''}".rstrip("/").lower()
path = f"/{laboratory.name}{folder.path}{file.name if file is not None else ""}".rstrip("/").lower()
return path in excludes

View File

@ -2,7 +2,7 @@ import configparser
import os
from typing import Final
import validators
import validators # type: ignore
from mdrsclient.exceptions import IllegalArgumentException
from mdrsclient.settings import CONFIG_DIRNAME
@ -41,7 +41,7 @@ class ConfigFile:
@url.setter
def url(self, url: str) -> None:
if not validators.url(url):
if not validators.url(url): # type: ignore
raise IllegalArgumentException("malformed URI sequence")
self.__load()
if self.__config.has_section(self.remote):

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "mdrs-client-python"
version = "1.3.11"
version = "1.3.8"
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>"]
license = "MIT"
@ -13,7 +13,6 @@ classifiers=[
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"OSI Approved :: MIT License",
"Topic :: Utilities",
]
@ -26,17 +25,17 @@ python = "^3.10"
requests = "^2.32.3"
requests-toolbelt = "^1.0.0"
python-dotenv = "^1.0.1"
pydantic = "^2.10.5"
pydantic-settings = "^2.7.1"
PyJWT = "^2.10.1"
validators = "^0.34.0"
pydantic = "^2.9.2"
pydantic-settings = "^2.5.2"
PyJWT = "^2.9.0"
validators = "^0.33.0"
[tool.poetry.group.dev.dependencies]
black = "^24.10.0"
black = "^24.8.0"
flake8 = "^7.1.1"
Flake8-pyproject = "^1.2.3"
isort = "^5.13.2"
pyright = "^1.1.391"
pyright = "^1.1.380"
[tool.poetry.scripts]
mdrs = 'mdrsclient.__main__:main'