flake8 reported 49 findings and pyright 10, and two of them were real bugs rather than matters of style. The rest were unused imports and four functions over the complexity limit. - Unlock a DOI folder with the id the DOI response carries, rather than an attribute the model does not have, which raised `AttributeError` on every locked DOI folder. - Size the `ls` Size column from the sub-folder on the row rather than from its parent, which pushed the later columns out of line. - Share the path resolution and the destination checks between `cp` and `mv`, and split the recursive download and the `ls` row printing, bringing all four functions under the complexity limit. - Accept a client built without a connection, which `config` and `version` rely on, and report the reason if one is then asked for. - Declare the config protocol's constructor for the type checker alone, so the protocol keeps its guard against being instantiated. - Remove 41 unused imports, and let flake8 accept black's spacing. - Point pyright at the project's own environment, without which it resolved no dependency and reported 124 findings that were not real. - Cover the two fixes and the shared `cp`/`mv` paths with new tests.
92 lines
2.4 KiB
TOML
92 lines
2.4 KiB
TOML
[build-system]
|
|
requires = ["flit_core>=3.12.0,<4.0.0"]
|
|
build-backend = "flit_core.buildapi"
|
|
|
|
[tool.flit.module]
|
|
name = "mdrsclient"
|
|
|
|
[project]
|
|
name = "mdrs-client-python"
|
|
version = "1.3.18"
|
|
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 = [
|
|
{ name = "Yoshihiro OKUMURA", email = "yoshihiro.okumura@riken.jp" }
|
|
]
|
|
license = { text = "MIT" }
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"Environment :: Console",
|
|
"Intended Audience :: Developers",
|
|
"Intended Audience :: Science/Research",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Programming Language :: Python :: 3.14",
|
|
"OSI Approved :: MIT License",
|
|
"Topic :: Utilities",
|
|
]
|
|
|
|
dependencies = [
|
|
"requests>=2.34.2",
|
|
"requests-toolbelt>=1.0.0",
|
|
"python-dotenv>=1.2.2",
|
|
"pydantic>=2.13.4",
|
|
"pydantic-settings>=2.14.2",
|
|
"PyJWT>=2.13.0",
|
|
"validators>=0.35.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"black>=26.5.1",
|
|
"flake8>=7.3.0",
|
|
"Flake8-pyproject>=1.2.4",
|
|
"isort>=8.0.1",
|
|
"pyright>=1.1.411",
|
|
]
|
|
|
|
[project.scripts]
|
|
mdrs = "mdrsclient.__main__:main"
|
|
|
|
[tool.black]
|
|
line-length = 120
|
|
target-version = ['py310']
|
|
include = '\.pyi?$'
|
|
exclude = '''
|
|
/(
|
|
\.git
|
|
| \.venv
|
|
| __pycache__
|
|
| dist
|
|
)/
|
|
'''
|
|
|
|
[tool.flake8]
|
|
exclude = ".git, .venv, __pycache__, dist"
|
|
max-complexity = 10
|
|
max-line-length = 120
|
|
# E203 flags the space black puts before a slice colon. Black formats this project, so
|
|
# its output is the standard and flake8 has to accept it.
|
|
extend-ignore = ["E203"]
|
|
|
|
[tool.isort]
|
|
profile = "black"
|
|
line_length = 120
|
|
|
|
[tool.mypy]
|
|
|
|
[tool.pyright]
|
|
typeCheckingMode = "basic"
|
|
# This project keeps its environment in `./.venv`. Named explicitly because without it
|
|
# pyright falls back to the system interpreter, cannot resolve pydantic, and reports every
|
|
# model field as an unknown argument. An environment kept elsewhere gets that same fallback
|
|
# and can override it with a local `pyrightconfig.json` or `pyright --pythonpath`.
|
|
venvPath = "."
|
|
venv = ".venv"
|
|
exclude = ["**/__pycache__", "**/.*", "dist"]
|
|
#reportUnknownMemberType = "warning"
|
|
#reportUnknownVariableType = "warning"
|