From 03583629c323f0e15a0950463d69aabbbf1168cd Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:08:18 +0100 Subject: [PATCH 01/21] build: migrate pyproject to PEP 621 / Poetry 2, require Python 3.10 Move project metadata and dependencies from [tool.poetry] to the standard [project] table and dev dependencies to [dependency-groups], with poetry-core 2.x as the build backend. Python 3.9 is dropped. CI moves to Poetry 2.4.1 (1.8 cannot read the [project] table) and the unit test matrix becomes 3.10-3.13; the integration job runs on 3.13. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/codeql-and-tests.yml | 10 +- CHANGELOG.md | 6 + DEVELOPING.md | 6 +- README.md | 2 +- poetry.lock | 692 +++++++++++++++++++++++++ pyproject.toml | 55 +- 6 files changed, 739 insertions(+), 32 deletions(-) create mode 100644 poetry.lock diff --git a/.github/workflows/codeql-and-tests.yml b/.github/workflows/codeql-and-tests.yml index d474948..9dd2d4d 100644 --- a/.github/workflows/codeql-and-tests.yml +++ b/.github/workflows/codeql-and-tests.yml @@ -48,7 +48,7 @@ jobs: contents: read strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout repository @@ -62,7 +62,7 @@ jobs: - name: Install Poetry uses: snok/install-poetry@v1 with: - version: 1.8.4 + version: 2.4.1 virtualenvs-create: true virtualenvs-in-project: true @@ -109,15 +109,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Poetry uses: snok/install-poetry@v1 with: - version: 1.8.4 + version: 2.4.1 virtualenvs-create: true virtualenvs-in-project: true diff --git a/CHANGELOG.md b/CHANGELOG.md index b27b0a7..8e2f611 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,12 @@ All notable changes to this project will be documented in this file ## Unreleased +- Packaging: migrated `pyproject.toml` to the standard PEP 621 `[project]` + table with Poetry 2.x as the build backend. + + Potentially breaking: + - Python 3.9 is no longer supported; the minimum is now 3.10. + - Gallery upload routing and section-mismatch handling (PR #56): clearer `GallerySectionMismatch` exception, optional `on_mismatch="reroute"` policy to auto-reroute uploads into the server-chosen section, `upload()` now diff --git a/DEVELOPING.md b/DEVELOPING.md index cc26d84..5535766 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -1,17 +1,17 @@ ## Development -Python 3.9 or later is required. We aim to support only active versions of Python. +Python 3.10 or later is required. We aim to support only active versions of Python. ### Setup -Create a virtual environment with python 3.7 installed. If you use `conda`, you can do this +Create a virtual environment with a supported Python version installed. If you use `conda`, you can do this ``` conda env create -f environment.yaml conda activate rspace-client ``` -We use `poetry` for dependency management. [Install Poetry] (https://python-poetry.org/docs/#installation) +We use `poetry` (2.x) for dependency management. [Install Poetry](https://python-poetry.org/docs/#installation) From this directory, run diff --git a/README.md b/README.md index 4b7cf06..31e2a3a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Full worked examples for every feature above are in the **[Usage Guide](docs/usa | | | | -------------------- | ----------------------------------- | -| Python | 3.9 or later (see `pyproject.toml`) | +| Python | 3.10 or later (see `pyproject.toml`) | | RSpace ELN API | 1.69 or later | | RSpace Inventory API | 1.73  or later | diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..9f64926 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,692 @@ +# This file is automatically @generated by Poetry 2.4.1 and should not be changed by hand. + +[[package]] +name = "appdirs" +version = "1.4.4" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +optional = false +python-versions = "*" +groups = ["main"] +files = [ + {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, + {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, +] + +[[package]] +name = "beautifulsoup4" +version = "4.15.0" +description = "Screen-scraping library" +optional = false +python-versions = ">=3.7.0" +groups = ["main"] +files = [ + {file = "beautifulsoup4-4.15.0-py3-none-any.whl", hash = "sha256:d6f88de62e1d4e38ecb1077eb9724cd0eff29d2a08ca16a401e9b9e93f117cf9"}, + {file = "beautifulsoup4-4.15.0.tar.gz", hash = "sha256:288e3ca7d54b06f2ac191970bc275c1939cb46d450b255bf6718b04aa37ab4f7"}, +] + +[package.dependencies] +soupsieve = ">=1.6.1" +typing-extensions = ">=4.0.0" + +[package.extras] +cchardet = ["cchardet"] +chardet = ["chardet"] +charset-normalizer = ["charset-normalizer"] +html5lib = ["html5lib"] +lxml = ["lxml"] + +[[package]] +name = "black" +version = "26.5.1" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "black-26.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9942db8888e06943c5dde66ca0037dcff82a2a4ec1ad0ada9e0d2ee9d9823893"}, + {file = "black-26.5.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:89c93167a74d3a75dfaa38a5c7cca015537d5820dd7f17d63267d674a61cae90"}, + {file = "black-26.5.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22f2cd76d069cc54c71f10360744ba8983fbb616903b4304a85b734915c8e1b4"}, + {file = "black-26.5.1-cp310-cp310-win_amd64.whl", hash = "sha256:87ed5c6f450580a2f6790bc7cbfb016dfc73bc750249762268a3695361315eef"}, + {file = "black-26.5.1-cp310-cp310-win_arm64.whl", hash = "sha256:58b4bd92cf88aacf83d88479c8f9caee044b1ec55f2451a337354a7ea2590a22"}, + {file = "black-26.5.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:96ae2c733b2aabdd9986e2c5df628ff3473676cd1c5faded1ff496cf6d74083c"}, + {file = "black-26.5.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0e48b87e03bf109288e55cfceadcfa15ff5470aca2851a851950ed2926f450d7"}, + {file = "black-26.5.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5119fa92ae61f786e8c3662fd60aece1d0a2dd5cca5d0c79417a95e7a4272a59"}, + {file = "black-26.5.1-cp311-cp311-win_amd64.whl", hash = "sha256:30d3c14661f2792e9142cce3eeeb1cbc175b3eb5f733be0c8eeb99651e52b0c3"}, + {file = "black-26.5.1-cp311-cp311-win_arm64.whl", hash = "sha256:1ef92b76f7733f282fd096ea406200b5a286c42947412b0eaff3a74e3616cefe"}, + {file = "black-26.5.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4ad6fa01f941920f54f2bbb35f3df7673428a0ef98a0b0840c2eaef3b110efa8"}, + {file = "black-26.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3915f256e75a2d7cf88d8953d37f780455dc586cc72dee059c528fe77f581217"}, + {file = "black-26.5.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d98d4137277c75dfb898ec8d846c4fd68ba1e9cf77f95e2865c203dc18f4c3d"}, + {file = "black-26.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:a1dca32d9f1784af512a13410ec204c6f7f0aa9797a111c42e1c03449821c264"}, + {file = "black-26.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:1037d5ac7b7b310b2632ad867ec8d0e4c4819dcdb0b820f63135da746a24e418"}, + {file = "black-26.5.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:2b36cf2ddf5566e205f6535f782a62194a184d33e175b64ae8c40b1737522be3"}, + {file = "black-26.5.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1f7ea64ebfa01b50f693508fc39f875e264446d3b097088f84f203b9d09618a0"}, + {file = "black-26.5.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecb3e624844c798144e9bd986954e0adc81d8911a1f30f375e1252fe26e8c294"}, + {file = "black-26.5.1-cp313-cp313-win_amd64.whl", hash = "sha256:e1a26503279b6b310669fb0b219c39e4820b77e8189fe80f522bb511f247db0a"}, + {file = "black-26.5.1-cp313-cp313-win_arm64.whl", hash = "sha256:5c34b25da232ead53a6f335b76dbea124f4d152ad568b9080d6f944bc2b34b52"}, + {file = "black-26.5.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:e88976690a64b0af98312ca958415849cb42423423c5f2ee74af4b49a97a2168"}, + {file = "black-26.5.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:32d5ea7f6c8bdfa6e648326ebca1f02b0764e2a029edc6f8dce2627e19d468c3"}, + {file = "black-26.5.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ea8d16dc41655aa113cd64665e7219446cd7e4ff2248d7178eaa905190c86b18"}, + {file = "black-26.5.1-cp314-cp314-win_amd64.whl", hash = "sha256:577f21094ea469ef92ec1adaf2c9441a226d2144d01a5be2fa823cecf6543e50"}, + {file = "black-26.5.1-cp314-cp314-win_arm64.whl", hash = "sha256:ed1a20af114c301a0269bf01163d51dbef72737fd65f850001e7cbe7f3c7abae"}, + {file = "black-26.5.1-py3-none-any.whl", hash = "sha256:4ed7f7da04046d2e488437170797d3b4a4ad83906683bcb7dfc68b673bbce5e2"}, + {file = "black-26.5.1.tar.gz", hash = "sha256:dd321f668053961824bcc1be1cc1df748b2d7e4fa28086b08331e577b0100a73"}, +] + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +packaging = ">=22.0" +pathspec = ">=1.0.0" +platformdirs = ">=2" +pytokens = ">=0.4.0,<0.5.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.10)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2) ; sys_platform != \"win32\"", "winloop (>=0.5.0) ; sys_platform == \"win32\""] + +[[package]] +name = "certifi" +version = "2026.6.17" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.7" +groups = ["main", "dev"] +files = [ + {file = "certifi-2026.6.17-py3-none-any.whl", hash = "sha256:2227dcbaafe0d2f59279d1762ddddc37783ed4354594f194ffc31d20f41fc3db"}, + {file = "certifi-2026.6.17.tar.gz", hash = "sha256:024c88eeec92ca068db80f02b8b07c9cef7b9fe261d1d535abfd5abd6f6af432"}, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.9" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7" +groups = ["main", "dev"] +files = [ + {file = "charset_normalizer-3.4.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd6280cf040f233bd7d3407b743b4b4c74f70e8e1c4199cb112a62c941c0772a"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa99adc8f081b475a12843953db36831eaf83ec33eb46a90629ca6a5de45a616"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c1225416b463483160e4af85d5fc3a9690ccb53fd4b1865a6437825f5ede3209"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:16d10d789dd9bcca1173c95af82c58433122564b7bc39385124be735a35cbe99"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9bb41182d93ea91f60b4bc8fbf4c820c69ef8a12ab2d917f3f1834f1acad07e8"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux_2_31_armv7l.whl", hash = "sha256:bcf74c1df76758a395bf0af608c04c82257523f55c9868b334f06270d0f2112b"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b5314963fce9b0b12743891de876e724997864ee22aa496f903f426c7e2fa5b2"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e9701d0049d92c16703a42771b98d560b95248949f23f8cf7b4eddd201814fb9"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:65a7ff3f705e57d392f7261b6d0550fe137c3019477431f1c355e0db0a7d3e15"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79580094b00d1789d1f93ea55bc43cb2f611910c72235b7657f3482ddcc1b22d"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-win32.whl", hash = "sha256:432786d3561e69aeeae6c7e8648964ce0ad05736120135601f87ac26b9c83381"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-win_amd64.whl", hash = "sha256:8c041122946b7ba21bb32c45b1aa57b1be35527690aeb3c5c234521085632eee"}, + {file = "charset_normalizer-3.4.9-cp310-cp310-win_arm64.whl", hash = "sha256:375b83ed0aecfce76c16d198fbc21f3b11b337d68662bea0a995046682a11419"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0e94703ec9684807f20cfb5eed95c70f67f2a8f21ad620146d7b5a13677b93e5"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2a441ea71902098ffe78c5abe6c494f44160b4af614ed16c3d9a3b1d17fd8ee2"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:304b13570067b2547562e308af560b3963857b1fa90bd6afd978130130fe2d6a"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4773092f8019072343a7447203308b176e10199920eb02d6195e81bbb3274c29"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:04ce310cb89c15df659582aee80a0603788732a5e017d5bd5c81158106ce249c"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux_2_31_armv7l.whl", hash = "sha256:c0323c9daef75ef2e5083624b4585018a0c9d5e3b40f607eed81a311270b934b"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:871ff67ea1aad4dfd91736464934d56b32dac49f9fbe16cddba36198a7b3a0db"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:67830fc78e67501f47bb950471b2dcb9b35b140084429318e862895a8e89c993"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:3d92613ec25e43b05f042302531ec0f00b8445190e43325880cbd6ab7c2581da"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:280081916dc341820640489a66e4696049401ef1cf6dd672f672e70ad915aca3"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-win32.whl", hash = "sha256:ac351b3b8014eead140e77e9717e2992c6bbe30b63bc3422422eb84865412e3d"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-win_amd64.whl", hash = "sha256:6366a16e1a25018694d6a5d784d09b046edc9eac40ea2b54065c3052672516a1"}, + {file = "charset_normalizer-3.4.9-cp311-cp311-win_arm64.whl", hash = "sha256:1d22856ffbe153a602df38e4a5464f0b748a54002e0d69ac6d2ad0a197cc99ec"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:45b0cc4e3556cd875e09102988d1ab8356c998b596c9fced84547c8138b487a0"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9b2aff1c7b3884512b9512c3eaadd9bab39fb45042ffaaa1dd08ff2b9f8109d9"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9104ed0bd76a429d46f9ec0dbc9b08ad1d2dcdf2b00a5a0daa1c145329b35b44"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7b86a2b16095d250c6f58b3d9b2eee6f4147754344f3dab0922f7c9bf7d226c9"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e226f6218febc71f6c1fc2fafb91c226f75bdc1d8fb12d66823716e891608fd"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux_2_31_armv7l.whl", hash = "sha256:90c44bc373b7687f6948b693cceaea1348ae0975d7474746559494468e3c1d84"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9cdef90ae47919cae358d8ab15797a800ed41da7aba5d72419fb510729e2ed4b"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:60f44ade2cf573dad7a277e6f8ca9a51a21dda572b13bd7d8539bb3cd5dbedde"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:a1786910334ed46ab1dd73222f2cd1e05c2c3bb39f6dddb4f8b36fc382058a39"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:03d07803992c6c7bbc976327f34b18b6160327fc81cb82c9d504720ac0be3b62"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-win32.whl", hash = "sha256:78841cccf1af7b40f6f716338d50c0902dbe88d9f800b3c973b7a9a0a693a642"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-win_amd64.whl", hash = "sha256:4b3dac63058cc36820b0dd072f89898604e2d39686fe05321729d00d8ac185a0"}, + {file = "charset_normalizer-3.4.9-cp312-cp312-win_arm64.whl", hash = "sha256:78fa18e436a1a0e58dbd7e02fc4473f3f32cceb12df9dfca542d075961c307d2"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:440eede837960000d74978f0eba527be106b5b9aee0daf779d395276ed0b0614"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:21e764fd1e70b6a3e205a0e46f3051701f98a8cb3fad66eeb80e48bb502f8698"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e4fd89cc178bced6ad29cb3e6dd4aa63fa5017c3524dbd0b25998fb64a87cc8b"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:bd47ba7fc3ca94896759ea0109775132d3e7ab921fbf54038e1bab2e46c313c9"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:84fd18bcc17526fc2b3c1af7d2b9217d32c9c04448c16ec693b9b4f1985c3d33"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux_2_31_armv7l.whl", hash = "sha256:5b10cd92fc5c498b35a8635df6d5a100207f88b63a4dc1de7ef9a548e1e2cd63"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a4fbdde9dd4a9ce5fd52c2b3a347bb50cc89483ef783f1cb00d408c13f7a96c0"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:416c229f77e5ea25b3dfd4b582f8d73d7e43c22320302b9ab128a2d3a0b38efe"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:75286256590a6320cf106a0d28970d3560aad9ee09aa7b34fb40524792436d35"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:69b157c5d3292bcd443faca052f3096f637f1e074b98212a933c074ae23dc3b8"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-win32.whl", hash = "sha256:51307f5c71007673a2bf8232ad973483d281e74cb99c8c5a990af1eefa6277d9"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-win_amd64.whl", hash = "sha256:fe2c7201c642b7c308f1675355ad7ff7b66acfe3541625efe5a3ad38f29d6115"}, + {file = "charset_normalizer-3.4.9-cp313-cp313-win_arm64.whl", hash = "sha256:611057cc5d5c0afc743ba8be6bd828c17e0aaa8643f9d0a9b9bb7dea80eb8012"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:0327fcd59a935777d83410750c50600ee9571af2846f71ce40f25b13da1ef380"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8a79d9f4d8001473a30c163556b3c3bfebec837495a412dde78b51672f6134f9"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:33bdcc2a32c0a0e861f60841a512c8acc658c87c2ac59d89e3a46dacf7d866e4"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f840ed6d8ecba8255df8c42b87fadeda98ddfc6eeec05e2dc66e26d46dd6f58a"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c25fe15c70c59eb7c5ce8c06a1f3fa1da0ecc5ea1e7a5922c40fd2fa9b0d5046"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux_2_31_armv7l.whl", hash = "sha256:f7fb7d750cfa0a070d2c24e831fd3481019a60dd317ea2b39acbcebc08b6ed81"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4d1c96a7a18b9690a4d46df09e3e3382406ae3213727cd1019ebade1c4a81917"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a4cfde78a9f2880208d16a93b795726a3017d5977e08d1e162a7a31322479c41"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:d4d6fcde76f94f5cb9e43e9e9a61f16dacefd228cbbf6f1a09bd9b219a92f1a1"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:898f0e9068ca27d37f8e83a5b962821df851532e6c4a7d615c1c033f9da6eedf"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-win32.whl", hash = "sha256:c1c948747b03be832dceed96ca815cef7360de9aa19d37c730f8e3f6101aca48"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-win_amd64.whl", hash = "sha256:16b65ea0f2465b6fb52aa22de5eca612aa964ddfec00a912e26f4656cbef890b"}, + {file = "charset_normalizer-3.4.9-cp314-cp314-win_arm64.whl", hash = "sha256:40a126142a56b2dfc0aacbad1de8310cbf60da7656db0e6b16eebd48e3e93519"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:609b3ba8fcc0fb5ab7af00719d0fb6ad0cb518e48e7712d12fd68f1327951198"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:51447e9aa2684679af07ca5021c3db526e0284347ebf4ffcec1154c3350cfe32"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cc1b0fff8ead343dae06305f954eb8468ba0ec1a97881f42489d198e4ce3c632"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fa36ec09ef71d158186bc79e359ff5fdd6e7996fe8ab638f00d6b93139ba4fcf"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:df115d4d83168fdf2cae48ef1ff6d1cb4c466364e30861b37121de0f3bf1b990"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:f86c6358749bd4fda175388691e3ba8c46e24c5347d0afd20f9b7edfc9faf07d"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:32286a2c8d167e897177b673176c1e3e00d4057caf5d2b64eef9a3666b03018e"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:83aed2c10721ddd90f68140685391b50811a880af20654c59af6b6c66c40513c"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cd6c3d4b783c556fa00bf540854e42f135e2f256abd29669fcd0da0f2dec79c2"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ee2f2a527e3c1a6e6411eb4209642e138b544a2d72fe5d0d76daf77b24063534"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-win32.whl", hash = "sha256:0d861473f743244d349b50f850d10eb87aeb22bbdcc8e64f79273c94af5a8226"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-win_amd64.whl", hash = "sha256:9b8e0f3107e2200b76f6054de99016eac3ee6762713587b36baaa7e4bd2ae177"}, + {file = "charset_normalizer-3.4.9-cp314-cp314t-win_arm64.whl", hash = "sha256:19ac87f93086ce37b86e098888555c4b4bc48102279bae3350098c0ed664b501"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:253a4a220747e8b5faf57ec320c4f5efb0cef05f647420bf267143ec15dba10a"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:68ce9f4d6b26d5ccbf7fd4459bf75f74a0a146677ebba80597df60cbdb20e6f4"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:58150c9f9b9a552505912d182ccdf26f6396fb6094816ceebcbb20eecabaed94"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:df7276909358e5635ae203673ab7e509ddd224225a8d6b0790bf13eb2bde1cc5"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3c09a49d6cde137258beb3d551994a2927fd35ad5cf96aed573f61bbd67c5f84"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux_2_31_armv7l.whl", hash = "sha256:231ddcbb35e2ff8973e1365db41fe0572662893b99a05deb183b68ad4c0c8bd4"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:920079c3f7456fa213e0829ed2073aaa727fd39d889ead5b4f35d0de5460d04f"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0fa1aec2d32bcc03c8fa0f6f1712caad1adc38509f31142112e5c9daf5b9c833"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:ad41ba96094304aa090f5a30cb6e4fb3b3f1c264c523394b4c39bbacc4dc92ba"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:43b9e366a31fdd1c87d0eb08f579b4a82b723ea54338f040d6b4e518a026ea29"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-win32.whl", hash = "sha256:93d59d504b230e83c7a843251681959a0b6a9cd76f6e146ce1b8a80eb8739af9"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-win_amd64.whl", hash = "sha256:ddf4af30b417d9fe16481e9b81c27ab2a7cde1ff7ba3e85653b02db7d145dc7b"}, + {file = "charset_normalizer-3.4.9-cp39-cp39-win_arm64.whl", hash = "sha256:476743fe6dfe14a2da12e3ac79125dc84a3b2cf8094369a47a1529b0cd8549fe"}, + {file = "charset_normalizer-3.4.9-py3-none-any.whl", hash = "sha256:68e5f26a1ad57ded6d1cfb85331d1c1a195314756471d97758c48498bb4dcdf5"}, + {file = "charset_normalizer-3.4.9.tar.gz", hash = "sha256:673611bbd43f0810bec0b0f028ddeaaa501190339cac411f347ac76917c3ae7b"}, +] + +[[package]] +name = "click" +version = "8.5.0" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360"}, + {file = "click-8.5.0.tar.gz", hash = "sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version == \"3.10\"" +files = [ + {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, + {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "fs" +version = "2.4.16" +description = "Python's filesystem abstraction layer" +optional = false +python-versions = "*" +groups = ["main"] +files = [ + {file = "fs-2.4.16-py2.py3-none-any.whl", hash = "sha256:660064febbccda264ae0b6bace80a8d1be9e089e0a5eb2427b7d517f9a91545c"}, + {file = "fs-2.4.16.tar.gz", hash = "sha256:ae97c7d51213f4b70b6a958292530289090de3a7e15841e108fbe144f069d313"}, +] + +[package.dependencies] +appdirs = ">=1.4.3,<1.5.0" +setuptools = "*" +six = ">=1.10,<2.0" + +[package.extras] +scandir = ["scandir (>=1.5,<2.0) ; python_version < \"3.5\""] + +[[package]] +name = "idna" +version = "3.18" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.9" +groups = ["main", "dev"] +files = [ + {file = "idna-3.18-py3-none-any.whl", hash = "sha256:7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2"}, + {file = "idna-3.18.tar.gz", hash = "sha256:ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848"}, +] + +[package.extras] +all = ["mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "iniconfig" +version = "2.3.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12"}, + {file = "iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730"}, +] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, + {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, +] + +[[package]] +name = "packaging" +version = "26.2" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e"}, + {file = "packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661"}, +] + +[[package]] +name = "pathspec" +version = "1.1.1" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189"}, + {file = "pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a"}, +] + +[package.extras] +hyperscan = ["hyperscan (>=0.7)"] +optional = ["typing-extensions (>=4)"] +re2 = ["google-re2 (>=1.1)"] + +[[package]] +name = "platformdirs" +version = "4.10.0" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "platformdirs-4.10.0-py3-none-any.whl", hash = "sha256:fb516cdb12eb0d857d0cd85a7c57cea4d060bee4578d6cf5a14dfdf8cbf8784a"}, + {file = "platformdirs-4.10.0.tar.gz", hash = "sha256:31e761a6a0ca04faf7353ea759bdba55652be214725111e5aac52dfa29d4bef7"}, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"}, + {file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["coverage", "pytest", "pytest-benchmark"] + +[[package]] +name = "pygments" +version = "2.20.0" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176"}, + {file = "pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f"}, +] + +[package.extras] +windows-terminal = ["colorama (>=0.4.6)"] + +[[package]] +name = "pytest" +version = "8.4.2" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79"}, + {file = "pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01"}, +] + +[package.dependencies] +colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1", markers = "python_version < \"3.11\""} +iniconfig = ">=1" +packaging = ">=20" +pluggy = ">=1.5,<2" +pygments = ">=2.7.2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} + +[package.extras] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "python-dotenv" +version = "1.2.2" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a"}, + {file = "python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + +[[package]] +name = "pytokens" +version = "0.4.1" +description = "A Fast, spec compliant Python 3.14+ tokenizer that runs on older Pythons." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pytokens-0.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2a44ed93ea23415c54f3face3b65ef2b844d96aeb3455b8a69b3df6beab6acc5"}, + {file = "pytokens-0.4.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:add8bf86b71a5d9fb5b89f023a80b791e04fba57960aa790cc6125f7f1d39dfe"}, + {file = "pytokens-0.4.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:670d286910b531c7b7e3c0b453fd8156f250adb140146d234a82219459b9640c"}, + {file = "pytokens-0.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:4e691d7f5186bd2842c14813f79f8884bb03f5995f0575272009982c5ac6c0f7"}, + {file = "pytokens-0.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:27b83ad28825978742beef057bfe406ad6ed524b2d28c252c5de7b4a6dd48fa2"}, + {file = "pytokens-0.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d70e77c55ae8380c91c0c18dea05951482e263982911fc7410b1ffd1dadd3440"}, + {file = "pytokens-0.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4a58d057208cb9075c144950d789511220b07636dd2e4708d5645d24de666bdc"}, + {file = "pytokens-0.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b49750419d300e2b5a3813cf229d4e5a4c728dae470bcc89867a9ad6f25a722d"}, + {file = "pytokens-0.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d9907d61f15bf7261d7e775bd5d7ee4d2930e04424bab1972591918497623a16"}, + {file = "pytokens-0.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:ee44d0f85b803321710f9239f335aafe16553b39106384cef8e6de40cb4ef2f6"}, + {file = "pytokens-0.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:140709331e846b728475786df8aeb27d24f48cbcf7bcd449f8de75cae7a45083"}, + {file = "pytokens-0.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6d6c4268598f762bc8e91f5dbf2ab2f61f7b95bdc07953b602db879b3c8c18e1"}, + {file = "pytokens-0.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:24afde1f53d95348b5a0eb19488661147285ca4dd7ed752bbc3e1c6242a304d1"}, + {file = "pytokens-0.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5ad948d085ed6c16413eb5fec6b3e02fa00dc29a2534f088d3302c47eb59adf9"}, + {file = "pytokens-0.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:3f901fe783e06e48e8cbdc82d631fca8f118333798193e026a50ce1b3757ea68"}, + {file = "pytokens-0.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8bdb9d0ce90cbf99c525e75a2fa415144fd570a1ba987380190e8b786bc6ef9b"}, + {file = "pytokens-0.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5502408cab1cb18e128570f8d598981c68a50d0cbd7c61312a90507cd3a1276f"}, + {file = "pytokens-0.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:29d1d8fb1030af4d231789959f21821ab6325e463f0503a61d204343c9b355d1"}, + {file = "pytokens-0.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:970b08dd6b86058b6dc07efe9e98414f5102974716232d10f32ff39701e841c4"}, + {file = "pytokens-0.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:9bd7d7f544d362576be74f9d5901a22f317efc20046efe2034dced238cbbfe78"}, + {file = "pytokens-0.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4a14d5f5fc78ce85e426aa159489e2d5961acf0e47575e08f35584009178e321"}, + {file = "pytokens-0.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97f50fd18543be72da51dd505e2ed20d2228c74e0464e4262e4899797803d7fa"}, + {file = "pytokens-0.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dc74c035f9bfca0255c1af77ddd2d6ae8419012805453e4b0e7513e17904545d"}, + {file = "pytokens-0.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f66a6bbe741bd431f6d741e617e0f39ec7257ca1f89089593479347cc4d13324"}, + {file = "pytokens-0.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:b35d7e5ad269804f6697727702da3c517bb8a5228afa450ab0fa787732055fc9"}, + {file = "pytokens-0.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:8fcb9ba3709ff77e77f1c7022ff11d13553f3c30299a9fe246a166903e9091eb"}, + {file = "pytokens-0.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:79fc6b8699564e1f9b521582c35435f1bd32dd06822322ec44afdeba666d8cb3"}, + {file = "pytokens-0.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d31b97b3de0f61571a124a00ffe9a81fb9939146c122c11060725bd5aea79975"}, + {file = "pytokens-0.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:967cf6e3fd4adf7de8fc73cd3043754ae79c36475c1c11d514fc72cf5490094a"}, + {file = "pytokens-0.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:584c80c24b078eec1e227079d56dc22ff755e0ba8654d8383b2c549107528918"}, + {file = "pytokens-0.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:da5baeaf7116dced9c6bb76dc31ba04a2dc3695f3d9f74741d7910122b456edc"}, + {file = "pytokens-0.4.1-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:11edda0942da80ff58c4408407616a310adecae1ddd22eef8c692fe266fa5009"}, + {file = "pytokens-0.4.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0fc71786e629cef478cbf29d7ea1923299181d0699dbe7c3c0f4a583811d9fc1"}, + {file = "pytokens-0.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:dcafc12c30dbaf1e2af0490978352e0c4041a7cde31f4f81435c2a5e8b9cabb6"}, + {file = "pytokens-0.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:42f144f3aafa5d92bad964d471a581651e28b24434d184871bd02e3a0d956037"}, + {file = "pytokens-0.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:34bcc734bd2f2d5fe3b34e7b3c0116bfb2397f2d9666139988e7a3eb5f7400e3"}, + {file = "pytokens-0.4.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:941d4343bf27b605e9213b26bfa1c4bf197c9c599a9627eb7305b0defcfe40c1"}, + {file = "pytokens-0.4.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3ad72b851e781478366288743198101e5eb34a414f1d5627cdd585ca3b25f1db"}, + {file = "pytokens-0.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:682fa37ff4d8e95f7df6fe6fe6a431e8ed8e788023c6bcc0f0880a12eab80ad1"}, + {file = "pytokens-0.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:30f51edd9bb7f85c748979384165601d028b84f7bd13fe14d3e065304093916a"}, + {file = "pytokens-0.4.1-py3-none-any.whl", hash = "sha256:26cef14744a8385f35d0e095dc8b3a7583f6c953c2e3d269c7f82484bf5ad2de"}, + {file = "pytokens-0.4.1.tar.gz", hash = "sha256:292052fe80923aae2260c073f822ceba21f3872ced9a68bb7953b348e561179a"}, +] + +[package.extras] +dev = ["black", "build", "mypy", "pytest", "pytest-cov", "setuptools", "tox", "twine", "wheel"] + +[[package]] +name = "pyyaml" +version = "6.0.3" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "PyYAML-6.0.3-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:c2514fceb77bc5e7a2f7adfaa1feb2fb311607c9cb518dbc378688ec73d8292f"}, + {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9c57bb8c96f6d1808c030b1687b9b5fb476abaa47f0db9c0101f5e9f394e97f4"}, + {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:efd7b85f94a6f21e4932043973a7ba2613b059c4a000551892ac9f1d11f5baf3"}, + {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22ba7cfcad58ef3ecddc7ed1db3409af68d023b7f940da23c6c2a1890976eda6"}, + {file = "PyYAML-6.0.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6344df0d5755a2c9a276d4473ae6b90647e216ab4757f8426893b5dd2ac3f369"}, + {file = "PyYAML-6.0.3-cp38-cp38-win32.whl", hash = "sha256:3ff07ec89bae51176c0549bc4c63aa6202991da2d9a6129d7aef7f1407d3f295"}, + {file = "PyYAML-6.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:5cf4e27da7e3fbed4d6c3d8e797387aaad68102272f8f9752883bc32d61cb87b"}, + {file = "pyyaml-6.0.3-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b"}, + {file = "pyyaml-6.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:02ea2dfa234451bbb8772601d7b8e426c2bfa197136796224e50e35a78777956"}, + {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b30236e45cf30d2b8e7b3e85881719e98507abed1011bf463a8fa23e9c3e98a8"}, + {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:66291b10affd76d76f54fad28e22e51719ef9ba22b29e1d7d03d6777a9174198"}, + {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b"}, + {file = "pyyaml-6.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:418cf3f2111bc80e0933b2cd8cd04f286338bb88bdc7bc8e6dd775ebde60b5e0"}, + {file = "pyyaml-6.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5e0b74767e5f8c593e8c9b5912019159ed0533c70051e9cce3e8b6aa699fcd69"}, + {file = "pyyaml-6.0.3-cp310-cp310-win32.whl", hash = "sha256:28c8d926f98f432f88adc23edf2e6d4921ac26fb084b028c733d01868d19007e"}, + {file = "pyyaml-6.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:bdb2c67c6c1390b63c6ff89f210c8fd09d9a1217a465701eac7316313c915e4c"}, + {file = "pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e"}, + {file = "pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824"}, + {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c"}, + {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00"}, + {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d"}, + {file = "pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a"}, + {file = "pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4"}, + {file = "pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b"}, + {file = "pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf"}, + {file = "pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196"}, + {file = "pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0"}, + {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28"}, + {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c"}, + {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc"}, + {file = "pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e"}, + {file = "pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea"}, + {file = "pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5"}, + {file = "pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b"}, + {file = "pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd"}, + {file = "pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8"}, + {file = "pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1"}, + {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c"}, + {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5"}, + {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6"}, + {file = "pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6"}, + {file = "pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be"}, + {file = "pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26"}, + {file = "pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c"}, + {file = "pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb"}, + {file = "pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac"}, + {file = "pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310"}, + {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7"}, + {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788"}, + {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5"}, + {file = "pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764"}, + {file = "pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35"}, + {file = "pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac"}, + {file = "pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3"}, + {file = "pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3"}, + {file = "pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba"}, + {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c"}, + {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702"}, + {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c"}, + {file = "pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065"}, + {file = "pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65"}, + {file = "pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9"}, + {file = "pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b"}, + {file = "pyyaml-6.0.3-cp39-cp39-macosx_10_13_x86_64.whl", hash = "sha256:b865addae83924361678b652338317d1bd7e79b1f4596f96b96c77a5a34b34da"}, + {file = "pyyaml-6.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c3355370a2c156cffb25e876646f149d5d68f5e0a3ce86a5084dd0b64a994917"}, + {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3c5677e12444c15717b902a5798264fa7909e41153cdf9ef7ad571b704a63dd9"}, + {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5ed875a24292240029e4483f9d4a4b8a1ae08843b9c54f43fcc11e404532a8a5"}, + {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0150219816b6a1fa26fb4699fb7daa9caf09eb1999f3b70fb6e786805e80375a"}, + {file = "pyyaml-6.0.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:fa160448684b4e94d80416c0fa4aac48967a969efe22931448d853ada8baf926"}, + {file = "pyyaml-6.0.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:27c0abcb4a5dac13684a37f76e701e054692a9b2d3064b70f5e4eb54810553d7"}, + {file = "pyyaml-6.0.3-cp39-cp39-win32.whl", hash = "sha256:1ebe39cb5fc479422b83de611d14e2c0d3bb2a18bbcb01f229ab3cfbd8fee7a0"}, + {file = "pyyaml-6.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:2e71d11abed7344e42a8849600193d15b6def118602c4c176f748e4583246007"}, + {file = "pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f"}, +] + +[[package]] +name = "requests" +version = "2.34.2" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.10" +groups = ["main", "dev"] +files = [ + {file = "requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0"}, + {file = "requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed"}, +] + +[package.dependencies] +certifi = ">=2023.5.7" +charset_normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.26,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<8)"] + +[[package]] +name = "responses" +version = "0.26.2" +description = "A utility library for mocking out the `requests` Python library." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "responses-0.26.2-py3-none-any.whl", hash = "sha256:6fdfeabd58e5ec473b98dfe02e6d46d3173bd8dd573eff2ccccf1a05a5135364"}, + {file = "responses-0.26.2.tar.gz", hash = "sha256:9c9259b46a8349197edebf43cfa68a87e1a2802ef503ff8b2fecbabc0b45afd8"}, +] + +[package.dependencies] +pyyaml = "*" +requests = ">=2.30.0,<3.0" +urllib3 = ">=1.25.10,<3.0" + +[package.extras] +tests = ["coverage (>=6.0.0)", "flake8", "mypy", "pytest (>=7.0.0)", "pytest-asyncio", "pytest-cov", "pytest-httpserver", "tomli ; python_version < \"3.11\"", "tomli-w", "types-PyYAML", "types-requests"] + +[[package]] +name = "setuptools" +version = "81.0.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "setuptools-81.0.0-py3-none-any.whl", hash = "sha256:fdd925d5c5d9f62e4b74b30d6dd7828ce236fd6ed998a08d81de62ce5a6310d6"}, + {file = "setuptools-81.0.0.tar.gz", hash = "sha256:487b53915f52501f0a79ccfd0c02c165ffe06631443a886740b91af4b7a5845a"}, +] + +[package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\"", "ruff (>=0.13.0) ; sys_platform != \"cygwin\""] +core = ["importlib_metadata (>=6) ; python_version < \"3.10\"", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1) ; python_version < \"3.11\"", "wheel (>=0.43.0)"] +cover = ["pytest-cov"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21) ; python_version >= \"3.9\" and sys_platform != \"cygwin\"", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf ; sys_platform != \"cygwin\"", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib_metadata (>=7.0.2) ; python_version < \"3.10\"", "jaraco.develop (>=7.21) ; sys_platform != \"cygwin\"", "mypy (==1.18.*)", "pytest-mypy"] + +[[package]] +name = "six" +version = "1.17.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] +files = [ + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, +] + +[[package]] +name = "soupsieve" +version = "2.8.4" +description = "A modern CSS selector implementation for Beautiful Soup." +optional = false +python-versions = ">=3.9" +groups = ["main"] +files = [ + {file = "soupsieve-2.8.4-py3-none-any.whl", hash = "sha256:e7e6b0769c8f51ed59acab6e994b00621096cfb1c640a7509295987388fbaf65"}, + {file = "soupsieve-2.8.4.tar.gz", hash = "sha256:e121fd02e975c695e4e9e8774a5ee35d74714b59307868dcc5319ad2d9e3328e"}, +] + +[[package]] +name = "tomli" +version = "1.2.3" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.6" +groups = ["dev"] +markers = "python_version == \"3.10\"" +files = [ + {file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"}, + {file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"}, +] + +[[package]] +name = "typing-extensions" +version = "4.16.0" +description = "Backported and Experimental Type Hints for Python 3.9+" +optional = false +python-versions = ">=3.9" +groups = ["main", "dev"] +files = [ + {file = "typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8"}, + {file = "typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5"}, +] +markers = {dev = "python_version == \"3.10\""} + +[[package]] +name = "urllib3" +version = "2.7.0" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.10" +groups = ["main", "dev"] +files = [ + {file = "urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897"}, + {file = "urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c"}, +] + +[package.extras] +brotli = ["brotli (>=1.2.0) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=1.2.0.0) ; platform_python_implementation != \"CPython\""] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["backports-zstd (>=1.0.0) ; python_version < \"3.14\""] + +[metadata] +lock-version = "2.1" +python-versions = ">=3.10" +content-hash = "e3669968d1cae9349b34bd3aeb8bec35985c5d67b33187a54c5a91648cc1d439" diff --git a/pyproject.toml b/pyproject.toml index c790eff..75dbf62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,17 @@ -[tool.poetry] +[project] name = "rspace-client" version = "2.7.4" description = "A client for calling RSpace ELN and Inventory APIs" license = "Apache-2.0" -authors = ["Research Innovations Ltd "] +authors = [ + { name = "Research Innovations Ltd", email = "support@researchspace.com" }, +] maintainers = [ - "Matthias Kowalski ", - "Robert Lamacraft " + { name = "Matthias Kowalski", email = "matthias@researchspace.com" }, + { name = "Robert Lamacraft", email = "robert.lamacraft@researchspace.com" }, ] readme = "README.md" -repository = "https://github.com/rspace-os/rspace-client-python" -documentation = "https://github.com/rspace-os/rspace-client-python" +requires-python = ">=3.10" keywords = ["RSpace", "ResearchSpace", "ELN", "Inventory"] classifiers = [ "Development Status :: 4 - Beta", @@ -18,29 +19,37 @@ classifiers = [ "Intended Audience :: Science/Research", "Topic :: Software Development :: Libraries", ] -exclude = ["examples/*", "rspace_client/tests/*"] - -[tool.poetry.dependencies] -python = "^3.9" -requests = "^2.25.1" -beautifulsoup4 = "^4.9.3" -fs = "^2.4.16" # deprecated PyFilesystem2 classes only (rspace_client.eln.fs, rspace_client.inv.attachment_fs); removed in 3.0 -setuptools = "<82" # fs 2.4.16 imports pkg_resources; goes with fs -fsspec = ">=2024.3.0" # rspace_client.fs +dependencies = [ + "requests>=2.25.1,<3", + "beautifulsoup4>=4.9.3,<5", + "fs>=2.4.16,<3", # deprecated PyFilesystem2 classes only (rspace_client.eln.fs, rspace_client.inv.attachment_fs); removed in 3.0 + "setuptools<82", # fs 2.4.16 imports pkg_resources; goes with fs + "fsspec>=2024.3.0", # rspace_client.fs +] # lets fsspec.filesystem("rspace") and rspace:// URLs work before rspace_client.fs is imported -[tool.poetry.plugins."fsspec.specs"] +[project.entry-points."fsspec.specs"] rspace = "rspace_client.fs:RSpaceFilesystem" -[tool.poetry.group.dev.dependencies] -python-dotenv = "^1.1.1" -black = "^21.6b0" -pytest = "^8.0.0" -responses = "^0.26.2" -universal-pathlib = ">=0.2" +[project.urls] +Repository = "https://github.com/rspace-os/rspace-client-python" +Documentation = "https://github.com/rspace-os/rspace-client-python" + +[tool.poetry] +packages = [{ include = "rspace_client" }] +exclude = ["examples/*", "rspace_client/tests/*"] + +[dependency-groups] +dev = [ + "python-dotenv>=1.1.1,<2", + "pytest>=8.0.0,<9", + "black>=21.6b0", + "responses>=0.26.2,<0.27", + "universal-pathlib>=0.2", +] [build-system] -requires = ["poetry-core>=1.0.0"] +requires = ["poetry-core>=2.0.0"] build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] From 05c96961fe10ef31ff6ff128bdada00b2d87ca39 Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:08:58 +0100 Subject: [PATCH 02/21] chore: add ruff, mypy and pre-commit config Replace black with ruff (lint + format) and add mypy, pre-commit and pytest-cov as dev dependencies, with their configuration in pyproject.toml. notebook_sync is excluded from ruff and mypy. Co-Authored-By: Claude Opus 5.5 --- .pre-commit-config.yaml | 16 + CHANGELOG.md | 3 + DEVELOPING.md | 18 +- poetry.lock | 717 +++++++++++++++++++++++++++++++++------- pyproject.toml | 39 ++- 5 files changed, 670 insertions(+), 123 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..931b4ac --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.16.3 + hooks: + - id: ruff + args: [--fix] + files: ^(rspace_client|examples)/ + - id: ruff-format + files: ^(rspace_client|examples)/ + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v2.3.1 + hooks: + - id: mypy + additional_dependencies: [types-requests] + pass_filenames: false + args: [rspace_client] diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e2f611..93d592b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,9 @@ All notable changes to this project will be documented in this file Potentially breaking: - Python 3.9 is no longer supported; the minimum is now 3.10. +- Development tooling: added `ruff` (lint + format, replacing `black`), + `mypy`, `pre-commit` and `pytest-cov` configuration. + - Gallery upload routing and section-mismatch handling (PR #56): clearer `GallerySectionMismatch` exception, optional `on_mismatch="reroute"` policy to auto-reroute uploads into the server-chosen section, `upload()` now diff --git a/DEVELOPING.md b/DEVELOPING.md index 5535766..5ab1fef 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -17,7 +17,23 @@ From this directory, run `poetry install` -to install all project dependencies into your virtual environment. +to install all project dependencies, including the dev tools below, into your virtual environment. + +### Linting, formatting and type checking + +We use [ruff](https://docs.astral.sh/ruff/) for linting and formatting, and [mypy](https://mypy-lang.org/) for type checking. + +``` +poetry run ruff check rspace_client examples +poetry run ruff format rspace_client examples +poetry run mypy rspace_client +``` + +A [pre-commit](https://pre-commit.com/) config is provided to run these automatically on each commit: + +``` +poetry run pre-commit install +``` ### Running tests diff --git a/poetry.lock b/poetry.lock index 9f64926..8631c52 100644 --- a/poetry.lock +++ b/poetry.lock @@ -12,6 +12,73 @@ files = [ {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, ] +[[package]] +name = "ast-serialize" +version = "0.8.0" +description = "Python bindings for mypy AST serialization" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "ast_serialize-0.8.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:3d822605fa7bb326ef868d25fafced7fc660fa46d9b90c02ea86d5e2f5d325f7"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:2efa40b068197d5efb62655b43baadb842ed71c4958cccd3e8b86a35726f0119"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:db1b957291bca08c7e72f43a12357b2948e20775d970e3fc3dac0aa3160ab725"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fdc0d5b18ff8fb364e87923e47c0a91d0d69dbcaeaa274591f7fd26892cc3a3a"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9da7330f3e235bf7da89b8d39205c6350fc0c08a85379743f2df9fff87d6d980"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f3186969ee66a9863b00acc6523ace44c56974eecb348a7ea4b228d9f0b80e19"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40a57b73731be45da4fa41430c4d5dc94a24b3a4faba7b9e069978c0402064ea"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5075b9da3ef807eda752502446dfecea3b381c4900b7e27a5d5f4f899eb39951"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:293cc1c5bfa741f8e3fbe8175b9c07beee487c9a6fdbb25a5acad9f1df2d30a9"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e0910c3442a75216dde0f102d854ba2aaa71d2482e0ee213630b9bf29584fba3"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:43dd6d596879bb1cb8a12cc9dae7bb10090a39a35883026c24f82488a195619a"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:8c9d537f59e936392cfd3597789d1390304dd659efc3c486ce7f40fb6b8a9f53"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:f0190a33d7f97c65e9069f7a7f40499eea6b5cbe260c558378109caf20ce934b"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:77308ae6c5cf5264cc0f01a7c556ec77a9e68eb1f61b093534d698139fdc3b14"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:8d53a23f27e1ed3a36b2d26fd2a1a6228c8e85a1ed62ff7cdb44bd610769f20a"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ffa5e7cb08f96fed9121f77b224151e41caf88feab9d652bb46c78202b6fbeda"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-win32.whl", hash = "sha256:fa70ed4dea0bb18b30a1789c77baa701d0ef30c474f2ccabdea61e25623a8827"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:d8b3c8eee4c1baef9d4e84d2a59a805501617127be42615cb48970b15b0892b6"}, + {file = "ast_serialize-0.8.0-cp314-cp314t-win_arm64.whl", hash = "sha256:ac4f0a83c55a9b782f79ad55a5247b7db123c1db405959791c2ef886e9710c9f"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-macosx_10_12_x86_64.whl", hash = "sha256:86b8a1e6d90467345356098b040150e82fbc26d24a7a202224b13dc1f6264ca0"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:39e92ff8e8cb45947fe9007174b2950e1fb098e6abd00266a13cd3bcf6675068"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c85d8d18db5b2dfcb3b7e38a4d600ca35504c0ed8a6f75cd1c811e4ffe248a15"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9830ff7e764f74d9eefb01170c61a9f0fd2c027dac5fcb72e064decd57d56371"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6479d9722a4cd21b578f5478074c41e6169f04811996ec881655560f703a5bba"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a63bed264e818cd83eec11feed0f50aa162542b91132ef58afebc857182763a5"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d187197d234aa45d6cfa2b096be5f666e8cc2e7eb3722d0ab8926293cf5720c"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-manylinux_2_31_riscv64.whl", hash = "sha256:2d39a56282cfcc0d8eeea37267c754be59c98d48505c23b1dae5c6011f3813dd"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f7cc5f10386994c0f4844f1e6d6a97127e9b478660eb6dec2b257644f0acab64"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:6102f2f985c2e542be85cd857678ec9356fefa792b93cadfadd31139f5696f27"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-musllinux_1_2_armv7l.whl", hash = "sha256:3a8660fe66667b76a6e9dccd1d33e66b229fde3b308db991c041609226c005b6"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-musllinux_1_2_i686.whl", hash = "sha256:e7266307e5fba39836edb79def8608887af48820508bff3c5f2941e1e04d1534"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-musllinux_1_2_ppc64le.whl", hash = "sha256:4ca7e6fd1ad845d1cc649dc2ecd499db2f8f46af5bf8da7b70dd858774cc038b"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-musllinux_1_2_riscv64.whl", hash = "sha256:2880350b13d3eae69a0d70bc1fb6c9bfaca4dbd0e20ba8cd1aa483080b56ff06"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:ab0f9a59f7d63d0d441b56b9a818b273705264352d5115cfee12e940e816d958"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-win32.whl", hash = "sha256:0485a25ef519c62e749ee3c1ad8070e591b380d67226349eb5a70b228dc1ac4a"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:bd84d60bca7079e741be4ac5dbe237751a59d7f6f9f0126b11880d63822cbe16"}, + {file = "ast_serialize-0.8.0-cp315-abi3.abi3t-win_arm64.whl", hash = "sha256:057769b5921336eb2d9124f2a731b42ed05ffdac559b840dbdf6f3937cf153dc"}, + {file = "ast_serialize-0.8.0-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:a02cbed7d8bfdcdee88edaac12bd50d53d9953aaa2e1852ef078625be5f1c0b5"}, + {file = "ast_serialize-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:e1bd223df0f6c96b396975fa604cb33bce53d9b4a0185490be4c4a289f7c9c87"}, + {file = "ast_serialize-0.8.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:ddd3b61f45c132da66c5476b281891e08c1fd87fbdabe8a6973e1622efc85f06"}, + {file = "ast_serialize-0.8.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f9caa63fad8241257ae401b5ff0a64026c6adb36b8e86cbe8782d9ea505daf6"}, + {file = "ast_serialize-0.8.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3926fa117b5e65019853a2969966d11c7175af377a3425991f3fe73784412405"}, + {file = "ast_serialize-0.8.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:485f1113af805e9e170b95ef993ca3fbd4f89c04bab25c58b4fc632d854801ab"}, + {file = "ast_serialize-0.8.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ccebbed24f1281062d5852353c72c47502955926cfcb8345ffb3a44d87ff3d3"}, + {file = "ast_serialize-0.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:252f883290d1cdb728eb7fe1d9a7221b88af5a329aae0bc91ddee4dafb820331"}, + {file = "ast_serialize-0.8.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:96abc072ad29db8d02194afd47d68987322622787daceae82398d7b69f3ba2e6"}, + {file = "ast_serialize-0.8.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9118ad3e369727060b2696fc4078f250ecffca4248ba87f537f55cea9f9dce06"}, + {file = "ast_serialize-0.8.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:f359df4bd921918af8bebd142a376c77511d7151cc8ba852760b587b5a4a54f3"}, + {file = "ast_serialize-0.8.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:e94f9121d13fa36cbf21314783c77d05ae3a0868decd18cf5233fdcc6de49ac8"}, + {file = "ast_serialize-0.8.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:54f95b486018d262bcb387a9afd96f0da74508b442762b80c769454a6fbb3ee3"}, + {file = "ast_serialize-0.8.0-cp39-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:4c38b915511e32bc718c49dbce98ff9af36bac0ad6a604f58000cd5e3aecdba7"}, + {file = "ast_serialize-0.8.0-cp39-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:9a2ef9cf12f2de4f1028c42c1dd7d775255e0fb3e5bb48896c97e35ef52366fe"}, + {file = "ast_serialize-0.8.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6f18048fe9f6dd266bd577cdec48bdcecb74faaa01fe941324435483b013ed2a"}, + {file = "ast_serialize-0.8.0-cp39-abi3-win32.whl", hash = "sha256:31883542dd6c94d178f5db3d32fbd69c5eb88b3a7c018e7ac8cc0c45195ddbed"}, + {file = "ast_serialize-0.8.0-cp39-abi3-win_amd64.whl", hash = "sha256:861794565b06337005c1447ef23103a3d5a627d08bdc827870d00d0b28ef5f51"}, + {file = "ast_serialize-0.8.0-cp39-abi3-win_arm64.whl", hash = "sha256:b2a5978662fd4db463dfb4b974d2b10ac6430b98f5333aabc7051909df3561d0"}, + {file = "ast_serialize-0.8.0.tar.gz", hash = "sha256:6c37c43e4004dfb42d321ddedc569dc17ff4259296f3af577c9ea46a809bc010"}, +] + [[package]] name = "beautifulsoup4" version = "4.15.0" @@ -35,59 +102,6 @@ charset-normalizer = ["charset-normalizer"] html5lib = ["html5lib"] lxml = ["lxml"] -[[package]] -name = "black" -version = "26.5.1" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.10" -groups = ["dev"] -files = [ - {file = "black-26.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9942db8888e06943c5dde66ca0037dcff82a2a4ec1ad0ada9e0d2ee9d9823893"}, - {file = "black-26.5.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:89c93167a74d3a75dfaa38a5c7cca015537d5820dd7f17d63267d674a61cae90"}, - {file = "black-26.5.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22f2cd76d069cc54c71f10360744ba8983fbb616903b4304a85b734915c8e1b4"}, - {file = "black-26.5.1-cp310-cp310-win_amd64.whl", hash = "sha256:87ed5c6f450580a2f6790bc7cbfb016dfc73bc750249762268a3695361315eef"}, - {file = "black-26.5.1-cp310-cp310-win_arm64.whl", hash = "sha256:58b4bd92cf88aacf83d88479c8f9caee044b1ec55f2451a337354a7ea2590a22"}, - {file = "black-26.5.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:96ae2c733b2aabdd9986e2c5df628ff3473676cd1c5faded1ff496cf6d74083c"}, - {file = "black-26.5.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0e48b87e03bf109288e55cfceadcfa15ff5470aca2851a851950ed2926f450d7"}, - {file = "black-26.5.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5119fa92ae61f786e8c3662fd60aece1d0a2dd5cca5d0c79417a95e7a4272a59"}, - {file = "black-26.5.1-cp311-cp311-win_amd64.whl", hash = "sha256:30d3c14661f2792e9142cce3eeeb1cbc175b3eb5f733be0c8eeb99651e52b0c3"}, - {file = "black-26.5.1-cp311-cp311-win_arm64.whl", hash = "sha256:1ef92b76f7733f282fd096ea406200b5a286c42947412b0eaff3a74e3616cefe"}, - {file = "black-26.5.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4ad6fa01f941920f54f2bbb35f3df7673428a0ef98a0b0840c2eaef3b110efa8"}, - {file = "black-26.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3915f256e75a2d7cf88d8953d37f780455dc586cc72dee059c528fe77f581217"}, - {file = "black-26.5.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d98d4137277c75dfb898ec8d846c4fd68ba1e9cf77f95e2865c203dc18f4c3d"}, - {file = "black-26.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:a1dca32d9f1784af512a13410ec204c6f7f0aa9797a111c42e1c03449821c264"}, - {file = "black-26.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:1037d5ac7b7b310b2632ad867ec8d0e4c4819dcdb0b820f63135da746a24e418"}, - {file = "black-26.5.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:2b36cf2ddf5566e205f6535f782a62194a184d33e175b64ae8c40b1737522be3"}, - {file = "black-26.5.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1f7ea64ebfa01b50f693508fc39f875e264446d3b097088f84f203b9d09618a0"}, - {file = "black-26.5.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecb3e624844c798144e9bd986954e0adc81d8911a1f30f375e1252fe26e8c294"}, - {file = "black-26.5.1-cp313-cp313-win_amd64.whl", hash = "sha256:e1a26503279b6b310669fb0b219c39e4820b77e8189fe80f522bb511f247db0a"}, - {file = "black-26.5.1-cp313-cp313-win_arm64.whl", hash = "sha256:5c34b25da232ead53a6f335b76dbea124f4d152ad568b9080d6f944bc2b34b52"}, - {file = "black-26.5.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:e88976690a64b0af98312ca958415849cb42423423c5f2ee74af4b49a97a2168"}, - {file = "black-26.5.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:32d5ea7f6c8bdfa6e648326ebca1f02b0764e2a029edc6f8dce2627e19d468c3"}, - {file = "black-26.5.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ea8d16dc41655aa113cd64665e7219446cd7e4ff2248d7178eaa905190c86b18"}, - {file = "black-26.5.1-cp314-cp314-win_amd64.whl", hash = "sha256:577f21094ea469ef92ec1adaf2c9441a226d2144d01a5be2fa823cecf6543e50"}, - {file = "black-26.5.1-cp314-cp314-win_arm64.whl", hash = "sha256:ed1a20af114c301a0269bf01163d51dbef72737fd65f850001e7cbe7f3c7abae"}, - {file = "black-26.5.1-py3-none-any.whl", hash = "sha256:4ed7f7da04046d2e488437170797d3b4a4ad83906683bcb7dfc68b673bbce5e2"}, - {file = "black-26.5.1.tar.gz", hash = "sha256:dd321f668053961824bcc1be1cc1df748b2d7e4fa28086b08331e577b0100a73"}, -] - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=1.0.0" -platformdirs = ">=2" -pytokens = ">=0.4.0,<0.5.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.10)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2) ; sys_platform != \"win32\"", "winloop (>=0.5.0) ; sys_platform == \"win32\""] - [[package]] name = "certifi" version = "2026.6.17" @@ -100,6 +114,18 @@ files = [ {file = "certifi-2026.6.17.tar.gz", hash = "sha256:024c88eeec92ca068db80f02b8b07c9cef7b9fe261d1d535abfd5abd6f6af432"}, ] +[[package]] +name = "cfgv" +version = "3.5.0" +description = "Validate configuration and produce human readable error messages." +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0"}, + {file = "cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132"}, +] + [[package]] name = "charset-normalizer" version = "3.4.9" @@ -203,18 +229,6 @@ files = [ {file = "charset_normalizer-3.4.9.tar.gz", hash = "sha256:673611bbd43f0810bec0b0f028ddeaaa501190339cac411f347ac76917c3ae7b"}, ] -[[package]] -name = "click" -version = "8.5.0" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.10" -groups = ["dev"] -files = [ - {file = "click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360"}, - {file = "click-8.5.0.tar.gz", hash = "sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34"}, -] - [[package]] name = "colorama" version = "0.4.6" @@ -228,6 +242,155 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "coverage" +version = "7.15.4" +description = "Code coverage measurement for Python" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "coverage-7.15.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d0be6daac4cce6b8c8dc65886bae1b082ddbca4da8e5cbb5e15166acf253e264"}, + {file = "coverage-7.15.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b24e078eabcd6a9caa8b0713f9bc1eeb310bcc960a29d45a3b4fcd4b16d5b11d"}, + {file = "coverage-7.15.4-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cfe20cc8cf8821d4fe54f89106cbf06aa27f37b5bbe3535568065a81539b4150"}, + {file = "coverage-7.15.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:83cf06cdd687677742caff1a9134833b7a8b75f111519d2cb0e0ba1b9a851e15"}, + {file = "coverage-7.15.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8fa4de68e2a752468ff14b4e15db7def689a71be759e826a31ccecbef69c5fd0"}, + {file = "coverage-7.15.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4dff9daa47d83120c3ec38ce921214242944a832aa04e903e50b5b7ebac8972d"}, + {file = "coverage-7.15.4-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a093fd37229918976f602aa07aa59e0973cde82186f220c8e197f721f5be0ce4"}, + {file = "coverage-7.15.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:317db01a2cb02552fd67e2b1cca77a4b528a2a277176c5e0bf2cecbb639d3f54"}, + {file = "coverage-7.15.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:8ee3838dcb656602c3b51e16aed9bfb0822f8d8d6d1c5966d32ec8c104be8e20"}, + {file = "coverage-7.15.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:425920379052ff1fe465268f3361d35804a241bbdd5a1b592c8cb60df4c52325"}, + {file = "coverage-7.15.4-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:69bb2400abef928e365ea7d4d9925169ada78ed2295546780002d4b65de3df88"}, + {file = "coverage-7.15.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:81661f82d302484e3119e7c80c519c02fa9bcc2a6b339baf67d67bc89c580f04"}, + {file = "coverage-7.15.4-cp310-cp310-win32.whl", hash = "sha256:cb476b2e828ecb71cb6b6a928d23fd20a7ddb501188022dae1c37499149cc338"}, + {file = "coverage-7.15.4-cp310-cp310-win_amd64.whl", hash = "sha256:3fc2130bf37df31852a8384f12601563a45a0024bccc6624f38355cba7a8d360"}, + {file = "coverage-7.15.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bbac5abad70df71019988f83f26ac7092ff2642975def4429e98dc7585ef3490"}, + {file = "coverage-7.15.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:357a173465c7ce028d07a95cc2b63b5bf59f50ecdd5ad75c5cbb78ada984048e"}, + {file = "coverage-7.15.4-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:21b803935e2efc3acebe9697197a294fccf5dc4e5382bd6369542ff7a7d2a1d7"}, + {file = "coverage-7.15.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7a2b580774a4786c1053157c0165e04476e03ff293993d7c148eee784a94bae6"}, + {file = "coverage-7.15.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a9464451c4efffe8d47ace5a540b10b0dc10e879066290f8600872b7f54a419d"}, + {file = "coverage-7.15.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:de602f34123c2f4af1c1869c6dbbbd60da6d5983bf01937367295d135cccbfce"}, + {file = "coverage-7.15.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6879ded16a27f3eeca19b900c147e81616e7054db451471a611b2755ee5249f7"}, + {file = "coverage-7.15.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:986be58c3ab54aae8d3496a6225eea74f760fdbe739b38bd442c7e8d133aa53b"}, + {file = "coverage-7.15.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:c6103639613fe6c1e989082948419bc77a2d26b6c825c99d7fad25f7d3d87afc"}, + {file = "coverage-7.15.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:d3af93dddb5659276c63bc16ac6466ac2033a70ca816097bbc06345b8ccdf571"}, + {file = "coverage-7.15.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:b10075e5421d04265766a6d1dac809bbeb8a946fbb23c8f82c227409b2190719"}, + {file = "coverage-7.15.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a67a9f78b2942d87ba8ce3059c642164d2aedd65337377fb52fe9803656bc5c7"}, + {file = "coverage-7.15.4-cp311-cp311-win32.whl", hash = "sha256:69484d1aca26e322e1c3ce03f09341e84524ababad2d7202161738d83cc9f82e"}, + {file = "coverage-7.15.4-cp311-cp311-win_amd64.whl", hash = "sha256:63fd6fcd1dd6e158f7eb78606e72933b3f6d01e7b747f99c6c12d764307a0fdc"}, + {file = "coverage-7.15.4-cp311-cp311-win_arm64.whl", hash = "sha256:ea82116c9893fa89e929b7f197ee5a1950a76e91cc5c85ba503fc02379d04890"}, + {file = "coverage-7.15.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d4fedd1f7f428f9fe83b1ead5e7cc87a43427be31aadafbac3ac0636dc7abb22"}, + {file = "coverage-7.15.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:37e2f0cdf58e2e1fed4e4d5a8f8786ae2f7eb80b478016876667dc4a01d60a97"}, + {file = "coverage-7.15.4-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:fb55d0e70bb15f2e81477613627286581414693d74ac7963c93a790dd453ca9d"}, + {file = "coverage-7.15.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:899b9da30f3c6c336566e3707495bb23e8302d39d862f01fa78c48b99b9437e2"}, + {file = "coverage-7.15.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d15715e8c46552827e5e4f30a35575a2dbcad14454cf3284c54483946bd16931"}, + {file = "coverage-7.15.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:002a438859f7b430bc99afeaf01a6d187dad1d0dc907b64cdeffc632a5db8fd8"}, + {file = "coverage-7.15.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e4193a04b518f7968f3099755f5509ee7cccc6dc2b92a6b14841934d22e222c9"}, + {file = "coverage-7.15.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e98dcc55d572b38e69d117da7e8e8efb8500f1f5eaf81ecd460a63220790b839"}, + {file = "coverage-7.15.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:af6c538498ce66c10d3fd541c2a8d5b03da5850355add34e6cba564210cb9e72"}, + {file = "coverage-7.15.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:1d10025d96ea89fc2f73714dbc4cbd433fe012c1ac9e23f895d7728b238b6e52"}, + {file = "coverage-7.15.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d802e1947603162ded419bff83ac7489820355d2b856dfb09206574e3a37ac0c"}, + {file = "coverage-7.15.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c2de40895718f91951b86712b4c5b694acaf9a0a49be13874896f599a1eed3f4"}, + {file = "coverage-7.15.4-cp312-cp312-win32.whl", hash = "sha256:5c3431b2161279b7db5c2a1aa58ae02e5cb8c3c42d93a5094be3f5537bd5b11b"}, + {file = "coverage-7.15.4-cp312-cp312-win_amd64.whl", hash = "sha256:6befeab5fb2b51c958ca4ac6c5d141a1e8240f4f76e46350f1911963deda49cd"}, + {file = "coverage-7.15.4-cp312-cp312-win_arm64.whl", hash = "sha256:67bc345491ab55b837277d76f5775d057e8c7f1ac44d890d8c2c82adde258c6f"}, + {file = "coverage-7.15.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c705b28feb2775dc82a25f1d473a370bc37ff93f5177f4e29ce2425f560f6921"}, + {file = "coverage-7.15.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3ff205ab5e3ecc670f6a4dd19d9cbf12ede53dd41cfc1e15716ec961ea6d314e"}, + {file = "coverage-7.15.4-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5172326e861a38b48b48befca15e0f477a26b283337a33a739c8fed229934e36"}, + {file = "coverage-7.15.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:12b59c90084e3234fb11184886bf4a40f4f16a8c8f867be2e087b81f8e8868d4"}, + {file = "coverage-7.15.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:349062d66f00b40fa2c1c222438bad25fabf755631b5d82937fe985c8008615c"}, + {file = "coverage-7.15.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4256ced708e598e05209bc1a8ab4074e04a51dba4c62fb45926a229af675ace7"}, + {file = "coverage-7.15.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d80f974b20782d9612c8b4c9beeca867074c7cf4079d1419843fa25a26428b25"}, + {file = "coverage-7.15.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2e179f19bfe1d31f8eeeaa12990194d761c4f62f0759661000bca6cd8729f40b"}, + {file = "coverage-7.15.4-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:8bc16bb47b7679670eceff71d78bfb7d6e5b143f6c2cd117487ec7c75e0d4b78"}, + {file = "coverage-7.15.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:1cd685005cd2c4200adfc14cf39a603b9320efab3f18a8f7f156d20c9cc3345f"}, + {file = "coverage-7.15.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:337399ad2c93b3acd2a937627dae8b3e86b66707cd3d3e856347999aadf1ef8d"}, + {file = "coverage-7.15.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:96e257121228ec5cd2bb919276e94ac11074471bc37d68dbae0e8308cce15fff"}, + {file = "coverage-7.15.4-cp313-cp313-win32.whl", hash = "sha256:c65a9e0dfc6143491879da4e13b5e30f8be192055de508d737fb14601edbd22c"}, + {file = "coverage-7.15.4-cp313-cp313-win_amd64.whl", hash = "sha256:2ff8f5e9b8f7a94f0c11c45631eee103dbcb7d63274edd12c56efe1be690b3b4"}, + {file = "coverage-7.15.4-cp313-cp313-win_arm64.whl", hash = "sha256:6e0a8a5083b096487d6cfced94cdd514d8f5db6f113610fb36c0620edb1028cf"}, + {file = "coverage-7.15.4-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:770e9325ab5ea6d56f77e59b29ecfe0ac20b57a82a601876f90494a4dda0386f"}, + {file = "coverage-7.15.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:d12b33a3a50a1676b7784dc8d00a0c6d66a9f2add4b85a041c19b6a7e53ef23c"}, + {file = "coverage-7.15.4-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5669c8378ebde86f5def7a25d29586631b58acc27ffde04399f678f3dfc6e082"}, + {file = "coverage-7.15.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ff97a14362eef486483ed44042ca2027ea257df6ff768e62358ee0c9776925ac"}, + {file = "coverage-7.15.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5a325e815318638aed1655d9c06e6d7c2d3d46c09231ce988070428a8762d734"}, + {file = "coverage-7.15.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:474223409d88eb20d2d6a0d37ea60e8647a65a90cc008dc1f0410af5f64f1e0d"}, + {file = "coverage-7.15.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7f2f62ae3cd189dd2e13aece758c57b3eecbd27be070dbd4cbd10936049e5dbf"}, + {file = "coverage-7.15.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:39ece820e29e0a2ba34b3ecb3be83c27e997eed8926f2ba6fe7ce7a0bda5843b"}, + {file = "coverage-7.15.4-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:f21b56dcace11dfe013014201f577dcd592b2a9b72182d930361b47cf6f73f25"}, + {file = "coverage-7.15.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:93a3a0b662abcc10c73a47cbc72cd60f63618d6989fb2d1286e50eacd974f303"}, + {file = "coverage-7.15.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:141fae2cabf5569b782c10afc4c850ce10f618c13f8db54765cba99cc839da1f"}, + {file = "coverage-7.15.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:81294c7e6ab30c5f74c0353b11b2fd6320e72d9bee6ac73b357caa8b916323a5"}, + {file = "coverage-7.15.4-cp314-cp314-win32.whl", hash = "sha256:7bbd7d6418e0dab31a206af5203bd43ae36edb8e7fba1940b055d3e9249290d7"}, + {file = "coverage-7.15.4-cp314-cp314-win_amd64.whl", hash = "sha256:f0204ed122758782970526057093f448051a39db9d810d4e344bb87a3546f425"}, + {file = "coverage-7.15.4-cp314-cp314-win_arm64.whl", hash = "sha256:9e71e7bc71c686a123347ae47a0de33a175e797a85bb57b791492adf4eec8ed8"}, + {file = "coverage-7.15.4-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7c922735321eef3f87c280a3d39afff6b646723a2880b862cda4ac7a093b8aa8"}, + {file = "coverage-7.15.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f41c17c4668a655ce96d090d8d5ffdc24ef64b5a02f9753884d08483e8a4a41a"}, + {file = "coverage-7.15.4-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:46822e9b6ff1c6a72b518c162c44a8f45a61a1d609c51084bf5b16c023c5037b"}, + {file = "coverage-7.15.4-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3d6f4955b73b5445271379a59e3792b0d978f42d4a01e0cf7a67d9c33a3bb0a5"}, + {file = "coverage-7.15.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3fc9e047706fb4a9abb54f719d3aa643e80e5bb3818182c40aee01ac0f0247ba"}, + {file = "coverage-7.15.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:05e491d4f3165d62d4f5c8fd48dfeabf2ae8f42cbbd484319af33ea851b78982"}, + {file = "coverage-7.15.4-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:226c66e80ec0598d3b9b4874123df167ccca342aca8714f77cac6829688ee09c"}, + {file = "coverage-7.15.4-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ac41cc14bebda0dbfb0628036b7f75706935c95bcc07fefe9a0f93614aa60a57"}, + {file = "coverage-7.15.4-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:8af623e5cd92080acddd02b38f2f406a2c3a0893c38950b211890361448fbf26"}, + {file = "coverage-7.15.4-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:07545711d4f0f32852a18f18ad11f76f0109909d09e78b9008b4cfc67e829429"}, + {file = "coverage-7.15.4-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:a0865421cfdc53654b342d515e5a233187590882d20b95752150e53f65460017"}, + {file = "coverage-7.15.4-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:460115e32ee40566476db5048f9bec1e842c127ad8e6f8be745aad3ac9cbc839"}, + {file = "coverage-7.15.4-cp314-cp314t-win32.whl", hash = "sha256:cbde877ef9dd7baf272b9bfef2b8a25edd45d9170fc326951dd20eb480335e85"}, + {file = "coverage-7.15.4-cp314-cp314t-win_amd64.whl", hash = "sha256:3da9e92d1c551fd7563833e9ade686efb0c4b7363ab7681a94283958c950bf5e"}, + {file = "coverage-7.15.4-cp314-cp314t-win_arm64.whl", hash = "sha256:3a54f5a0d85050c73a38f6793090ee83974531e67fe5e57a1da9bee11398aa5e"}, + {file = "coverage-7.15.4-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:2c9872e4d9dc5d3cf616bf4b382f5a00359305a5be666a3dd0b5cdb4e49597f9"}, + {file = "coverage-7.15.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:e101dbb4b9b72f0cddd8cdc8c9c5b47f456766f5e0ac82dbfb75e5c55409b78a"}, + {file = "coverage-7.15.4-cp315-cp315-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:7d1abebdb047729e852b9c77a00497dfbeb11eb3a117e037d7dbc3ac8e5f5c54"}, + {file = "coverage-7.15.4-cp315-cp315-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d28a4a899354d0ea6214cc59b4fa19eefbce1b9ff1688ab579acf49e894bd3fb"}, + {file = "coverage-7.15.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ffb3c2aacea411cc7e1d27712490c11108e2de1d39019ae32915493a59a8b9ed"}, + {file = "coverage-7.15.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a9447978a92f405d301123cfd39ff49895490efb769a758fe2734c7f631bf8ce"}, + {file = "coverage-7.15.4-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:050467a7983b8e2fe7dd41a78bb30c3e7f8c0b8cafda14b1c46f8b5e3cf2dd3c"}, + {file = "coverage-7.15.4-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:d003b7a5708ddad5c206c79607a6b92abb6fc13c57d99d8a4468cc03a2941ced"}, + {file = "coverage-7.15.4-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:c38efe30fd74e5c19e9433f11fb1f5dc9c6522770971b7c6145bbaa413dc8800"}, + {file = "coverage-7.15.4-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:1f4f826d70f772ab8b0c052329580d7fe8b8abd191e4ce0c8f81aec6614665d3"}, + {file = "coverage-7.15.4-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:4a4bf917c9953f57c957be31c1cd504e3bd2f34d4a352b9d391a3025336f6768"}, + {file = "coverage-7.15.4-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:1c9bf40ebef178a45192c75c4964760bb261b0e6ad725da5fc4c93f674f19753"}, + {file = "coverage-7.15.4-cp315-cp315-win32.whl", hash = "sha256:43619d04c3671792d2c4706ae8bf45e265dc87bbd4078189ef8b847ea1e74be2"}, + {file = "coverage-7.15.4-cp315-cp315-win_amd64.whl", hash = "sha256:be619439dbcd31a2eab10b32de9fff62c26ed4bab69dc32b8363fdaaa0882809"}, + {file = "coverage-7.15.4-cp315-cp315-win_arm64.whl", hash = "sha256:def597967dafc2e8d97c9097ea453c464e0bb8ed38f193a43070f10dc623bb6d"}, + {file = "coverage-7.15.4-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c7dbc748ac8a1e3e59a2b28bea47675e6e778081dbbf081bde0d75def2fcbe1d"}, + {file = "coverage-7.15.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:2413074a5ecbb61a01a7888fc72db0ca324d13588c5b38bc0dd8564cdcdfea26"}, + {file = "coverage-7.15.4-cp315-cp315t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:4e6f6f632b7b2f714bf7a1346e8f97b650ee71f3c298aaad42a2ab60f0f07645"}, + {file = "coverage-7.15.4-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:8df457da2249d3c75ca2e5e835d59c725abfe92d27fdff6cd99eed85b51d5e9a"}, + {file = "coverage-7.15.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:050f66a08805acb5b8a23c6d4a517b1ecf82c08e81ed0e4bd727df065e5c6624"}, + {file = "coverage-7.15.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1587fb771d1ccceef708fdde1e5af8c7ed24b486b61d13a321acb7d8145390aa"}, + {file = "coverage-7.15.4-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8b4f1c3a69ca580f3fbd6b2046915f536d7f586874f25c1bb23add2a3c88d50f"}, + {file = "coverage-7.15.4-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:ffb58d7eff5b7f6ecc6fa21d6288ab7f968a212cb67d682c269c09b9eba3b66f"}, + {file = "coverage-7.15.4-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:d9df165544774574ee004b953023d1bebada1894a80b1052a43d798b0f676e67"}, + {file = "coverage-7.15.4-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:f9de0a24a4079b53e523b5c5e2c5945ec251ab486652659955187cf255a259bc"}, + {file = "coverage-7.15.4-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:150089274bdc9f940628552cb92844e0223c987f1902ab8efe9f45a2ec758d88"}, + {file = "coverage-7.15.4-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:a58a94fed5da6997d258e8f7668c1e195fbd04a691d781b7558f1e468f9e68bc"}, + {file = "coverage-7.15.4-cp315-cp315t-win32.whl", hash = "sha256:ebd5a6d8466ff30836572f3ba2cae8a5e8f85029b1c6d5e2ed338dc472a5166a"}, + {file = "coverage-7.15.4-cp315-cp315t-win_amd64.whl", hash = "sha256:288bde2a2d7ab6b6c2d7252fcde8b524387f2d970bdba9658fc6f8bbcaef0f9b"}, + {file = "coverage-7.15.4-cp315-cp315t-win_arm64.whl", hash = "sha256:68be5e1de60ff13c9095bbec0e5a7fa45b33b101752215b91345ea1f61c4a278"}, + {file = "coverage-7.15.4-py3-none-any.whl", hash = "sha256:964730a1e9de9c0cf11be6a1a3c79ce419c34882842abd256086ba4698705e84"}, + {file = "coverage-7.15.4.tar.gz", hash = "sha256:0548198fff07ccf4faf469520bce1c2eceb1ce3e62891921138dec10907f9d00"}, +] + +[package.dependencies] +tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} + +[package.extras] +toml = ["tomli ; python_full_version <= \"3.11.0a6\""] + +[[package]] +name = "distlib" +version = "0.4.3" +description = "Distribution utilities" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "distlib-0.4.3-py2.py3-none-any.whl", hash = "sha256:4b0ce306c966eb73bc3a7b6abad017c556dadd92c44701562cd528ac7fde4d5b"}, + {file = "distlib-0.4.3.tar.gz", hash = "sha256:f152097224a0ae24be5a0f6bae1b9359af82133bce63f98a95f86cae1aede9ed"}, +] + [[package]] name = "exceptiongroup" version = "1.3.1" @@ -247,6 +410,18 @@ typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "filelock" +version = "3.32.3" +description = "A platform independent file lock." +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "filelock-3.32.3-py3-none-any.whl", hash = "sha256:7f0ca4bcc0e181c60dbbd8aa9ab5b120ebb99e4e064e83636340056f833a1f09"}, + {file = "filelock-3.32.3.tar.gz", hash = "sha256:0ffa185a3540854c95caa7fa76b76cb219d907415e2c5dc9af25fd970563487f"}, +] + [[package]] name = "fs" version = "2.4.16" @@ -267,6 +442,21 @@ six = ">=1.10,<2.0" [package.extras] scandir = ["scandir (>=1.5,<2.0) ; python_version < \"3.5\""] +[[package]] +name = "identify" +version = "2.6.19" +description = "File identification library for Python" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "identify-2.6.19-py2.py3-none-any.whl", hash = "sha256:20e6a87f786f768c092a721ad107fc9df0eb89347be9396cadf3f4abbd1fb78a"}, + {file = "identify-2.6.19.tar.gz", hash = "sha256:6be5020c38fcb07da56c53733538a3081ea5aa70d36a156f83044bfbf9173842"}, +] + +[package.extras] +license = ["ukkonen"] + [[package]] name = "idna" version = "3.18" @@ -294,6 +484,234 @@ files = [ {file = "iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730"}, ] +[[package]] +name = "librt" +version = "0.15.0" +description = "Mypyc runtime library" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +markers = "platform_python_implementation != \"PyPy\"" +files = [ + {file = "librt-0.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e1a49adf16a7c9d9646816c2946135527197b6fcf4347c7b8b761cf1bfbf4489"}, + {file = "librt-0.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81a398f45b45a59200e13cd5ad1ae1d3f44334de98b148331afe2cdfee701c52"}, + {file = "librt-0.15.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4eafbaff06b9563f8b1c850621ce51605de05208e09d4d71ce490bc972b7b9e8"}, + {file = "librt-0.15.0-cp310-cp310-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:b0411b4066db926b80258c60dcb0e6db4c9cee312eab45b7e8866b17ddf9ada1"}, + {file = "librt-0.15.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:febb1ce6cac545a54e6b769982824e955a700fdd9fbf3a08a3d82c990968b57d"}, + {file = "librt-0.15.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b230acc1c3bfe2d6f2627ba2b95dc92e58aa494600e9722d0e6ccbc931e59702"}, + {file = "librt-0.15.0-cp310-cp310-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6da110e5f314c19ab8478464d02ae18808ae73d522c15260fa4918acdcd64da9"}, + {file = "librt-0.15.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:eab9208b00ca55bf75983ec99f7bf13acc746a36102e98953addaad7f7ea1e1b"}, + {file = "librt-0.15.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:6c013cd3a1721e69e14380ada97eaa4b7b0cdf1c6b96fa765d4ea47c875088db"}, + {file = "librt-0.15.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:567b1c430f8bd560e689421468278ac5941bab4a05303b5d95b6ae10db03f451"}, + {file = "librt-0.15.0-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:29c4cab9df457b19672c39be7f384ebb2bc925c4e2684b8780c222b43eb36389"}, + {file = "librt-0.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bccbd8e5b0bffb7106cf18eb1baa3d7194b1cebb3b4b1cdbd4bdb19382a6ee6c"}, + {file = "librt-0.15.0-cp310-cp310-win32.whl", hash = "sha256:8ae493ed5f659a7761c43d42f183db514536073ded9bcf671d2d1df47e29a07e"}, + {file = "librt-0.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:bc25fb356d0c7810bb49ff3df908ad1fda6995d660ab099ded69244ed7ab6053"}, + {file = "librt-0.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:823b92cf3c18ecd08afc70c42473888b41b6e8ef5046f3b82c05c154a2fa3d22"}, + {file = "librt-0.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c70bc1b602cf59917e8f0c7a2cbc8bcc6fbc14d5486136b00707a79619121d63"}, + {file = "librt-0.15.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:814ff83a25b5fce8b9c80c4dd803153fb5c5599fc74db9e022466938368957ef"}, + {file = "librt-0.15.0-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:57f5eeb6ad4c180de583b1038e61fe5fbd9796bb69a8a1c1a0c7ddbec4c8c60f"}, + {file = "librt-0.15.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:82909c8f7eb9952656b65d3147afde4cf8e6d5a991eebc86418b5e65843b0ab8"}, + {file = "librt-0.15.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f779070399f991400fc451719e0ea388eb7de313388bada2c127a35de05f798a"}, + {file = "librt-0.15.0-cp311-cp311-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bac89069bc496ebdf4f79ebb57bbd10d0b214c8454225deb672d91002bd17e18"}, + {file = "librt-0.15.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e0d00c708fb2f5822b152429b1ac80a58dbbbc3f6c232c4d13a3f7fcf2ea5b4c"}, + {file = "librt-0.15.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6c6624fe268625869485553dd7cc1daf30d22558215bb2a4ff16f67a9801a31a"}, + {file = "librt-0.15.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f56b397858a23dacf35ede366ed2212fdc03a6a57a1ad36468ad6e9dc5fac091"}, + {file = "librt-0.15.0-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:4388184646efe2054911c5b00a1077d6d1ee86a95b7e8ba96dc7850a809f3f40"}, + {file = "librt-0.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:97335f59082f9fe2ce6c2a9cc6433a0114bbb6cd4d5c09dd76c95c68b9f9a8b0"}, + {file = "librt-0.15.0-cp311-cp311-win32.whl", hash = "sha256:83380ffde38062a2e9bb55d83e74474f6614665528b98a6928720fc006dfffbb"}, + {file = "librt-0.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:f75720477ee05d509a310e856cacc8d909adc182f7b91193c207bcc26d7ee6db"}, + {file = "librt-0.15.0-cp311-cp311-win_arm64.whl", hash = "sha256:256237037a3ab001ae8d9803b2d43562a4c3aa38739843694349e4d5ebb0fd56"}, + {file = "librt-0.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e87bc679f86a99aa3b26e3c78eeb821a247c9a28eae48eaafcc32c3bf4c3bb9e"}, + {file = "librt-0.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:71599e011ac880e8e45d46047d714871894c7d4ab6f25626f8d4f89da21f368d"}, + {file = "librt-0.15.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c802434092b769b1d613ed2e13fac15fbfce1934a74bd10283b03c0fae231cd1"}, + {file = "librt-0.15.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:5500eeae393a184d14e1f35645962c27129d20c81afa4069e6ef826ebc2b3aaa"}, + {file = "librt-0.15.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6ecfc32dfb46fb7b565bcd6abf9412acf978775a998273d22888a6d7953730dd"}, + {file = "librt-0.15.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:89cc46cfd15022e35084355478c9ac809d90b1152222706ac9a7655ec21df6fa"}, + {file = "librt-0.15.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d5f51401d102c885b9ca509e62c79b1dbff286e1b9b047fde6f763780789356d"}, + {file = "librt-0.15.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:cc30523e3f1a23fb7511cc659834a0d01a1042bb9de359bc1c131cc4ec6c9656"}, + {file = "librt-0.15.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:59fe030d8ae4a57e3fb7756bf35a858de74e04066fc8555c53d0af979132af81"}, + {file = "librt-0.15.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5a6526a2a956bbb1e4ae3568c82e650fc99119c66bb011ea60715744955a2b4d"}, + {file = "librt-0.15.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:85ea21ec6730194d67156b0e0b5430ccb1d61f8b8b907e39b37f9812b74a13f0"}, + {file = "librt-0.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1e47b8ba865d7ede071a91a7163073bbaeb72541f1ef8a07d512c45c7b5007f2"}, + {file = "librt-0.15.0-cp312-cp312-win32.whl", hash = "sha256:a5207ec414d1c4a2a7231b2086970dc036f94293cdf338190984958a013a42f1"}, + {file = "librt-0.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:73b30cfa976659b3917c8f6153bdb0591c6a9ec6583599fd24a689b690622022"}, + {file = "librt-0.15.0-cp312-cp312-win_arm64.whl", hash = "sha256:a54cf9e0ef47b96af580849db5471142200568ce1e02cbf416addab551369570"}, + {file = "librt-0.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:db13ca398005abcbe538deda87b686d9bd08b7001cf40c4c06b444960ae10a26"}, + {file = "librt-0.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:aa1f1995789dca3698bc550aaceb09a51bd5df0a057ff84ff15296cd1975b801"}, + {file = "librt-0.15.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:55456ea87d8df21808446d03817be2f65e20391c1c615d9187440dff28cd08dc"}, + {file = "librt-0.15.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:5a86a5a08c2235316bdb359d5dbb6ce0abfca7fac06363103e2c5af571d92f95"}, + {file = "librt-0.15.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e56b6a368529bed262da40ce13f8fef590db0479819cca84f16a1f01ac356d0b"}, + {file = "librt-0.15.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:234d8d394721fa0d786af15ebf1f3fb7f3ed82fd1cd0cde45c2f247b5d4281d2"}, + {file = "librt-0.15.0-cp313-cp313-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d8363d7accb0286ac3a0e633f396e93800dafb8150494505daf9515bbda591f3"}, + {file = "librt-0.15.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0f0ee3644d951f31055ad07d77d92520e84505dd7a432cc4cd501dd70ee06785"}, + {file = "librt-0.15.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2cfd1a81a648806e6a7717be4cc4d1bb392fa229752bf8444ba365e381e984d6"}, + {file = "librt-0.15.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:a6cd22c9da0d866558e46a041f1cc0c2bbb26b61b137b2347fa834c332e1d101"}, + {file = "librt-0.15.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:6d5225ef8801e4ea5e482fa9b5dfb891dd9ef6f6d870f1f25d449ca2c70ac218"}, + {file = "librt-0.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6d28a05796b99f749bf8794f17ba9ba1612d0076b802e9cfc62c554634e9ce3b"}, + {file = "librt-0.15.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:2067ff438048cead9d223ca5675bae2a25e520a7c3e6c1498bf9c6892d22caab"}, + {file = "librt-0.15.0-cp313-cp313-win32.whl", hash = "sha256:1cd3b721f24c206398b9e26da3c3a9c011e6e89d06f318ba8ebefc30f1003890"}, + {file = "librt-0.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:f395a4a9a03ac062dbe9a9f82e0c720502e590a38feee6a757bc82e9c63afbd8"}, + {file = "librt-0.15.0-cp313-cp313-win_arm64.whl", hash = "sha256:0a15cb554761247d84a3ec0cbdf4078d70725384f0e4662c0fa3b26266eb60ad"}, + {file = "librt-0.15.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:f5de7feedc56337a088eb15cd9fafa9938367362221d8cc62c642b7f94821993"}, + {file = "librt-0.15.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:6c0eb900c0e91f4aebe680845242e614f1864edfd44106380d0752ac29522bf8"}, + {file = "librt-0.15.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e8c9a650a188e38bac005048cbe6342e81407782944d01934540ab75e417df21"}, + {file = "librt-0.15.0-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:92bfed8deec93df30286b9fe9e3b1dd17329cc076a192b4ee5ec223841d54953"}, + {file = "librt-0.15.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ec4b19788f835711a2072f9dbe6b03b3bf32ed1f0fb30cf399bdd59d9f0c33fa"}, + {file = "librt-0.15.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4c7bacb70930f3d0a56f4ecf1be474a1f0d941b01dd73b756f3c256d42cb879"}, + {file = "librt-0.15.0-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3e79f05e4a08b4d880342673312bbc895b56df7765605796f15902eb5367d3ae"}, + {file = "librt-0.15.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a417149c0cba4d50b61e992e5a15e69eaf96746609b461cc4ed168aeef6b79dd"}, + {file = "librt-0.15.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:da7a94d6a3411f579d72aa3e3bc5fbca7ed4549f3dbd7e5de3aa567333374285"}, + {file = "librt-0.15.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:856f743ae607f2c1380eccb566c0038a9fb3eabf0fc2be2704d76d9f73557239"}, + {file = "librt-0.15.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:779a6e7c894737e5983e7790a9c78c4000c30e23c9aada08081bdbea53b0fa60"}, + {file = "librt-0.15.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:96bb17dbe8bab3c0954fbebfc69ed395599de75b6bbc35e3270a878e15d4dd65"}, + {file = "librt-0.15.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:7220697efaa6e5348fc3d18ee7f8563d4bfecd9872b37ffb915bfc1d08840622"}, + {file = "librt-0.15.0-cp314-cp314-win32.whl", hash = "sha256:f54598964d357b1c5ab77cf5d92f21e598fe0e23cdbe9618480807f81b4eba15"}, + {file = "librt-0.15.0-cp314-cp314-win_amd64.whl", hash = "sha256:3ff5893a2c23d886aa9ce786de5ac6ddc74aeeaf90743682b74d920e117d2e28"}, + {file = "librt-0.15.0-cp314-cp314-win_arm64.whl", hash = "sha256:3722a099730704c9a3d70c879fc0f51daec25fe5f1555672d97bc595abeafb95"}, + {file = "librt-0.15.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:38c0c7d4b6fc06c3324b3f9162c8391bfc4fd9dde53afe1033ce7edb48d5a714"}, + {file = "librt-0.15.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:8b2fdd7ead3c995c37940a790690660d0ca006c302db26cc51933f6766866fc3"}, + {file = "librt-0.15.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2fde98cf1fc4bac144ce23c2c4c017b924ba714509ea9334977b0b27050c837d"}, + {file = "librt-0.15.0-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:e3b461183c5fa7681b48560f91515f53a953122fb30c71e07abc67d7ddf58c38"}, + {file = "librt-0.15.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4bbcc257e3babea20a91715c361b24554ec4e8f51aa578568afc230799fe1a19"}, + {file = "librt-0.15.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b845b8d48088fad0cadc84be4b8fda63203be7e9237b71015b3925443c1f35ab"}, + {file = "librt-0.15.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b30e600e8f337b9bd7f39b86d9fdfedc73cc46e3d0f745931a23a234220bb7e2"}, + {file = "librt-0.15.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:64b0c8c35aa4c4ed79896359f3e0b285cbe4e610042106500da4811c322cc108"}, + {file = "librt-0.15.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:0da0d94cb802f32a0524653e7201f2cef72d5f700a5407678f5290483d4fcd08"}, + {file = "librt-0.15.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:4a6369168d371207339b1e50d4532b06a7121586141f82599505a3f315751d47"}, + {file = "librt-0.15.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:c434e072557ade9cbc642d052c89d031efe47d5c9614523619d0d74a02378e81"}, + {file = "librt-0.15.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c7eec6a42018bc1d45763b1c162d3d2bf7c3b9a1b0ed30d3e91dcba390efefcc"}, + {file = "librt-0.15.0-cp314-cp314t-win32.whl", hash = "sha256:6912fa5e635d74529ac7cdb1bdf6ca3af4453da8d1edbe0110ee1cb4ad407ebf"}, + {file = "librt-0.15.0-cp314-cp314t-win_amd64.whl", hash = "sha256:8e11699ed745931c395acd3621b07062e0f840efa6935aad87a64ed0995f0915"}, + {file = "librt-0.15.0-cp314-cp314t-win_arm64.whl", hash = "sha256:5d2a91724463bfed4f573cd7a9fdc856d2e230d0c0e5a61416a93481dccd8605"}, + {file = "librt-0.15.0-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:8443e38dcfcfdbcf5add5118c623efd788d65ac2e25756d6251a54a06a4d0aca"}, + {file = "librt-0.15.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:6d15a29033c57490cfe2069097c6fc4049e4e65ffbb749be7dc453b7c4c68965"}, + {file = "librt-0.15.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d2c05c729b589e734c09578bf5964be48a911765484840d017bbc84f49d4c4ad"}, + {file = "librt-0.15.0-cp315-cp315-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:fa60887537e1d0cd2d9982269d33a709bf54b195cd2b9364fc0a758022af5bd9"}, + {file = "librt-0.15.0-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d8bc24219b24c0af375718942ab75e3544b2763085f40f965be4326734ae8328"}, + {file = "librt-0.15.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:86a21a7bd3fe3a419512ef424cc1c020f6771d0b29cfddff36d1635a855e63f0"}, + {file = "librt-0.15.0-cp315-cp315-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:dbab647e88d90b3167b91efe7091e248653688ed4337e4f90907a722c7361bb9"}, + {file = "librt-0.15.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:d8edcf6f550e918dca779c069b9e156385c60b406f99fc7641f32c52f7193659"}, + {file = "librt-0.15.0-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:8b62076030baa2d8b1501a46bf0e19c27a489aa90671c55665bff7887f7660b0"}, + {file = "librt-0.15.0-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:d00d20d1818e82a07a0ee0aa89a98b17ed7916b92441090b683719cb20a59b6d"}, + {file = "librt-0.15.0-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:4e6ee93fc3cf848dcbf0cce2eca73d8e7dcd0cc2b6df3a529d57750b30a4c55c"}, + {file = "librt-0.15.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:32896a0af72508ea979e0acb4e4c04cbeeae04938167950d535c83c45597167d"}, + {file = "librt-0.15.0-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:ec3ba415afaf951f6951b1dd16d3c8e4f540065fc382d7e70b823a79567ca374"}, + {file = "librt-0.15.0-cp315-cp315-win32.whl", hash = "sha256:d2813ba2503764f0450680c533d13df7cff9b49df1411062eded5f67db4195b9"}, + {file = "librt-0.15.0-cp315-cp315-win_amd64.whl", hash = "sha256:b87d67e33afaf265262f2a66db578284b88ee2e6fcd224579cb5c15518677ad8"}, + {file = "librt-0.15.0-cp315-cp315-win_arm64.whl", hash = "sha256:713bd7df21170b982e729e46870f31d6b437bd1a9b4648cffb529bd3c2ec5c4b"}, + {file = "librt-0.15.0-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:3de789c82752730f94782a5ee518baf9c05edf85733aeaf73bb6e518755cdf54"}, + {file = "librt-0.15.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:e0b5deec9a8664eb722c797241970fd4aa1894d25fda36a1ddac0f7407606bd6"}, + {file = "librt-0.15.0-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5563302a8359bc2295bb7084d1a8ed1519df96afb30eb2aa4e0bff7b54228988"}, + {file = "librt-0.15.0-cp315-cp315t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:22d6263b9d39d7bbb286fa791945646e3218f1be2d693e36fb630f1d0e59cd13"}, + {file = "librt-0.15.0-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:39ffd14646190c454f0d86e0d256b33f00a87a26ab410e619773b841d0e41416"}, + {file = "librt-0.15.0-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c47318cd3a61401452de11282242937e3e057c4fd3dbaf601e269d0928a06c0a"}, + {file = "librt-0.15.0-cp315-cp315t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a56a1d4f859a82ca5b99fc4b82c9b027b15e3c455c5cd99e7d0719f27bb20b6c"}, + {file = "librt-0.15.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:077471b3182db4e17c36ae91555f36a4d2c00080b267f749bcad34a478a9a302"}, + {file = "librt-0.15.0-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:411ca4d1b905b860ceba7570dd6717a71dedaddcc4b0f77ece710aa41ee11f8d"}, + {file = "librt-0.15.0-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:1256589e0b0adb31751d685a68bce29d73407ddf4ef05d4188f49d5dcf9566d9"}, + {file = "librt-0.15.0-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:f42b74a53e5f26a0ba0007411a7455b66c67ce4022a39cc1f56fc4efd65bcbab"}, + {file = "librt-0.15.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:291bf73caf78b9e88d6fae9bfd693207ff7d832e2fdbe2cf8e746bc13f5f892b"}, + {file = "librt-0.15.0-cp315-cp315t-win32.whl", hash = "sha256:c16d15ee371643ab48dc8248a3e680ebbeca573a13af2c3dd0c985b142d77162"}, + {file = "librt-0.15.0-cp315-cp315t-win_amd64.whl", hash = "sha256:dbd605739f228912dc49027cb764456b9757750bdc2b6b7773164db7096c6fd1"}, + {file = "librt-0.15.0-cp315-cp315t-win_arm64.whl", hash = "sha256:84d244b00604d17df3fc7736c327892d6bba66181254aa4087be807b6c342bdc"}, + {file = "librt-0.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0e2d0c0acf5b0ada7d045912b7cf787c21315c95b38b1fa939ef72d45d366b3d"}, + {file = "librt-0.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f9ca190fe9edc0eb08eec558a509a16d28d91c35667b8f043cba40ed5e77a959"}, + {file = "librt-0.15.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:80811e1c42386ea95c6fb30571d3250ad43d7863f883f787f70517f441150e59"}, + {file = "librt-0.15.0-cp39-cp39-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:88c2a17815c266e6d8180204ff62cb739ab869ada4a746d4c505331526ac58f1"}, + {file = "librt-0.15.0-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a5fa8f1f916988d0bf1afea005bda37f56ac41a18016e813ccf0097a8d460ca4"}, + {file = "librt-0.15.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:355e3a4c725225a14262004fc1872a552b9d3634b4f791a0dfc80804aafbfd55"}, + {file = "librt-0.15.0-cp39-cp39-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:fc1ed11c4ad0b91af24def2050f2840ea4567828e3dd058fbe608d982f6e5465"}, + {file = "librt-0.15.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1f4ef2e71db33df4309167ed7f1520c4fae5e611226e159fa9cf33f93e6ddb3d"}, + {file = "librt-0.15.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1a1a8cd430c7dd0c083f455cb1b328d7fc682b05c31b940906f7845bdff80881"}, + {file = "librt-0.15.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:04d5387b908676c0b8d5d2f5fb58373b4ea382d81f7a6f0fab8ea2a462bb4738"}, + {file = "librt-0.15.0-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:1172c6ad2a88b646e7fe3b480e3fac4ab4418b3443fd8a4061fdd531e0622fc7"}, + {file = "librt-0.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:52e8db01f603f5da0ca30987479acff98769382efc8e142fa3962395dcf3ffdb"}, + {file = "librt-0.15.0-cp39-cp39-win32.whl", hash = "sha256:e4c911f15a1652ca94ae9f1abd92e74cbb1b3597d2d92fdd556202f94e8cd455"}, + {file = "librt-0.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:68242379c9b65a582b6e97318a1e9fbd6d445e58954f2d437991c4804ab11578"}, + {file = "librt-0.15.0.tar.gz", hash = "sha256:4e66cbe84437497d951b799d3e1551291b6fb3d643820a7014b3655d57a59162"}, +] + +[[package]] +name = "mypy" +version = "2.3.1" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "mypy-2.3.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:57a936373fc690c43a8cd7e7e12a35148e4ec5aa7698ad7fc0a9f918bdc5be41"}, + {file = "mypy-2.3.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d00d769056bde2f4e69c175071eba45cfb44fa1ed92bdfbfe64a93e0543b0cf0"}, + {file = "mypy-2.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2166b29228835e1f88ff411e96639e6ca3c7fdde84b62ec211f70f86b4051167"}, + {file = "mypy-2.3.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:83d36c2924df7426333abe7faf4724a7e1aab0d9fd41625e81b4683034b80c13"}, + {file = "mypy-2.3.1-cp310-cp310-win_amd64.whl", hash = "sha256:f12fdb70459d0060dea40b29e52163a961b156106d68d57882a6a9f648983a53"}, + {file = "mypy-2.3.1-cp310-cp310-win_arm64.whl", hash = "sha256:e099200a1b1b1223a4951f0a90cbff1b8c91b250ba599dab1f7217a628144d90"}, + {file = "mypy-2.3.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:94f04929f1c44c35fb0061e912087edaf504acede963a4a7d00680bd089d8531"}, + {file = "mypy-2.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f5d716048611e85ca9eefb2e1baa5d73ede389b5820ded260ea27c757d667af8"}, + {file = "mypy-2.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b091a455111214cb5c9d54a57b9618e9a49f9fe2a42e4e1ac86e9d104ed96ce8"}, + {file = "mypy-2.3.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:df12e20c9efd614738c71b390007ecd0181125afc4ccafca04d78a1d2eed2c01"}, + {file = "mypy-2.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:52eaf3a155f35cf80b40220288c861eb45f14a2340c1f6cbfbdb0feff32879d1"}, + {file = "mypy-2.3.1-cp311-cp311-win_arm64.whl", hash = "sha256:9b4eacbee8a69836c06eff6d0dd4e134a07c2b047755b30c08625fe214f322c6"}, + {file = "mypy-2.3.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a32bbbb940af990d3be0b8af321c7b6815bb1b3b48142fe7459b9cc5f58959ff"}, + {file = "mypy-2.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff715e45b2231a8e85de1d163d1b42791e4d7aab8f5145f85fee1b710b735aff"}, + {file = "mypy-2.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:858fc57d3d91fa728e33e7ad71def60fc6272694607b306cd3292db53ae39080"}, + {file = "mypy-2.3.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:851833db876e7b650f93719c74b7879a08e338979c96054fdfc3bfd90a486355"}, + {file = "mypy-2.3.1-cp312-cp312-win_amd64.whl", hash = "sha256:4c5095a327483591c94e0c8d3ef9e50d4ab1369b541eae007c1f23bc2a41f6bb"}, + {file = "mypy-2.3.1-cp312-cp312-win_arm64.whl", hash = "sha256:bbfe022634a2a195406bd469e888d2eaf193b02ba7e607391cd7640374aaae3b"}, + {file = "mypy-2.3.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:114dff494000f18bd10d5d95d84b8567b26da60279ecbe838131841df20e635d"}, + {file = "mypy-2.3.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c8637731bb5eee3671eb2c3200827aa3564ed8a9309ecee4d1afe77e6d031bdb"}, + {file = "mypy-2.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c80fbc405ed8020f5ff3802dc18cf060197bcdd3fbdd6a26ef2fd34dfdd5226"}, + {file = "mypy-2.3.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:84081f538ce27375045c02e3d7f81bd11d853400621ae245d87ce7b6c420ec74"}, + {file = "mypy-2.3.1-cp313-cp313-win_amd64.whl", hash = "sha256:e9144ac16fde007096f9563eb2041b4433c2d705c4218edeb79e7e9d01035ee6"}, + {file = "mypy-2.3.1-cp313-cp313-win_arm64.whl", hash = "sha256:77ad9529e67dca28e511f5cd5671436584ce91f6d3bac159a353158187b986ac"}, + {file = "mypy-2.3.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:192abaedf75da1bc0b1cef104927e70ec49c1ef0031cc4825c7ee10a438ed24d"}, + {file = "mypy-2.3.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bf678dffd16efcda2c15cbd30e9ecc0081388e29ea23687a88e686ed92638dc3"}, + {file = "mypy-2.3.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e036f06b41630f4c8a1d48f9ac6aa26acc65f8be089973f5519da643318f03f"}, + {file = "mypy-2.3.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:71af9c8a894e862b58e92abb08e53b05a384a1e5e5d6dc7cda59126211a53d82"}, + {file = "mypy-2.3.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:3c80cd23d85368bdd9f37d5231dfd97d35bcbf5bf41af96ef3a9b078ad1957f9"}, + {file = "mypy-2.3.1-cp314-cp314-win_amd64.whl", hash = "sha256:4956f34d145e145562a0a0bf367f642bbc85c04ec2baf47ae015947c3169a85d"}, + {file = "mypy-2.3.1-cp314-cp314-win_arm64.whl", hash = "sha256:cfb12e360242d23d91f5e978d94f58ea66acf5804c4fb6f2f794a20d4cb1b595"}, + {file = "mypy-2.3.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e5f1c50bb05b64e2026b52867e8d21106f01313c744a2c4ecc34c90d12e8d6e2"}, + {file = "mypy-2.3.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:667196b352f4cf304ded4c10f90cfc179263a1acfb3cdcfa984bdfd340d498bc"}, + {file = "mypy-2.3.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b9c53e395c12cad2c6d4b67d5da7c6057638a132d85c08b73646b18f802a0045"}, + {file = "mypy-2.3.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:18162b128c3f9c703cd35f5537446900b0d21a2549aa7a95d21380d2ef643fb0"}, + {file = "mypy-2.3.1-cp314-cp314t-win_amd64.whl", hash = "sha256:30c0477d4aab7b7f39c8397dc877f2c96b9fe5588ec379f372c56eb63d599f63"}, + {file = "mypy-2.3.1-cp314-cp314t-win_arm64.whl", hash = "sha256:6941ab3619377bc3f32ca02876b07d27f216f5201604b664d3937ea0fdd23bb4"}, + {file = "mypy-2.3.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:6f041a6de52c9217ca125e78ba0a335cb7fd98a1c0580978e49ab2b126f70b57"}, + {file = "mypy-2.3.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5159ae60f5dbc3a498af5ba8365505808ac8031bc63f9e00304ad545d40bdd9b"}, + {file = "mypy-2.3.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:47a8a7a0a7f6f6e63995c0ac36fa0c07b127413fdc81f0439b7f3dccafd33561"}, + {file = "mypy-2.3.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:2329c0501293d4e1f33bc15d04d6304d65a1cdda967ee93a05c1e681a3923133"}, + {file = "mypy-2.3.1-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:bb26deed807bdb0457cf3e3f1cd7c4a1cf9d66864eaf1b4a61e06805d4c6b1f9"}, + {file = "mypy-2.3.1-cp315-cp315-win_amd64.whl", hash = "sha256:375d7013876a8233b2d05be185bfa09f689696cd999ce8b1cfe6acac5c80e8a3"}, + {file = "mypy-2.3.1-cp315-cp315-win_arm64.whl", hash = "sha256:586b3612214cceabb3c0f588c97e7d1e535393f06a60e912e994f6b3ace97523"}, + {file = "mypy-2.3.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:ef0c6335cda9d807f8193d8ff6204a72bc909fa9882aacbca14f43cdb7188306"}, + {file = "mypy-2.3.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e598c8c66401d26b150872154a286e6d484cf2789c3bb28a7556806298423021"}, + {file = "mypy-2.3.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eda22fd4efa9dcd39331d1dede9b5b8b8a7fd69af07592e778433da98610d29e"}, + {file = "mypy-2.3.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:2a0ba2e57847849fb0d1fcdabb32786d223095ed8bc121dfe322bcdb3d9c46bc"}, + {file = "mypy-2.3.1-cp315-cp315t-win_amd64.whl", hash = "sha256:3f7e865dd51f235f60a2dbcd8728a1c095f5ca28f095d48a725b84cd935735c4"}, + {file = "mypy-2.3.1-cp315-cp315t-win_arm64.whl", hash = "sha256:8ad80807dc3ab8ea978b1b2b6e4a657194ace1d4ef03e0e731aff1abd517da29"}, + {file = "mypy-2.3.1-py3-none-any.whl", hash = "sha256:6ed5c7e3419083268e5c9258bd1c1ef91af44a9e89374dbcaf37b775716e72eb"}, + {file = "mypy-2.3.1.tar.gz", hash = "sha256:47c1b1207258513a9d93495f69c8be9de73916186f0e52703e8c461b7a623419"}, +] + +[package.dependencies] +ast-serialize = ">=0.6.0,<1.0.0" +librt = {version = ">=0.13.0", markers = "platform_python_implementation != \"PyPy\""} +mypy_extensions = ">=1.0.0" +pathspec = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing_extensions = [ + {version = ">=4.6.0", markers = "python_version < \"3.15\""}, + {version = ">=4.14.0", markers = "python_version >= \"3.15\""}, +] + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + [[package]] name = "mypy-extensions" version = "1.1.0" @@ -306,6 +724,18 @@ files = [ {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, ] +[[package]] +name = "nodeenv" +version = "1.10.0" +description = "Node.js virtual environment builder" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +files = [ + {file = "nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827"}, + {file = "nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb"}, +] + [[package]] name = "packaging" version = "26.2" @@ -363,6 +793,25 @@ files = [ dev = ["pre-commit", "tox"] testing = ["coverage", "pytest", "pytest-benchmark"] +[[package]] +name = "pre-commit" +version = "4.6.2" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "pre_commit-4.6.2-py2.py3-none-any.whl", hash = "sha256:e2dde9a75d3bce11bd3831c26d134df00a2803c1d818be6a0383c3dcda25dc4e"}, + {file = "pre_commit-4.6.2.tar.gz", hash = "sha256:8f5d7bfb021ecdbcd9d49d89847082dd24172ccde534390081a679ad046e2441"}, +] + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +virtualenv = ">=20.10.0" + [[package]] name = "pygments" version = "2.20.0" @@ -403,74 +852,54 @@ tomli = {version = ">=1", markers = "python_version < \"3.11\""} dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"] [[package]] -name = "python-dotenv" -version = "1.2.2" -description = "Read key-value pairs from a .env file and set them as environment variables" +name = "pytest-cov" +version = "7.1.0" +description = "Pytest plugin for measuring coverage." optional = false -python-versions = ">=3.10" +python-versions = ">=3.9" groups = ["dev"] files = [ - {file = "python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a"}, - {file = "python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3"}, + {file = "pytest_cov-7.1.0-py3-none-any.whl", hash = "sha256:a0461110b7865f9a271aa1b51e516c9a95de9d696734a2f71e3e78f46e1d4678"}, + {file = "pytest_cov-7.1.0.tar.gz", hash = "sha256:30674f2b5f6351aa09702a9c8c364f6a01c27aae0c1366ae8016160d1efc56b2"}, ] +[package.dependencies] +coverage = {version = ">=7.10.6", extras = ["toml"]} +pluggy = ">=1.2" +pytest = ">=7" + [package.extras] -cli = ["click (>=5.0)"] +testing = ["process-tests", "pytest-xdist", "virtualenv"] [[package]] -name = "pytokens" -version = "0.4.1" -description = "A Fast, spec compliant Python 3.14+ tokenizer that runs on older Pythons." +name = "python-discovery" +version = "1.5.2" +description = "Python interpreter discovery" optional = false python-versions = ">=3.8" groups = ["dev"] files = [ - {file = "pytokens-0.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2a44ed93ea23415c54f3face3b65ef2b844d96aeb3455b8a69b3df6beab6acc5"}, - {file = "pytokens-0.4.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:add8bf86b71a5d9fb5b89f023a80b791e04fba57960aa790cc6125f7f1d39dfe"}, - {file = "pytokens-0.4.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:670d286910b531c7b7e3c0b453fd8156f250adb140146d234a82219459b9640c"}, - {file = "pytokens-0.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:4e691d7f5186bd2842c14813f79f8884bb03f5995f0575272009982c5ac6c0f7"}, - {file = "pytokens-0.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:27b83ad28825978742beef057bfe406ad6ed524b2d28c252c5de7b4a6dd48fa2"}, - {file = "pytokens-0.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d70e77c55ae8380c91c0c18dea05951482e263982911fc7410b1ffd1dadd3440"}, - {file = "pytokens-0.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4a58d057208cb9075c144950d789511220b07636dd2e4708d5645d24de666bdc"}, - {file = "pytokens-0.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b49750419d300e2b5a3813cf229d4e5a4c728dae470bcc89867a9ad6f25a722d"}, - {file = "pytokens-0.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d9907d61f15bf7261d7e775bd5d7ee4d2930e04424bab1972591918497623a16"}, - {file = "pytokens-0.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:ee44d0f85b803321710f9239f335aafe16553b39106384cef8e6de40cb4ef2f6"}, - {file = "pytokens-0.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:140709331e846b728475786df8aeb27d24f48cbcf7bcd449f8de75cae7a45083"}, - {file = "pytokens-0.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6d6c4268598f762bc8e91f5dbf2ab2f61f7b95bdc07953b602db879b3c8c18e1"}, - {file = "pytokens-0.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:24afde1f53d95348b5a0eb19488661147285ca4dd7ed752bbc3e1c6242a304d1"}, - {file = "pytokens-0.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5ad948d085ed6c16413eb5fec6b3e02fa00dc29a2534f088d3302c47eb59adf9"}, - {file = "pytokens-0.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:3f901fe783e06e48e8cbdc82d631fca8f118333798193e026a50ce1b3757ea68"}, - {file = "pytokens-0.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8bdb9d0ce90cbf99c525e75a2fa415144fd570a1ba987380190e8b786bc6ef9b"}, - {file = "pytokens-0.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5502408cab1cb18e128570f8d598981c68a50d0cbd7c61312a90507cd3a1276f"}, - {file = "pytokens-0.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:29d1d8fb1030af4d231789959f21821ab6325e463f0503a61d204343c9b355d1"}, - {file = "pytokens-0.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:970b08dd6b86058b6dc07efe9e98414f5102974716232d10f32ff39701e841c4"}, - {file = "pytokens-0.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:9bd7d7f544d362576be74f9d5901a22f317efc20046efe2034dced238cbbfe78"}, - {file = "pytokens-0.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4a14d5f5fc78ce85e426aa159489e2d5961acf0e47575e08f35584009178e321"}, - {file = "pytokens-0.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97f50fd18543be72da51dd505e2ed20d2228c74e0464e4262e4899797803d7fa"}, - {file = "pytokens-0.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dc74c035f9bfca0255c1af77ddd2d6ae8419012805453e4b0e7513e17904545d"}, - {file = "pytokens-0.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f66a6bbe741bd431f6d741e617e0f39ec7257ca1f89089593479347cc4d13324"}, - {file = "pytokens-0.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:b35d7e5ad269804f6697727702da3c517bb8a5228afa450ab0fa787732055fc9"}, - {file = "pytokens-0.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:8fcb9ba3709ff77e77f1c7022ff11d13553f3c30299a9fe246a166903e9091eb"}, - {file = "pytokens-0.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:79fc6b8699564e1f9b521582c35435f1bd32dd06822322ec44afdeba666d8cb3"}, - {file = "pytokens-0.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d31b97b3de0f61571a124a00ffe9a81fb9939146c122c11060725bd5aea79975"}, - {file = "pytokens-0.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:967cf6e3fd4adf7de8fc73cd3043754ae79c36475c1c11d514fc72cf5490094a"}, - {file = "pytokens-0.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:584c80c24b078eec1e227079d56dc22ff755e0ba8654d8383b2c549107528918"}, - {file = "pytokens-0.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:da5baeaf7116dced9c6bb76dc31ba04a2dc3695f3d9f74741d7910122b456edc"}, - {file = "pytokens-0.4.1-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:11edda0942da80ff58c4408407616a310adecae1ddd22eef8c692fe266fa5009"}, - {file = "pytokens-0.4.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0fc71786e629cef478cbf29d7ea1923299181d0699dbe7c3c0f4a583811d9fc1"}, - {file = "pytokens-0.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:dcafc12c30dbaf1e2af0490978352e0c4041a7cde31f4f81435c2a5e8b9cabb6"}, - {file = "pytokens-0.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:42f144f3aafa5d92bad964d471a581651e28b24434d184871bd02e3a0d956037"}, - {file = "pytokens-0.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:34bcc734bd2f2d5fe3b34e7b3c0116bfb2397f2d9666139988e7a3eb5f7400e3"}, - {file = "pytokens-0.4.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:941d4343bf27b605e9213b26bfa1c4bf197c9c599a9627eb7305b0defcfe40c1"}, - {file = "pytokens-0.4.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3ad72b851e781478366288743198101e5eb34a414f1d5627cdd585ca3b25f1db"}, - {file = "pytokens-0.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:682fa37ff4d8e95f7df6fe6fe6a431e8ed8e788023c6bcc0f0880a12eab80ad1"}, - {file = "pytokens-0.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:30f51edd9bb7f85c748979384165601d028b84f7bd13fe14d3e065304093916a"}, - {file = "pytokens-0.4.1-py3-none-any.whl", hash = "sha256:26cef14744a8385f35d0e095dc8b3a7583f6c953c2e3d269c7f82484bf5ad2de"}, - {file = "pytokens-0.4.1.tar.gz", hash = "sha256:292052fe80923aae2260c073f822ceba21f3872ced9a68bb7953b348e561179a"}, + {file = "python_discovery-1.5.2-py3-none-any.whl", hash = "sha256:3e338c2d0f15dfaeea57493f4c2c6caebe0e998ea815c30ae8bf8ee21f1112d3"}, + {file = "python_discovery-1.5.2.tar.gz", hash = "sha256:45fd4f20a4e3f9b7bf2e0817870bc8e3b320a19658da177af800768c82dbf354"}, +] + +[package.dependencies] +filelock = ">=3.15.4" + +[[package]] +name = "python-dotenv" +version = "1.2.2" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a"}, + {file = "python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3"}, ] [package.extras] -dev = ["black", "build", "mypy", "pytest", "pytest-cov", "setuptools", "tox", "twine", "wheel"] +cli = ["click (>=5.0)"] [[package]] name = "pyyaml" @@ -597,6 +1026,34 @@ urllib3 = ">=1.25.10,<3.0" [package.extras] tests = ["coverage (>=6.0.0)", "flake8", "mypy", "pytest (>=7.0.0)", "pytest-asyncio", "pytest-cov", "pytest-httpserver", "tomli ; python_version < \"3.11\"", "tomli-w", "types-PyYAML", "types-requests"] +[[package]] +name = "ruff" +version = "0.16.3" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "ruff-0.16.3-py3-none-linux_armv6l.whl", hash = "sha256:0c5710e247a58a4521e66e124ba9a74655b414f61ba3a2e9e3811e11098f48f7"}, + {file = "ruff-0.16.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:fe155130631a2471fd2e14a7a664a4dfbd7194b8229c3d7b2a40b21178639081"}, + {file = "ruff-0.16.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e2ed719e14aa64d895c2ee922594a90a43c861a93f0575a95ff8c47cdbd13eb9"}, + {file = "ruff-0.16.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e0b1da805eb043654645d74d5de1e5ce2edc686e40790d2b86f56d71cc06a84"}, + {file = "ruff-0.16.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a37bdea0bbe21780f590bf437d6412c8c4e1b6cd010f91a65c2c40c5e5f5f870"}, + {file = "ruff-0.16.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09571e6d1288ed9be475207a3ac04ada404f1cd898104be0f6ab8d7df438575b"}, + {file = "ruff-0.16.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2c18c5a101eb540010638cc1ff3c84944d3adb3df62b8d98ca8f22ba484d3413"}, + {file = "ruff-0.16.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8457c44f15033c85ddbb77b15d451df9e24e4bd03b628396dd3610cedc3b8f82"}, + {file = "ruff-0.16.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:294b95c4ae0cda9388525c2047778aa758d6b8d4bb876fd4e9eaa3ebc92343eb"}, + {file = "ruff-0.16.3-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3d0c7c40c87c2a820509c31ba007968da6e1306468c067b2d82fbfdbcd0e8474"}, + {file = "ruff-0.16.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:9f738c0fdfa8eed0b2ce7fb27ee7258208a92a68d7949e62aa15164bc7b389da"}, + {file = "ruff-0.16.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fb785f0be25abe69d320415cd4f833b59e17ba7613d9ba6a958023b6bceb0a50"}, + {file = "ruff-0.16.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:c5536e3acfbf9563085aa2be7b13c629c3077e902afc5b941ac44024dbb9f506"}, + {file = "ruff-0.16.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a2d85c02f9b8e165d85e6779184d38c4132de12603dab59c51c28e22584f9e4d"}, + {file = "ruff-0.16.3-py3-none-win32.whl", hash = "sha256:388cdf2166642bd9b13d52b5932d3170f34f8abed7e8d9a855f1d84b83645a0a"}, + {file = "ruff-0.16.3-py3-none-win_amd64.whl", hash = "sha256:e80a7d69ca2a6d1c4d352ec91458cdca6e56c83cdbcabd93e4abe1e53591d948"}, + {file = "ruff-0.16.3-py3-none-win_arm64.whl", hash = "sha256:b8ca152da82c1acc1fa8d5874b15951935f0eef46f10e6954c83859011b6178a"}, + {file = "ruff-0.16.3.tar.gz", hash = "sha256:e76d33a347661a84b5be6d043d0347fdc745dfdcf825a8f4fed64b5e26eebdf2"}, +] + [[package]] name = "setuptools" version = "81.0.0" @@ -649,7 +1106,7 @@ description = "A lil' TOML parser" optional = false python-versions = ">=3.6" groups = ["dev"] -markers = "python_version == \"3.10\"" +markers = "python_full_version <= \"3.11.0a6\"" files = [ {file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"}, {file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"}, @@ -666,7 +1123,6 @@ files = [ {file = "typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8"}, {file = "typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5"}, ] -markers = {dev = "python_version == \"3.10\""} [[package]] name = "urllib3" @@ -686,7 +1142,26 @@ h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["backports-zstd (>=1.0.0) ; python_version < \"3.14\""] +[[package]] +name = "virtualenv" +version = "21.7.4" +description = "Virtual Python Environment builder" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "virtualenv-21.7.4-py3-none-any.whl", hash = "sha256:376ec93cd6aab3044fa395d7db226db38043b7b5748948044b2a87168525e843"}, + {file = "virtualenv-21.7.4.tar.gz", hash = "sha256:c9d960c95fa458171e58222a5ccab7465298e4b6559977865e627c4719f1e825"}, +] + +[package.dependencies] +distlib = ">=0.3.7,<1" +filelock = {version = ">=3.24.2,<4", markers = "python_version >= \"3.10\""} +platformdirs = ">=3.9.1,<5" +python-discovery = ">=1.4.2" +typing-extensions = {version = ">=4.13.2", markers = "python_version < \"3.11\""} + [metadata] lock-version = "2.1" python-versions = ">=3.10" -content-hash = "e3669968d1cae9349b34bd3aeb8bec35985c5d67b33187a54c5a91648cc1d439" +content-hash = "15080d0aa10cc42194768aaa44ac1c62de24e47396b382d0befad81869eefb88" diff --git a/pyproject.toml b/pyproject.toml index 75dbf62..2c69e69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,9 +43,12 @@ exclude = ["examples/*", "rspace_client/tests/*"] dev = [ "python-dotenv>=1.1.1,<2", "pytest>=8.0.0,<9", - "black>=21.6b0", + "pytest-cov>=5.0.0", "responses>=0.26.2,<0.27", "universal-pathlib>=0.2", + "ruff==0.16.3", + "mypy==2.3.1", + "pre-commit>=3.7", ] [build-system] @@ -57,3 +60,37 @@ testpaths = ["rspace_client/tests"] markers = [ "integration: marks tests as integration tests requiring a live RSpace server (deselect with '-m not integration')", ] + +[tool.coverage.run] +source = ["rspace_client"] +omit = ["rspace_client/tests/*", "rspace_client/notebook_sync/*"] + +[tool.ruff] +line-length = 88 +target-version = "py310" +extend-exclude = ["rspace_client/notebook_sync", "jupyter_notebooks"] + +[tool.ruff.lint] +select = ["E", "F", "I", "UP", "B", "SIM"] +# `ruff format` already wraps every line it safely can at 88 columns; what's +# left is mostly long strings, URLs and comments that splitting would only +# make harder to read, so line length is left to the formatter rather than +# enforced as a lint error. +ignore = ["E501"] + +[tool.ruff.lint.per-file-ignores] +# tree_upload.py passes lambdas straight into a helper that invokes them +# synchronously within the same loop iteration, so the loop-variable capture +# ruff warns about here is never actually stale. +"examples/tree_upload.py" = ["B023"] + +[tool.mypy] +python_version = "3.10" +ignore_missing_imports = true +# Much of this codebase predates type hints and still relies on `= None` +# defaults with a non-Optional annotation; restore mypy's pre-1.0 behaviour +# of treating that as implicitly Optional rather than annotating every call +# site as part of a tooling change. Revisit as part of the Phase 3 full-typing +# pass (see .claude/rspace-python-client-improvement.md). +implicit_optional = true +exclude = ["rspace_client/notebook_sync"] From dbd387f185db7d40cc1353404876c53ff36b556f Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:11:33 +0100 Subject: [PATCH 03/21] fix: avoid shared mutable default arguments in inv and eln Several methods used mutable or stateful defaults (Pagination(), tags=[], extra_fields=[], TopLevelTargetLocation(), item_ids=[], typesToInclude=[]). Those objects are created once and shared by every call that omits the argument, so e.g. a SearchFilter merged into the default Pagination leaked into later calls. Default to None and build a fresh value per call. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 5 +++ rspace_client/eln/eln.py | 11 ++--- rspace_client/inv/inv.py | 92 +++++++++++++++++++++++----------------- 3 files changed, 64 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93d592b..af76d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,11 @@ All notable changes to this project will be documented in this file - Development tooling: added `ruff` (lint + format, replacing `black`), `mypy`, `pre-commit` and `pytest-cov` configuration. +- Fixed shared mutable default arguments (`Pagination()`, `tags=[]`, + `extra_fields=[]`, `TopLevelTargetLocation()`, `item_ids=[]`, + `typesToInclude=[]`) in several `inv` and `eln` methods, which could leak + state across calls made without an explicit argument. + - Gallery upload routing and section-mismatch handling (PR #56): clearer `GallerySectionMismatch` exception, optional `on_mismatch="reroute"` policy to auto-reroute uploads into the server-chosen section, `upload()` now diff --git a/rspace_client/eln/eln.py b/rspace_client/eln/eln.py index b725678..e48cd61 100644 --- a/rspace_client/eln/eln.py +++ b/rspace_client/eln/eln.py @@ -44,7 +44,7 @@ def get_documents( return self.retrieve_api_results("/documents", params) - def stream_documents(self, pagination: Pagination = Pagination()): + def stream_documents(self, pagination: Pagination = None): return self._stream("documents", pagination) def get_documents_advanced_query( @@ -450,7 +450,7 @@ def get_activity( # Export selection def start_export_selection( - self, export_format, item_ids=[], include_revisions=False + self, export_format, item_ids=None, include_revisions=False ): """ Starts an asynchronous of selection of items. @@ -462,7 +462,7 @@ def start_export_selection( :return: job id """ self._check_export_format(export_format) - itemsToExport = ",".join(map(str, item_ids)) + itemsToExport = ",".join(map(str, item_ids or [])) request_url = ( self._get_api_url() + f"/export/{export_format}/selection?selections={itemsToExport}&includeRevisionHistory={include_revisions}" @@ -512,7 +512,7 @@ def download_export_selection( self, export_format, file_path, - item_ids=[], + item_ids=None, include_revision_history=False, wait_between_requests=30, ): @@ -795,7 +795,7 @@ def get_folder(self, folder_id): numeric_folder_id = self._get_numeric_record_id(folder_id) return self.retrieve_api_results("/folders/{}".format(numeric_folder_id)) - def list_folder_tree(self, folder_id=None, typesToInclude=[], page_size=None): + def list_folder_tree(self, folder_id=None, typesToInclude=None, page_size=None): """ Lists contents of a folder by its ID. :param folder_id. Optional folderId. If none, will return listing of Home Folder @@ -805,6 +805,7 @@ def list_folder_tree(self, folder_id=None, typesToInclude=[], page_size=None): follow the response's 'next' link for further pages :return a paginated folder listing """ + typesToInclude = typesToInclude or [] url = "" if folder_id is not None: url = "/folders/tree/{}".format(folder_id) diff --git a/rspace_client/inv/inv.py b/rspace_client/inv/inv.py index 39cb9dc..eae0c3a 100644 --- a/rspace_client/inv/inv.py +++ b/rspace_client/inv/inv.py @@ -959,10 +959,14 @@ def __init__( self, name: str, itemType: str, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, ): + if tags is None: + tags = [] + if extra_fields is None: + extra_fields = [] self.data = {} self.data["type"] = itemType self.data["name"] = name @@ -981,9 +985,9 @@ class SamplePost(ItemPost): def __init__( self, name: str, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, sample_template_id=None, fields=None, storage_temperature_min: StorageTemperature = None, @@ -1029,9 +1033,9 @@ class InstrumentPost(ItemPost): def __init__( self, name: str, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, instrument_template_id=None, fields=None, attachments=None, @@ -1145,13 +1149,15 @@ class ContainerPost(ItemPost): def __init__( self, name: str, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, can_store_containers: bool = True, can_store_samples: bool = True, - location: TargetLocation = TopLevelTargetLocation(), + location: TargetLocation = None, ): + if location is None: + location = TopLevelTargetLocation() super().__init__(name, "CONTAINER", tags, description, extra_fields) if not can_store_containers and not can_store_samples: raise ValueError( @@ -1174,12 +1180,12 @@ class ListContainerPost(ContainerPost): def __init__( self, name: str, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, can_store_containers: bool = True, can_store_samples: bool = True, - location: TargetLocation = TopLevelTargetLocation(), + location: TargetLocation = None, ): super().__init__( name, @@ -1206,13 +1212,13 @@ def __init__( self, name: str, image_file: Union[str, io.BufferedReader], - locations: Optional[Sequence] = [], - tags: List[Tag] = [], + locations: Optional[Sequence] = None, + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, can_store_containers: bool = True, can_store_samples: bool = True, - location: TargetLocation = TopLevelTargetLocation(), + location: TargetLocation = None, ): """ Parameters @@ -1250,7 +1256,7 @@ def __init__( self._setencoded(img_file) elif isinstance(image_file, io.BufferedReader): self._setencoded(image_file) - locs = [{"coordX": p[0], "coordY": p[1]} for p in locations] + locs = [{"coordX": p[0], "coordY": p[1]} for p in (locations or [])] self.data["locations"] = locs self.data["cType"] = "IMAGE" @@ -1265,12 +1271,12 @@ def __init__( name: str, row_count: int, column_count: int, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, can_store_containers: bool = True, can_store_samples: bool = True, - location: TargetLocation = TopLevelTargetLocation(), + location: TargetLocation = None, ): super().__init__( name, @@ -1336,9 +1342,9 @@ def bulk_create_sample(self, *sample_posts): def create_sample( self, name: str, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, sample_template_id=None, fields=None, storage_temperature_min: StorageTemperature = None, @@ -1405,7 +1411,7 @@ def get_subsample_by_id(self, subsample_id: Union[str, int]) -> dict: return self.retrieve_api_results(f"/subSamples/{ss_id.as_id()}") def list_samples( - self, pagination: Pagination = Pagination(), sample_filter: SearchFilter = None + self, pagination: Pagination = None, sample_filter: SearchFilter = None ) -> dict: """ Parameters @@ -1419,7 +1425,7 @@ def list_samples( return self._do_simple_list("samples", pagination, sample_filter) def list_top_level_containers( - self, pagination: Pagination = Pagination(), sample_filter: SearchFilter = None + self, pagination: Pagination = None, sample_filter: SearchFilter = None ) -> dict: """ Parameters @@ -1433,7 +1439,7 @@ def list_top_level_containers( return self._do_simple_list("containers", pagination, sample_filter) def list_subsamples( - self, pagination: Pagination = Pagination(), sample_filter: SearchFilter = None + self, pagination: Pagination = None, sample_filter: SearchFilter = None ) -> dict: """ Parameters @@ -1447,6 +1453,8 @@ def list_subsamples( return self._do_simple_list("subSamples", pagination, sample_filter) def _do_simple_list(self, endpoint, pagination, sample_filter): + if pagination is None: + pagination = Pagination() if sample_filter is not None: pagination.data.update(sample_filter.data) return self.retrieve_api_results( @@ -1456,7 +1464,7 @@ def _do_simple_list(self, endpoint, pagination, sample_filter): ) def stream_samples( - self, pagination: Pagination = Pagination(), sample_filter: SearchFilter = None + self, pagination: Pagination = None, sample_filter: SearchFilter = None ): """ Streams all samples. Pagination argument sets batch size and ordering. @@ -1468,12 +1476,14 @@ def stream_samples( ------ item : One Sample at a time """ + if pagination is None: + pagination = Pagination() if sample_filter is not None: pagination.data.update(sample_filter.data) return self._stream("samples", pagination) def stream_top_level_containers( - self, pagination: Pagination = Pagination(), sample_filter: SearchFilter = None + self, pagination: Pagination = None, sample_filter: SearchFilter = None ): """ Streams all containers. Pagination argument sets batch size and ordering. @@ -1485,6 +1495,8 @@ def stream_top_level_containers( ------ item : One Container at a time """ + if pagination is None: + pagination = Pagination() if sample_filter is not None: pagination.data.update(sample_filter.data) return self._stream("containers", pagination) @@ -1548,9 +1560,9 @@ def delete_sample(self, sample_id: Union[int, str]): def create_instrument( self, name: str, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, instrument_template_id=None, fields=None, attachments=None, @@ -1600,7 +1612,7 @@ def get_instrument_by_id(self, instrument_id: Union[str, int]) -> dict: return self.retrieve_api_results(f"/instruments/{i_id.as_id()}") def list_instruments( - self, pagination: Pagination = Pagination(), search_filter: SearchFilter = None + self, pagination: Pagination = None, search_filter: SearchFilter = None ) -> dict: """ Parameters @@ -1961,7 +1973,7 @@ def duplicate( return rc def search( - self, query: str, pagination=Pagination(), result_type: ResultType = None + self, query: str, pagination=None, result_type: ResultType = None ) -> dict: """ Searches by a query, optionally paginated or restricted to a particular type (container, @@ -1981,6 +1993,8 @@ def search( Search result summary and first page of results. """ + if pagination is None: + pagination = Pagination() params = {"query": query} params.update(pagination.data) if result_type is not None: @@ -2369,12 +2383,12 @@ def delete_locations_from_image_container( def create_list_container( self, name: str, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, can_store_containers: bool = True, can_store_samples: bool = True, - location: TargetLocation = TopLevelTargetLocation(), + location: TargetLocation = None, ) -> dict: """ Creates a single List Container, either 'top-level', on the Workbench, @@ -2405,12 +2419,12 @@ def create_grid_container( name: str, row_count: int, column_count: int, - tags: List[Tag] = [], + tags: List[Tag] = None, description: Optional[str] = None, - extra_fields: Optional[Sequence] = [], + extra_fields: Optional[Sequence] = None, can_store_containers: bool = True, can_store_samples: bool = True, - location: TargetLocation = TopLevelTargetLocation(), + location: TargetLocation = None, ) -> dict: """ Parameters @@ -2838,7 +2852,7 @@ def get_sample_template_icon( ) def list_sample_templates( - self, pagination: Pagination = Pagination(), search_filter: SearchFilter = None + self, pagination: Pagination = None, search_filter: SearchFilter = None ): """ Paginated listing of SampleTemplates, optionally filtering by username (owner) or deletion status @@ -2998,7 +3012,7 @@ def get_instrument_template_icon( ) def list_instrument_templates( - self, pagination: Pagination = Pagination(), search_filter: SearchFilter = None + self, pagination: Pagination = None, search_filter: SearchFilter = None ): """ Paginated listing of InstrumentTemplates, optionally filtering by username From f863a300c1302e0700e56dfcbc19ef63efa26396 Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:12:06 +0100 Subject: [PATCH 04/21] fix(inv)!: Sample.wherep() returns a list as documented wherep() is annotated and documented as returning a list of breadcrumb strings but returned the de-duplicating set directly. BREAKING CHANGE: callers relying on set behaviour (.add(), set operators, == {...}) must be updated. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 5 +++++ rspace_client/inv/inv.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af76d04..52290c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,11 @@ All notable changes to this project will be documented in this file `typesToInclude=[]`) in several `inv` and `eln` methods, which could leak state across calls made without an explicit argument. +- Fixed `Sample.wherep()` returning a `set` instead of the documented `list`. + + Potentially breaking: code that calls `.add()` on the result, uses set + operators on it, or compares it with `== {...}` needs updating. + - Gallery upload routing and section-mismatch handling (PR #56): clearer `GallerySectionMismatch` exception, optional `on_mismatch="reroute"` policy to auto-reroute uploads into the server-chosen section, `upload()` now diff --git a/rspace_client/inv/inv.py b/rspace_client/inv/inv.py index eae0c3a..f768d96 100644 --- a/rspace_client/inv/inv.py +++ b/rspace_client/inv/inv.py @@ -92,7 +92,7 @@ def wherep(self) -> List[str]: for ss in self.data["subSamples"]: b_crumb = " -> ".join([x["name"] for x in ss["parentContainers"]][::-1]) bcumbs.add(b_crumb) - return bcumbs + return list(bcumbs) def __repr__(self): return f"Sample: id = {self.data['id']}, name = {self.data['name']}, creationDate = {self.data['created']}" From 598073d520def5546b1183da897d8b7a2f7cc251 Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:12:16 +0100 Subject: [PATCH 05/21] fix(inv)!: GridContainerPost sends cType GRID GridContainerPost set cType to "LIST", so grid containers were posted with the list container type. BREAKING CHANGE: grid containers are now sent with cType "GRID". Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 5 +++++ rspace_client/inv/inv.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52290c7..98d06e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,11 @@ All notable changes to this project will be documented in this file Potentially breaking: code that calls `.add()` on the result, uses set operators on it, or compares it with `== {...}` needs updating. +- Fixed `GridContainerPost` sending `cType: "LIST"` instead of `"GRID"`. + + Potentially breaking: grid containers created via `GridContainerPost` are + now sent to the server with `cType: "GRID"`. + - Gallery upload routing and section-mismatch handling (PR #56): clearer `GallerySectionMismatch` exception, optional `on_mismatch="reroute"` policy to auto-reroute uploads into the server-chosen section, `upload()` now diff --git a/rspace_client/inv/inv.py b/rspace_client/inv/inv.py index f768d96..3081ede 100644 --- a/rspace_client/inv/inv.py +++ b/rspace_client/inv/inv.py @@ -1287,7 +1287,7 @@ def __init__( can_store_samples, location, ) - self.data["cType"] = "LIST" + self.data["cType"] = "GRID" self.data["gridLayout"] = { "columnsNumber": column_count, "rowsNumber": row_count, From 6cfdc5935e7a58efd9c9c2e084e7286ac848100b Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:12:26 +0100 Subject: [PATCH 06/21] fix(inv): ListContainer.is_list() missing self is_list() was declared without self, so calling it on an instance raised TypeError. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 +++ rspace_client/inv/inv.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98d06e8..2f2ea2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,6 +91,9 @@ All notable changes to this project will be documented in this file Potentially breaking: grid containers created via `GridContainerPost` are now sent to the server with `cType: "GRID"`. +- Fixed `ListContainer.is_list()` raising `TypeError` when called on an + instance (missing `self`). + - Gallery upload routing and section-mismatch handling (PR #56): clearer `GallerySectionMismatch` exception, optional `on_mismatch="reroute"` policy to auto-reroute uploads into the server-chosen section, `upload()` now diff --git a/rspace_client/inv/inv.py b/rspace_client/inv/inv.py index 3081ede..631ec82 100644 --- a/rspace_client/inv/inv.py +++ b/rspace_client/inv/inv.py @@ -388,7 +388,7 @@ def __init__(self, list_container: dict): super().__init__(list_container) self._validate_type(list_container, "LIST") - def is_list() -> bool: + def is_list(self) -> bool: return True def capacity(self) -> int: From f581c5bfa70e6962c5ff3f3df8c3c33dbd109933 Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:12:38 +0100 Subject: [PATCH 07/21] fix: URL validator error message and bare except The TypeError message lacked its f prefix, so it printed the literal "{type(item)} {item!r}" placeholders, and the bare except swallowed any exception (including KeyboardInterrupt). Catch the ValueError that urlparse raises and chain it. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 4 ++++ rspace_client/validators.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f2ea2d..e89855c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,10 @@ All notable changes to this project will be documented in this file - Fixed `ListContainer.is_list()` raising `TypeError` when called on an instance (missing `self`). +- Fixed the `URL` field validator's error message, which was missing its + f-string prefix and printed the literal placeholders; it also no longer + catches unrelated exceptions with a bare `except`. + - Gallery upload routing and section-mismatch handling (PR #56): clearer `GallerySectionMismatch` exception, optional `on_mismatch="reroute"` policy to auto-reroute uploads into the server-chosen section, `upload()` now diff --git a/rspace_client/validators.py b/rspace_client/validators.py index d95e902..2d9c8d1 100644 --- a/rspace_client/validators.py +++ b/rspace_client/validators.py @@ -39,8 +39,8 @@ def validate(self, item): if isinstance(item, str): try: urlparse(item) - except: - raise TypeError("{type(item)} {item!r} could not be parsed") + except ValueError as e: + raise TypeError(f"{type(item)} {item!r} could not be parsed") from e else: self.raise_type_error(item, "a URI string") From 83232634cb42dbe11476f3d95aa6bf8395a4ff27 Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:12:48 +0100 Subject: [PATCH 08/21] fix(eln): include server error detail when an export job fails The "+ self._get_formated_error_message(...)" continuation sat on its own line without parentheses, so it was evaluated as a separate, discarded expression and msg was only "Export job failed: ". Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 +++ rspace_client/eln/eln.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e89855c..ff18f63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,9 @@ All notable changes to this project will be documented in this file f-string prefix and printed the literal placeholders; it also no longer catches unrelated exceptions with a bare `except`. +- Fixed the error raised when an ELN export job fails: the server's error + detail was dropped, leaving only "Export job failed: ". + - Gallery upload routing and section-mismatch handling (PR #56): clearer `GallerySectionMismatch` exception, optional `on_mismatch="reroute"` policy to auto-reroute uploads into the server-chosen section, `upload()` now diff --git a/rspace_client/eln/eln.py b/rspace_client/eln/eln.py index e48cd61..3249b01 100644 --- a/rspace_client/eln/eln.py +++ b/rspace_client/eln/eln.py @@ -548,8 +548,9 @@ def _wait_till_complete_then_download( self.download_link_to_file(download_url, file_path) return file_path elif status_response["status"] == "FAILED": - msg = "Export job failed: " - + self._get_formated_error_message(status_response["result"]) + msg = "Export job failed: " + self._get_formated_error_message( + status_response["result"] + ) self._log_progress(progress_log, msg) raise ClientBase.ApiError(msg) elif status_response["status"] == "ABANDONED": From 8c991e47cde69a88a9e993e0cb917a3f970878e6 Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Mon, 28 Sep 2026 14:13:21 +0100 Subject: [PATCH 09/21] style: apply ruff format and ruff check --fix Purely mechanical output of `ruff check --fix` followed by `ruff format` over rspace_client, examples and .github/scripts. No manual edits. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/warmup_sysadmin.py | 1 + examples/create_document.py | 2 +- examples/create_folder_and_notebook.py | 3 +- examples/create_form.py | 1 - examples/create_instrument.py | 4 +- examples/create_sample.py | 10 +- examples/download_attachments.py | 4 +- examples/export_records.py | 3 +- examples/freezer.py | 22 +- examples/get_activity.py | 10 +- examples/import_directory.py | 4 +- examples/import_inventory_csv.py | 6 +- examples/import_word_file.py | 4 +- examples/inventory_link_field.py | 2 +- examples/paging_through_results.py | 1 - examples/paging_through_users.py | 27 +- examples/search_documents_by_form.py | 4 +- examples/share_documents.py | 5 +- examples/status.py | 1 - examples/tree_upload.py | 113 +-- rspace_client/__init__.py | 9 +- rspace_client/client_base.py | 64 +- rspace_client/eln/advanced_query_builder.py | 2 +- rspace_client/eln/dcs.py | 2 +- rspace_client/eln/eln.py | 93 ++- rspace_client/eln/field_content.py | 4 +- rspace_client/eln/filetree_importer.py | 17 +- rspace_client/eln/fs.py | 189 +++-- rspace_client/exceptions.py | 5 +- rspace_client/fs/__init__.py | 5 +- rspace_client/fs/base.py | 289 +++++-- rspace_client/fs/gallery.py | 280 +++++-- rspace_client/fs/inventory.py | 121 ++- rspace_client/fs/paths.py | 25 +- rspace_client/fs/rspace.py | 186 +++-- rspace_client/fs/tree.py | 67 +- rspace_client/fs/workspace.py | 238 ++++-- rspace_client/fs_utils.py | 11 +- rspace_client/inv/attachment_fs.py | 114 +-- rspace_client/inv/inv.py | 336 ++++---- rspace_client/inv/quantity_unit.py | 1 - rspace_client/inv/sample_builder2.py | 7 +- rspace_client/inv/template_builder.py | 20 +- rspace_client/tests/base_test.py | 12 +- rspace_client/tests/client_methods_test.py | 33 +- rspace_client/tests/eln_fs_test.py | 482 ++++++----- rspace_client/tests/elnapi_test.py | 39 +- rspace_client/tests/exceptions_test.py | 20 +- rspace_client/tests/field_content_test.py | 5 +- rspace_client/tests/fs_base_test.py | 418 +++++++--- rspace_client/tests/fs_integration_test.py | 199 +++-- rspace_client/tests/fs_inventory_tree_test.py | 167 ++-- rspace_client/tests/fs_name_paths_test.py | 207 +++-- rspace_client/tests/fs_review_test.py | 58 +- rspace_client/tests/fs_rspace_test.py | 348 +++++--- rspace_client/tests/fs_workspace_test.py | 133 ++- .../tests/galaxy_plugin_contract_test.py | 42 +- rspace_client/tests/grid_container_test.py | 9 +- rspace_client/tests/grid_placement_test.py | 3 +- rspace_client/tests/http_layer_test.py | 104 ++- rspace_client/tests/id_test.py | 3 +- rspace_client/tests/inv_attachment_fs_test.py | 146 ++-- rspace_client/tests/inv_lom_test.py | 4 +- rspace_client/tests/invapi_test.py | 73 +- rspace_client/tests/mock_rspace/fixtures.py | 773 +++++++++++++----- rspace_client/tests/mock_rspace/server.py | 137 +++- rspace_client/tests/mock_server_case.py | 7 +- rspace_client/tests/quantity_unit_test.py | 5 +- rspace_client/tests/sample_post_test.py | 1 - rspace_client/tests/temperature_test.py | 3 +- rspace_client/tests/template_builder_test.py | 14 +- rspace_client/tests/validator_test.py | 5 +- rspace_client/utils.py | 1 + rspace_client/validators.py | 2 +- 74 files changed, 3878 insertions(+), 1887 deletions(-) diff --git a/.github/scripts/warmup_sysadmin.py b/.github/scripts/warmup_sysadmin.py index 610603a..9533344 100644 --- a/.github/scripts/warmup_sysadmin.py +++ b/.github/scripts/warmup_sysadmin.py @@ -12,6 +12,7 @@ SYSADMIN_USERNAME = "sysadmin1" SYSADMIN_PASSWORD = "sysWisc23!" + # A user account that is only ever authenticated via its API key (never a real # login) has its home folder created lazily on first write - a code path that # throws on that first attempt (though it leaves the account usable afterward). diff --git a/examples/create_document.py b/examples/create_document.py index 97b533f..28bb4dc 100755 --- a/examples/create_document.py +++ b/examples/create_document.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 -from __future__ import print_function import os + import rspace_client # Parse command line parameters diff --git a/examples/create_folder_and_notebook.py b/examples/create_folder_and_notebook.py index f14a22f..bcc3c90 100755 --- a/examples/create_folder_and_notebook.py +++ b/examples/create_folder_and_notebook.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import rspace_client @@ -37,7 +36,7 @@ def print_forms(response): ) print("Deleting folder") response = client.delete_folder(response["globalId"]) -print("deleted folder {}".format(folder_id)) +print(f"deleted folder {folder_id}") print("Listing all contents of home folder") response = client.list_folder_tree() diff --git a/examples/create_form.py b/examples/create_form.py index df1fe22..8566858 100755 --- a/examples/create_form.py +++ b/examples/create_form.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import rspace_client diff --git a/examples/create_instrument.py b/examples/create_instrument.py index 60b58d2..f158af6 100644 --- a/examples/create_instrument.py +++ b/examples/create_instrument.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- """ Creates an Instrument Template, and an Instrument based on it. """ + import rspace_client -from rspace_client.inv import template_builder, sample_builder2 +from rspace_client.inv import sample_builder2, template_builder inv_api = rspace_client.utils.createInventoryClient() diff --git a/examples/create_sample.py b/examples/create_sample.py index 1f1ebed..4456de2 100755 --- a/examples/create_sample.py +++ b/examples/create_sample.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- """ Created on Mon Oct 18 20:23:16 2021 @author: richard """ + import rspace_client from rspace_client.inv.inv import Barcode, BarcodeFormat @@ -24,13 +24,13 @@ Barcode( data="https://researchspace.com", format=BarcodeFormat.BARCODE, - description="ResearchSpace" + description="ResearchSpace", ), Barcode( data="https://www.wikipedia.org/", format=BarcodeFormat.BARCODE, - description="Wikipedia" - ) + description="Wikipedia", + ), ] # Convert to dicts @@ -41,4 +41,4 @@ f"Sample with id {sample_with_barcode['id']} was created with " f"{len(sample_with_barcode['subSamples'])} subsamples and " f"{len(sample_with_barcode.get('barcodes', []))} barcodes" -) \ No newline at end of file +) diff --git a/examples/download_attachments.py b/examples/download_attachments.py index 729fa0a..387741b 100755 --- a/examples/download_attachments.py +++ b/examples/download_attachments.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -from __future__ import print_function -import rspace_client import sys +import rspace_client + # Parse command line parameters # Parse command line parameters client = rspace_client.utils.createELNClient() diff --git a/examples/export_records.py b/examples/export_records.py index 6b12f1f..6ff2d2e 100755 --- a/examples/export_records.py +++ b/examples/export_records.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import sys + import rspace_client # Parse command line parameters @@ -28,4 +29,4 @@ export_format="xml", item_ids=[item_id], ) -print("Done- downloaded to {}".format(download_file)) +print(f"Done- downloaded to {download_file}") diff --git a/examples/freezer.py b/examples/freezer.py index 1a0a1b4..b305eeb 100755 --- a/examples/freezer.py +++ b/examples/freezer.py @@ -1,26 +1,25 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- """ Created on Fri Jan 28 20:04:29 2022 @author: richardadams """ -#%% -import sys, time +# %% +import sys +import time + import rspace_client cli = rspace_client.utils.createInventoryClient() from rspace_client.inv.inv import ( - GridContainer, - InventoryClient, - ByRow, ByColumn, - SamplePost, + ByRow, GridContainerPost, + SamplePost, ) -#%% +# %% class FreezerCreator: @@ -103,7 +102,7 @@ def add_to_parent_tier(self, parents, parents_per_gp, items_per_parent, items): self.cli.add_items_to_grid_container(parents[j], br) -#%% +# %% ### Configure the size of the freezer here ( or ask for input) print( "Please enter the number of shelves, racks, trays and boxes to create. Boxes are 12 x 8" @@ -132,7 +131,7 @@ def add_to_parent_tier(self, parents, parents_per_gp, items_per_parent, items): freezer = freezerFactory.create_freezer(freezer_name) -#%% +# %% samples_created = 0 total_samples_to_create = len(freezer["boxes"]) * box_cols print(f"Creating {total_samples_to_create} samples...", file=sys.stderr) @@ -144,7 +143,8 @@ def add_to_parent_tier(self, parents, parents_per_gp, items_per_parent, items): col = 1 samples_created = samples_created + box_cols print( - f" created {box_cols} samples / {total_samples_to_create}", file=sys.stderr, + f" created {box_cols} samples / {total_samples_to_create}", + file=sys.stderr, ) ## we can move 12 samples at a time diff --git a/examples/get_activity.py b/examples/get_activity.py index 70ab20a..cbca048 100755 --- a/examples/get_activity.py +++ b/examples/get_activity.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -from __future__ import print_function -import rspace_client import sys from datetime import date, timedelta +import rspace_client + # Parse command line parameters # Parse command line parameters client = rspace_client.utils.createELNClient() @@ -16,9 +16,7 @@ ) print( - "All activity related to documents being created or modified from {} to now:".format( - date_from.isoformat() - ) + f"All activity related to documents being created or modified from {date_from.isoformat()} to now:" ) for activity in response["activities"]: print(activity) @@ -28,6 +26,6 @@ document_id = sys.stdin.readline().strip() response = client.get_activity(global_id=document_id) -print("Activities for document {}:".format(document_id)) +print(f"Activities for document {document_id}:") for activity in response["activities"]: print(activity) diff --git a/examples/import_directory.py b/examples/import_directory.py index a8ad25f..8b178fa 100755 --- a/examples/import_directory.py +++ b/examples/import_directory.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 -import sys, pprint +import pprint +import sys + import rspace_client from rspace_client.eln import filetree_importer from rspace_client.eln.dcs import DocumentCreationStrategy as DCS diff --git a/examples/import_inventory_csv.py b/examples/import_inventory_csv.py index cf75e41..54c3cf8 100644 --- a/examples/import_inventory_csv.py +++ b/examples/import_inventory_csv.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- """ Imports samples, subsamples and containers into Inventory from CSV files. @@ -18,6 +17,7 @@ "parent container import id", "parent container global id", "parent sample import id", "parent sample global id". """ + import io import rspace_client @@ -56,9 +56,7 @@ def csv_stream(content: str) -> io.BytesIO: # Import subsamples into a pre-existing sample, referencing it by Global Id sample = inv_api.create_sample("Sample for CSV subsamples") subsamples_csv = ( - "Name,Parent\n" - f"Aliquot 1,{sample['globalId']}\n" - f"Aliquot 2,{sample['globalId']}" + f"Name,Parent\nAliquot 1,{sample['globalId']}\nAliquot 2,{sample['globalId']}" ) subsample_result = inv_api.import_subsamples_csv( csv_stream(subsamples_csv), diff --git a/examples/import_word_file.py b/examples/import_word_file.py index 6f14019..77ded21 100755 --- a/examples/import_word_file.py +++ b/examples/import_word_file.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -from __future__ import print_function -import rspace_client import os +import rspace_client + # Parse command line parameters client = rspace_client.utils.createELNClient() folder_id = client.create_folder("Word Import Folder")["id"] diff --git a/examples/inventory_link_field.py b/examples/inventory_link_field.py index c196c02..4997475 100644 --- a/examples/inventory_link_field.py +++ b/examples/inventory_link_field.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- """ Demonstrates Inventory "Link" extra-fields: typed, versioned links between inventory items (and to ELN records). @@ -7,6 +6,7 @@ Requires an RSpace server that supports Inventory Link fields (server PR #803 / RSDEV-1131). """ + import rspace_client from rspace_client.inv.inv import ExtraField, RelationType from rspace_client.inv.template_builder import TemplateBuilder diff --git a/examples/paging_through_results.py b/examples/paging_through_results.py index 968f1ac..03dfa0c 100755 --- a/examples/paging_through_results.py +++ b/examples/paging_through_results.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import rspace_client diff --git a/examples/paging_through_users.py b/examples/paging_through_users.py index c8595e5..e2f248a 100755 --- a/examples/paging_through_users.py +++ b/examples/paging_through_users.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -from __future__ import print_function -import rspace_client -import time import re +import time + +import rspace_client def print_users(response): @@ -23,28 +23,29 @@ def delete_users(): if re.match("^FAILED", line): failedId = line.split(sep=" ")[1] failedIds.append(failedId.rstrip("\r\n")) - print("Will ignore these userids that are known to fail: {}".format(failedIds)) + print(f"Will ignore these userids that are known to fail: {failedIds}") - with open("toDelete-8087.txt", "r") as toDelete, open( - "log-delete.txt", "a+" - ) as deletelog: + with ( + open("toDelete-8087.txt") as toDelete, + open("log-delete.txt", "a+") as deletelog, + ): lines = toDelete.readlines() for line in lines: userId = line.rstrip("\r\n") if userId in failedIds: - print("Id {} has previously failed, skipping".format(userId)) + print(f"Id {userId} has previously failed, skipping") continue - print("Deleting user {}".format(userId)) + print(f"Deleting user {userId}") try: resp = client.deleteTempUser(userId) if resp.status_code == 204: - deletelog.write("Deleted {0}\n".format(userId)) + deletelog.write(f"Deleted {userId}\n") deletelog.flush() - print("Deleted {}\n".format(userId)) + print(f"Deleted {userId}\n") except: - deletelog.write("FAILED {0}\n".format(userId)) + deletelog.write(f"FAILED {userId}\n") deletelog.flush() - print("FAILED {}\n".format(userId)) + print(f"FAILED {userId}\n") time.sleep(1) print("Finished") deletelog.close() diff --git a/examples/search_documents_by_form.py b/examples/search_documents_by_form.py index e20bb1a..17fa121 100755 --- a/examples/search_documents_by_form.py +++ b/examples/search_documents_by_form.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 -from __future__ import print_function import json -import rspace_client import sys +import rspace_client + client = rspace_client.utils.createELNClient() print("Form ID to search for (for example, FM123)?") diff --git a/examples/share_documents.py b/examples/share_documents.py index ec0658c..ffd0489 100755 --- a/examples/share_documents.py +++ b/examples/share_documents.py @@ -4,7 +4,6 @@ so that you can share items """ -from __future__ import print_function import rspace_client @@ -56,9 +55,7 @@ def printSharedItemNames(response): print( """You can see the shared item in RSpace webapp\ in Shared->Lab Groups->{}_SHARED - """.format( - groups[0]["name"] - ) + """.format(groups[0]["name"]) ) print("Listing shared items") diff --git a/examples/status.py b/examples/status.py index 25090b9..bfbe7d7 100755 --- a/examples/status.py +++ b/examples/status.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import rspace_client diff --git a/examples/tree_upload.py b/examples/tree_upload.py index 8ef3bf5..2f792bf 100755 --- a/examples/tree_upload.py +++ b/examples/tree_upload.py @@ -1,11 +1,12 @@ -import os -import rspace_client import argparse -import xml.etree.ElementTree as ET +import os +import re import tempfile -import zipfile import time -import re +import xml.etree.ElementTree as ET +import zipfile + +import rspace_client """ This code imports to RSpace an eCAT export that has already had its .odt files converted to .docx files. @@ -107,11 +108,7 @@ def log_api_success(workspace_or_shared, rspaceId, localPath="none"): ) with open(log_file_path, "a+") as folder_log: - folder_log.write( - "{ftype}|{rspace_id}|{localPath}\n".format( - ftype=workspace_or_shared, rspace_id=rspaceId, localPath=localPath - ) - ) + folder_log.write(f"{workspace_or_shared}|{rspaceId}|{localPath}\n") ## writes header used to identify active log file @@ -120,7 +117,7 @@ def initialiseLogFile(): if ResumeMode: raise ValueError("Resume mode must not initialise new log file") with open(log_file_path, "a+") as folder_log: - folder_log.write("{}\n".format(LOG_FILE_HEADER)) + folder_log.write(f"{LOG_FILE_HEADER}\n") ## parses log file into array of triples (type, RSpaceId, localPath | none) @@ -133,7 +130,7 @@ def parse_log_file(): if not os.path.exists(log_file_path): raise ValueError("Log path {} does not exist".format("log_file_path")) logFileData = {} - with open(log_file_path, "r") as folder_log: + with open(log_file_path) as folder_log: lines = folder_log.readlines() ## quick check on contents, is this a likely log file?? if len(lines) == 0: @@ -201,7 +198,7 @@ def api_call(callname, apiCall): else: returnval = apiCall() finish = time.time() - print("API call {} took {:.1f} seconds".format(callname, finish - start)) + print(f"API call {callname} took {finish - start:.1f} seconds") if not api_simulate: time.sleep(0.5) return returnval @@ -215,11 +212,7 @@ def create_dir_and_ancestors(fdict, directory, galleryType): fdict, parent, galleryType ) # recurse, on return ancestor will exist # create folder for dir in parent and store id in dictionary - print( - "creating folder for {child} in {par} ({parentid})".format( - child=directory, par=parent, parentid=fdict[parent] - ) - ) + print(f"creating folder for {directory} in {parent} ({fdict[parent]})") response = api_call( "create_folder", lambda: client.create_folder( @@ -231,12 +224,8 @@ def create_dir_and_ancestors(fdict, directory, galleryType): def share_document(docId, groupId, folderId, origFilePath="None"): - if not origFilePath in shared_sdocs: - print( - "Sharing document {} with group {} into folder {}".format( - docId, groupId, folderId - ) - ) + if origFilePath not in shared_sdocs: + print(f"Sharing document {docId} with group {groupId} into folder {folderId}") shared = api_call( "shareDocuments", lambda: client.shareDocuments([docId], groupId, sharedFolderId=folderId), @@ -307,7 +296,7 @@ def _populateFromLog(itemType, folderDict): if ResumeMode == True: sharingGroupId = int(toResume[1][1]) - print("Resuming with group {}".format(sharingGroupId)) + print(f"Resuming with group {sharingGroupId}") elif not api_simulate: groups = client.get_groups() if len(groups) == 0: @@ -342,9 +331,7 @@ def _populateFromLog(itemType, folderDict): for dirName, subdirList, fileList in os.walk(args.srcDir): print("Found directory: %s" % dirName) print( - "Processed (folders/instances): Docs {}/{}; Images {}/{}; Files {}/{}".format( - len(wfolders), docCount, len(gifolders), imgCount, len(gdfolders), fileCount - ) + f"Processed (folders/instances): Docs {len(wfolders)}/{docCount}; Images {len(gifolders)}/{imgCount}; Files {len(gdfolders)}/{fileCount}" ) # always create w and s folders, only creat gd and gi as needed # "images" folders specially treated @@ -352,7 +339,7 @@ def _populateFromLog(itemType, folderDict): if os.path.basename(dirName) != "images": dirname = os.path.basename(dirName) parname = os.path.dirname(dirName) - if not dirName in wfolders: # folders does not exist yet + if dirName not in wfolders: # folders does not exist yet response = api_call( "create_folder", lambda: client.create_folder( @@ -361,16 +348,11 @@ def _populateFromLog(itemType, folderDict): ) wfolders[dirName] = response["id"] print( - "Created workspacefolder {dir} ({dirnum}) in {par} ({parnum})".format( - dir=dirname, - dirnum=wfolders[dirName], - par=os.path.basename(parname), - parnum=wfolders[parname], - ) + f"Created workspacefolder {dirname} ({wfolders[dirName]}) in {os.path.basename(parname)} ({wfolders[parname]})" ) log_api_success("FLW", response["id"], dirName) - if not dirName in sfolders: # folder does not exist yet + if dirName not in sfolders: # folder does not exist yet response = api_call( "create_folder", lambda: client.create_folder( @@ -379,12 +361,7 @@ def _populateFromLog(itemType, folderDict): ) sfolders[dirName] = response["id"] print( - "Created shared folder {dir} ({dirnum}) in {par} ({parnum})".format( - dir=dirname, - dirnum=sfolders[dirName], - par=os.path.basename(parname), - parnum=sfolders[parname], - ) + f"Created shared folder {dirname} ({sfolders[dirName]}) in {os.path.basename(parname)} ({sfolders[parname]})" ) log_api_success("FLS", response["id"], dirName) for filename in fileList: @@ -406,7 +383,7 @@ def _populateFromLog(itemType, folderDict): with open(docxname, "rb") as f: # if not already created docId = -1 - if not docxname in sdocs: + if docxname not in sdocs: new_document = api_call( "import_word", lambda: client.import_word( @@ -428,10 +405,10 @@ def _populateFromLog(itemType, folderDict): else: docId = sdocs[docxname] print( - "{} was ready uploaded".format(sdocs[docxname]) + f"{sdocs[docxname]} was ready uploaded" ) ## resume mode - print("sharing into {}".format(sfolders[dirName])) + print(f"sharing into {sfolders[dirName]}") share_document( docId, sharingGroupId, sfolders[dirName], docxname ) @@ -446,7 +423,7 @@ def _populateFromLog(itemType, folderDict): print("uploading %s to Gallery Docs" % galleryItemPath) with open(galleryItemPath, "rb") as f: new_file_id = -1 - if not galleryItemPath in glfiles: + if galleryItemPath not in glfiles: new_file = api_call( "upload_file", lambda: client.upload_file( @@ -464,16 +441,14 @@ def _populateFromLog(itemType, folderDict): fileCount += 1 else: new_file_id = glfiles[galleryItemPath] - print("File {} was already uploaded".format(galleryItemPath)) + print(f"File {galleryItemPath} was already uploaded") if new_file_id == -1: print("ERROR - file ID not determined") exit # create a basic document with the same name and a link to the uploaded gallery file. - if not new_file_id in sdocs: + if new_file_id not in sdocs: print( - "creating basic document, should be in {}".format( - wfolders[dirName] - ) + f"creating basic document, should be in {wfolders[dirName]}" ) new_document = api_call( "create_document", @@ -482,9 +457,7 @@ def _populateFromLog(itemType, folderDict): parent_folder_id=wfolders[dirName], fields=[ { - "content": "Link to the gallery file: ".format( - new_file_id - ) + "content": f"Link to the gallery file: " } ], ), @@ -499,7 +472,7 @@ def _populateFromLog(itemType, folderDict): ) ) - print("sharing into {}".format(sfolders[dirName])) + print(f"sharing into {sfolders[dirName]}") share_document( new_document["id"], sharingGroupId, @@ -507,11 +480,7 @@ def _populateFromLog(itemType, folderDict): new_file_id, ) else: - print( - "Document linking to {} was already created".format( - new_file_id - ) - ) + print(f"Document linking to {new_file_id} was already created") else: # images folder ## TODO complete resume code @@ -524,7 +493,7 @@ def _populateFromLog(itemType, folderDict): # upload filename to gifolders[parentDir] print("uploading %s to GalleryImages" % filename) galleryItemPath = os.path.join(dirName, filename) - if not galleryItemPath in glfiles: + if galleryItemPath not in glfiles: with open(galleryItemPath, "rb") as f: new_file = api_call( "upload_file", @@ -539,20 +508,16 @@ def _populateFromLog(itemType, folderDict): log_api_success("GL", new_file["id"], galleryItemPath) glfiles[galleryItemPath] = new_file["id"] else: - print("Image '{}' was already uploaded".format(galleryItemPath)) + print(f"Image '{galleryItemPath}' was already uploaded") # create imageDoc = "eCAT gallery images" basic document in wfolders[parentDir] print( - "creating basic document for link to gallery images folder, should be in {}".format( - wfolders[parentDir] - ) + f"creating basic document for link to gallery images folder, should be in {wfolders[parentDir]}" ) docname = "eCAT gallery images for documents in " + os.path.basename(parentDir) - folder_link = "Gallery Images in Documents in this folder:\n\n".format( - gifolders[parentDir] - ) + folder_link = f"Gallery Images in Documents in this folder:\n\n" new_document_id = -1 - if not dirName in sdocs: + if dirName not in sdocs: new_document = api_call( "create_document", lambda: client.create_document( @@ -565,20 +530,16 @@ def _populateFromLog(itemType, folderDict): log_api_success("SD", new_document_id, dirName) sdocs[dirName] = new_document_id print( - "New document was successfully created with global ID {}".format( - new_document_id - ) + f"New document was successfully created with global ID {new_document_id}" ) else: new_document_id = sdocs[dirName] print("Folder link doc was already created") - print("sharing into {}".format(sfolders[parentDir])) + print(f"sharing into {sfolders[parentDir]}") share_document(new_document_id, sharingGroupId, sfolders[parentDir], dirName) print("Done!") print( - "Processed (folders/instances): Docs {}/{}; Images {}/{}; Files {}/{}".format( - len(wfolders), docCount, len(gifolders), imgCount, len(gdfolders), fileCount - ) + f"Processed (folders/instances): Docs {len(wfolders)}/{docCount}; Images {len(gifolders)}/{imgCount}; Files {len(gdfolders)}/{fileCount}" ) ## TODO check resume of shared docs and conditionals. diff --git a/rspace_client/__init__.py b/rspace_client/__init__.py index 3dc25c7..440a88a 100644 --- a/rspace_client/__init__.py +++ b/rspace_client/__init__.py @@ -1,6 +1,7 @@ """ - RSpace API client for interacting with RSpace ELN and Inventory +RSpace API client for interacting with RSpace ELN and Inventory """ + from importlib.metadata import PackageNotFoundError, version try: @@ -8,10 +9,8 @@ except PackageNotFoundError: __version__ = "unknown" -from .eln.eln import ELNClient -from .inv.inv import InventoryClient from .eln.advanced_query_builder import AdvancedQueryBuilder -from .utils import createELNClient +from .eln.eln import ELNClient from .eln.field_content import FieldContent from .exceptions import ( ApiError, @@ -20,6 +19,8 @@ RSpaceConnectionError, RSpaceError, ) +from .inv.inv import InventoryClient +from .utils import createELNClient __all__ = [ "ELNClient", diff --git a/rspace_client/client_base.py b/rspace_client/client_base.py index 8a12bc4..eea7b93 100644 --- a/rspace_client/client_base.py +++ b/rspace_client/client_base.py @@ -1,11 +1,9 @@ import inspect import logging import re -import requests from urllib.parse import urlparse, urlunparse -from typing import Optional - +import requests from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry @@ -14,7 +12,6 @@ AuthenticationError, NoSuchLinkRel, RSpaceConnectionError, - RSpaceError, ) logger = logging.getLogger("rspace_client") @@ -112,7 +109,7 @@ def __init__( :param backoff_factor: multiplier for exponential backoff between retries; the Retry-After header is honored when the server sends it """ - self.rspace_url = rspace_url.rstrip('/') + self.rspace_url = rspace_url.rstrip("/") self.api_key = api_key self.timeout = timeout self._session = self._build_session(max_retries, backoff_factor) @@ -169,7 +166,9 @@ def _rebase_url(self, url): ours = urlparse(self.rspace_url) api_at = link.path.find("/api/") path = link.path if api_at < 0 else ours.path.rstrip("/") + link.path[api_at:] - return urlunparse((ours.scheme, ours.netloc, path, link.params, link.query, link.fragment)) + return urlunparse( + (ours.scheme, ours.netloc, path, link.params, link.query, link.fragment) + ) def _get_headers(self, content_type="application/json"): headers = {"apiKey": self.api_key} @@ -189,7 +188,7 @@ def _get_numeric_record_id(global_id): elif re.match(r"\d+$", str(global_id)) is not None: return int(global_id) else: - raise ValueError("{} is not a valid global ID".format(global_id)) + raise ValueError(f"{global_id} is not a valid global ID") @staticmethod def _get_formated_error_message(json_error): @@ -227,9 +226,12 @@ def _get_error_detail(response): return "error message: {}".format(visible or "an empty HTML page") title = re.search(r"]*>(.*?)", text, re.I | re.S) title = " ".join(title.group(1).split()) if title else "" - return "error message: the server answered with an HTML error page{}".format( - f" ({title})" if title else "") - return "error message: {}".format(text) + return ( + "error message: the server answered with an HTML error page{}".format( + f" ({title})" if title else "" + ) + ) + return f"error message: {text}" @staticmethod def _check_status(response): @@ -239,7 +241,7 @@ def _check_status(response): """ if response.status_code == 401: raise AuthenticationError( - "Error code: 401, {}".format(ClientBase._get_error_detail(response)) + f"Error code: 401, {ClientBase._get_error_detail(response)}" ) if response.status_code in REDIRECT_STATUSES: # Redirects are never followed: requests keeps custom headers such as apiKey @@ -257,9 +259,7 @@ def _check_status(response): response.raise_for_status() except requests.HTTPError: raise ApiError( - "Error code: {}, {}".format( - response.status_code, ClientBase._get_error_detail(response) - ), + f"Error code: {response.status_code}, {ClientBase._get_error_detail(response)}", response_status_code=response.status_code, response=response, ) @@ -281,7 +281,9 @@ def doDelete(self, path, resource_id): """ numeric_id = self._get_numeric_record_id(resource_id) return self.retrieve_api_results( - "/{}/{}".format(path.strip("/"), numeric_id), # tolerate callers passing "/documents" + "/{}/{}".format( + path.strip("/"), numeric_id + ), # tolerate callers passing "/documents" content_type=None, request_type="DELETE", ) @@ -298,13 +300,21 @@ def retrieve_api_results( :param content_type: content type :return: parsed JSON response as a dictionary """ - url = self._rebase_url(endpoint) if self._is_absolute_url(endpoint) else self._get_api_url() + endpoint + url = ( + self._rebase_url(endpoint) + if self._is_absolute_url(endpoint) + else self._get_api_url() + endpoint + ) headers = self._get_headers(content_type) try: if request_type == "GET": response = self._session.get( - url, params=params, headers=headers, timeout=self.timeout, allow_redirects=False + url, + params=params, + headers=headers, + timeout=self.timeout, + allow_redirects=False, ) elif ( request_type == "PUT" @@ -312,14 +322,16 @@ def retrieve_api_results( or request_type == "DELETE" ): response = self._session.request( - request_type, url, json=params, headers=headers, timeout=self.timeout, - allow_redirects=False + request_type, + url, + json=params, + headers=headers, + timeout=self.timeout, + allow_redirects=False, ) else: raise ValueError( - "Expected GET / PUT / POST / DELETE request type, received {} instead".format( - request_type - ) + f"Expected GET / PUT / POST / DELETE request type, received {request_type} instead" ) return self._handle_response(response) @@ -423,7 +435,11 @@ def download_link_to_file(self, url, filename, chunk_size=8192): headers = {"apiKey": self.api_key, "Accept": "application/octet-stream"} try: with self._session.get( - url, headers=headers, stream=True, timeout=self.timeout, allow_redirects=False + url, + headers=headers, + stream=True, + timeout=self.timeout, + allow_redirects=False, ) as response: self._check_status(response) if isinstance(filename, str): @@ -456,7 +472,7 @@ def serr(self, msg: str): def _stream( self, endpoint: str, - pagination: Optional[Pagination] = None, + pagination: Pagination | None = None, ): """ Yields items, making paginated requests to the server as each page diff --git a/rspace_client/eln/advanced_query_builder.py b/rspace_client/eln/advanced_query_builder.py index 2121a19..afc8a85 100644 --- a/rspace_client/eln/advanced_query_builder.py +++ b/rspace_client/eln/advanced_query_builder.py @@ -1,5 +1,5 @@ -from enum import Enum import json +from enum import Enum class AdvancedQueryBuilder: diff --git a/rspace_client/eln/dcs.py b/rspace_client/eln/dcs.py index 9d10cd5..6154475 100644 --- a/rspace_client/eln/dcs.py +++ b/rspace_client/eln/dcs.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- """ Created on Thu Nov 4 21:25:03 2021 @author: richard """ + import enum diff --git a/rspace_client/eln/eln.py b/rspace_client/eln/eln.py index 3249b01..1e40b39 100644 --- a/rspace_client/eln/eln.py +++ b/rspace_client/eln/eln.py @@ -1,10 +1,10 @@ import datetime -import time import os -import rspace_client.eln.filetree_importer as importer -from rspace_client.eln.dcs import DocumentCreationStrategy +import time +import rspace_client.eln.filetree_importer as importer from rspace_client.client_base import ClientBase, Pagination +from rspace_client.eln.dcs import DocumentCreationStrategy class ELNClient(ClientBase): @@ -21,7 +21,7 @@ def _get_api_url(self): Returns an API server URL. :return: string URL """ - return "{}/api/{}".format(self.rspace_url, self.API_VERSION) + return f"{self.rspace_url}/api/{self.API_VERSION}" # Documents methods def get_documents( @@ -77,7 +77,7 @@ def get_document(self, doc_id): this document, links to download the content of media files """ numeric_doc_id = self._get_numeric_record_id(doc_id) - return self.retrieve_api_results("/documents/{}".format(numeric_doc_id)) + return self.retrieve_api_results(f"/documents/{numeric_doc_id}") def delete_document(self, doc_id): """ @@ -96,14 +96,13 @@ def get_document_csv(self, doc_id): """ numeric_doc_id = self._get_numeric_record_id(doc_id) return self.retrieve_api_results( - "/documents/{}".format(numeric_doc_id), + f"/documents/{numeric_doc_id}", content_type="text/csv", ) def create_document( self, name=None, parent_folder_id=None, tags=None, form_id=None, fields=None ): - """ Creates a new document in user's Api Inbox folder. More information on https://community.researchspace.com/public/apiDocs (or your own instance's /public/apiDocs). @@ -194,9 +193,7 @@ def _add_content(self, document_id, html_content, field_index=0, append=True): fields = doc["fields"] if field_index >= len(fields): raise ValueError( - "Field at index {} doesn't exist, document {} has {} fields".format( - field_index, document_id, len(fields) - ) + f"Field at index {field_index} doesn't exist, document {document_id} has {len(fields)} fields" ) field = fields[field_index] @@ -244,7 +241,7 @@ def update_document( data["fields"] = fields numeric_doc_id = self._get_numeric_record_id(document_id) return self.retrieve_api_results( - "/documents/{}".format(numeric_doc_id), + f"/documents/{numeric_doc_id}", request_type="PUT", params=data, ) @@ -331,7 +328,7 @@ def get_file_info(self, file_id): :return: parsed response as a dictionary """ numeric_file_id = self._get_numeric_record_id(file_id) - return self.retrieve_api_results("/files/{}".format(numeric_file_id)) + return self.retrieve_api_results(f"/files/{numeric_file_id}") def download_file(self, file_id, filename, chunk_size=128): """ @@ -377,9 +374,7 @@ def update_file(self, file, fileId): :param fileId: Id of the file to replace :return: updated File response as a dictionary """ - return self._post_multipart( - "/files/{}/file".format(fileId), files={"file": file} - ) + return self._post_multipart(f"/files/{fileId}/file", files={"file": file}) # Activity methods def get_activity( @@ -417,19 +412,19 @@ def get_activity( if isinstance(date_from, datetime.date): params["dateFrom"] = date_from.isoformat() else: - raise TypeError("Unexpected date_from type {}".format(type(date_from))) + raise TypeError(f"Unexpected date_from type {type(date_from)}") if date_to is not None: if isinstance(date_to, datetime.date): params["dateTo"] = date_to.isoformat() else: - raise TypeError("Unexpected date_from type {}".format(type(date_to))) + raise TypeError(f"Unexpected date_from type {type(date_to)}") if actions is not None: if isinstance(actions, list): params["actions"] = ",".join(actions) else: - raise TypeError("Unexpected actions type {}".format(type(actions))) + raise TypeError(f"Unexpected actions type {type(actions)}") if domains is not None: if isinstance(domains, list): @@ -535,14 +530,15 @@ def download_export_selection( def _wait_till_complete_then_download( self, job_id, file_path, wait_between_requests=30, progress_log=None ): - + while True: status_response = self.get_job_status(job_id) if status_response["status"] == "COMPLETED": - download_url = self.get_link(status_response, "enclosure") - self._log_progress(progress_log, f"COMPLETED: download url is {download_url}") + self._log_progress( + progress_log, f"COMPLETED: download url is {download_url}" + ) if os.path.isdir(file_path): file_path = os.path.join(file_path, download_url.split("/")[-1]) self.download_link_to_file(download_url, file_path) @@ -563,7 +559,10 @@ def _wait_till_complete_then_download( or status_response["status"] == "STARTING" or status_response["status"] == "STARTED" ): - self._log_progress(progress_log, f"Running - {status_response['percentComplete']:2.2f}% complete") + self._log_progress( + progress_log, + f"Running - {status_response['percentComplete']:2.2f}% complete", + ) time.sleep(wait_between_requests) continue else: @@ -571,17 +570,23 @@ def _wait_till_complete_then_download( "Unknown job status: " + status_response["status"] ) - def _log_progress(self, progress_log, msg: str): + def _log_progress(self, progress_log, msg: str): if progress_log is not None: with open(progress_log, "a") as log: log.write(msg) if not msg.endswith("\n"): log.write("\n") - - def export_and_download (self, export_format,scope,file_path, uid=None, - include_revisions=False, + + def export_and_download( + self, + export_format, + scope, + file_path, + uid=None, + include_revisions=False, wait_between_requests=30, - progress_log=None): + progress_log=None, + ): """ Exports user's or group's records and downloads the exported archive to a specified location. :param export_format: 'xml' or 'html' @@ -593,8 +598,16 @@ def export_and_download (self, export_format,scope,file_path, uid=None, :param an optional file-path to a writable log file, to log progress. :return: file path to the downloaded export archive. """ - return self.download_export(export_format,scope,file_path,uid, include_revisions,wait_between_requests, progress_log) - + return self.download_export( + export_format, + scope, + file_path, + uid, + include_revisions, + wait_between_requests, + progress_log, + ) + def download_export( self, export_format, @@ -603,7 +616,7 @@ def download_export( uid=None, include_revisions=False, wait_between_requests=30, - progress_log=None + progress_log=None, ): """ DEPRECATED since 2.5.0. Use 'export_and_download' which better describes this method and works in exactly the same way. @@ -617,7 +630,9 @@ def download_export( :param an optional file-path to a writable log file, to log progress. :return: file path to the downloaded export archive. """ - self._log_progress(progress_log, f"{datetime.datetime.now()} - Starting export..") + self._log_progress( + progress_log, f"{datetime.datetime.now()} - Starting export.." + ) job_id = self.start_export( export_format=export_format, scope=scope, @@ -635,7 +650,7 @@ def get_job_status(self, job_id): :return: parsed response as a dictionary (most important field is 'status' which is supposed to one of: 'STARTED', 'STARTING', 'RUNNING', 'COMPLETED', 'FAILED', 'ABANDONED') """ - return self.retrieve_api_results("/jobs/{}".format(job_id)) + return self.retrieve_api_results(f"/jobs/{job_id}") # Form related methods def get_forms( @@ -694,7 +709,7 @@ def get_form(self, form_id): :return: a dictionary that includes: form metadata, fields """ numeric_doc_id = self._get_numeric_record_id(form_id) - return self.retrieve_api_results("/forms/{}".format(numeric_doc_id)) + return self.retrieve_api_results(f"/forms/{numeric_doc_id}") def delete_form(self, form_id): """ @@ -712,7 +727,7 @@ def publish_form(self, form_id): """ numeric_doc_id = self._get_numeric_record_id(form_id) return self.retrieve_api_results( - "/forms/{}/publish".format(numeric_doc_id), + f"/forms/{numeric_doc_id}/publish", request_type="PUT", ) @@ -725,7 +740,7 @@ def unpublish_form(self, form_id): """ numeric_doc_id = self._get_numeric_record_id(form_id) return self.retrieve_api_results( - "/forms/{}/unpublish".format(numeric_doc_id), + f"/forms/{numeric_doc_id}/unpublish", request_type="PUT", ) @@ -738,7 +753,7 @@ def share_form(self, form_id): """ numeric_doc_id = self._get_numeric_record_id(form_id) return self.retrieve_api_results( - "/forms/{}/share".format(numeric_doc_id), + f"/forms/{numeric_doc_id}/share", request_type="PUT", ) @@ -752,7 +767,7 @@ def unshare_form(self, form_id): """ numeric_doc_id = self._get_numeric_record_id(form_id) return self.retrieve_api_results( - "/forms/{}/unshare".format(numeric_doc_id), + f"/forms/{numeric_doc_id}/unshare", request_type="PUT", ) @@ -794,7 +809,7 @@ def get_folder(self, folder_id): :return: metadata about the folder or notebook """ numeric_folder_id = self._get_numeric_record_id(folder_id) - return self.retrieve_api_results("/folders/{}".format(numeric_folder_id)) + return self.retrieve_api_results(f"/folders/{numeric_folder_id}") def list_folder_tree(self, folder_id=None, typesToInclude=None, page_size=None): """ @@ -809,7 +824,7 @@ def list_folder_tree(self, folder_id=None, typesToInclude=None, page_size=None): typesToInclude = typesToInclude or [] url = "" if folder_id is not None: - url = "/folders/tree/{}".format(folder_id) + url = f"/folders/tree/{folder_id}" else: url = "/folders/tree" params = {} diff --git a/rspace_client/eln/field_content.py b/rspace_client/eln/field_content.py index 549ee83..afa29ff 100755 --- a/rspace_client/eln/field_content.py +++ b/rspace_client/eln/field_content.py @@ -1,14 +1,14 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- """ Created on Thu Jun 3 09:50:47 2021 @author: richard """ -from bs4 import BeautifulSoup import re +from bs4 import BeautifulSoup + class FieldContent: """ diff --git a/rspace_client/eln/filetree_importer.py b/rspace_client/eln/filetree_importer.py index 47dd343..7fd636f 100644 --- a/rspace_client/eln/filetree_importer.py +++ b/rspace_client/eln/filetree_importer.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- """ Created on Thu Nov 4 20:56:36 2021 @author: richard """ + import os import re @@ -57,9 +57,9 @@ def _filter_dot_files(subdirList): path2Id = {} def _is_subfolder_tree_required(sf, doc_creation): - return (sf not in path2Id.keys()) and ( - (DCS.DOC_PER_FILE == doc_creation) - or (DCS.DOC_PER_SUBFOLDER == doc_creation) + return (sf not in path2Id) and ( + (doc_creation == DCS.DOC_PER_FILE) + or (doc_creation == DCS.DOC_PER_SUBFOLDER) ) # maintain mapping of local directory paths to RSpace folder Ids @@ -79,7 +79,6 @@ def _is_subfolder_tree_required(sf, doc_creation): _filter_dot_files(subdirList) _filter_dot_files(fileList) for sf in subdirList: - if _is_subfolder_tree_required(sf, doc_creation): rs_folder = self.cli.create_folder( _sanitize(os.path.basename(sf)), path2Id[dirName] @@ -94,7 +93,7 @@ def _is_subfolder_tree_required(sf, doc_creation): rs_file = self.cli.upload_file(reader) all_rs_files.append((f, rs_file)) rs_files_in_subdir.append((f, rs_file)) - except IOError as x: + except OSError as x: if halt_on_error: self.cli.serr( f"{x} raised while opening {f} - halting on error" @@ -107,13 +106,13 @@ def _is_subfolder_tree_required(sf, doc_creation): doc_name = os.path.splitext(f)[0] ## just puts link to the document - if DCS.DOC_PER_FILE == doc_creation: + if doc_creation == DCS.DOC_PER_FILE: parent_folder_id = path2Id[dirName] content_string = f"" self._create_file_linking_doc( content_string, parent_folder_id, doc_name, path2Id ) - if (DCS.DOC_PER_SUBFOLDER == doc_creation) and ( + if (doc_creation == DCS.DOC_PER_SUBFOLDER) and ( len(rs_files_in_subdir) > 0 ): parent_folder_id = path2Id[dirName] @@ -122,7 +121,7 @@ def _is_subfolder_tree_required(sf, doc_creation): self._create_file_linking_doc( content, parent_folder_id, summary_name, path2Id ) - if (DCS.SUMMARY_DOC == doc_creation) and (len(all_rs_files) > 0): + if (doc_creation == DCS.SUMMARY_DOC) and (len(all_rs_files) > 0): content = self._generate_summary_content(all_rs_files) summary_name = f"Summary-doc{all_rs_files[0][1]['created']}" self._create_file_linking_doc(content, folder["id"], summary_name, path2Id) diff --git a/rspace_client/eln/fs.py b/rspace_client/eln/fs.py index e4bd31f..5eec747 100644 --- a/rspace_client/eln/fs.py +++ b/rspace_client/eln/fs.py @@ -1,27 +1,40 @@ import logging import warnings +from collections.abc import Iterator, Mapping +from io import BytesIO +from typing import Any, BinaryIO + +from fs import errors from fs.base import FS -from rspace_client.eln import eln -from rspace_client.client_base import ClientBase -from typing import Optional, List, Text, BinaryIO, Mapping, Any, Iterator from fs.info import Info +from fs.mode import Mode from fs.permissions import Permissions from fs.subfs import SubFS -from fs import errors -from fs.mode import Mode -from io import BytesIO + +from rspace_client.client_base import ClientBase +from rspace_client.eln import eln + from ..fs_utils import path_to_id logger = logging.getLogger(__name__) # The section policy, the classification table, the exception and the Placement record # are shared with the fsspec filesystem that replaces this module. -from rspace_client.fs.gallery import (MISCELLANEOUS_SECTION, ON_MISMATCH_RAISE, ON_MISMATCH_REROUTE, # noqa: E402,F401 - GallerySectionMismatch, Placement, check_policy, classify_media_section, folder_section, - mismatch_message, placement) +from rspace_client.fs.gallery import ( # noqa: E402,F401 + MISCELLANEOUS_SECTION, + ON_MISMATCH_RAISE, + ON_MISMATCH_REROUTE, + GallerySectionMismatch, + Placement, + check_policy, + classify_media_section, + folder_section, + mismatch_message, + placement, +) -def _filename_for(file: BinaryIO, options: Mapping[Text, Any]) -> Optional[Text]: +def _filename_for(file: BinaryIO, options: Mapping[str, Any]) -> str | None: """Best-effort filename for a file object: an explicit ``filename`` option wins, otherwise the file object's own ``name`` if it is a string.""" name = options.get("filename") @@ -31,7 +44,7 @@ def _filename_for(file: BinaryIO, options: Mapping[Text, Any]) -> Optional[Text] return name if isinstance(name, str) else None -def _with_parsable_created(info: Mapping[Text, Any]) -> Mapping[Text, Any]: +def _with_parsable_created(info: Mapping[str, Any]) -> Mapping[str, Any]: """RSpace dates end in ``Z`` for UTC. Galaxy's ``rspace`` file source parses ``created`` with ``datetime.fromisoformat``, which rejects ``Z`` before Python 3.11, so on 3.10 every file listing failed. Spell the same instant as ``+00:00``; the rest of the record is @@ -43,22 +56,25 @@ def _with_parsable_created(info: Mapping[Text, Any]) -> Mapping[Text, Any]: def is_folder(path): - return path.split('/')[-1][:2] == "GF" + return path.split("/")[-1][:2] == "GF" class GalleryInfo(Info): def __init__(self, obj, *args, **kwargs) -> None: super().__init__(obj, *args, **kwargs) - self.globalId = obj['rspace']['globalId']; + self.globalId = obj["rspace"]["globalId"] class GalleryFilesystem(FS): - - def __init__(self, server: str, api_key: str, on_mismatch: str = ON_MISMATCH_RAISE) -> None: + def __init__( + self, server: str, api_key: str, on_mismatch: str = ON_MISMATCH_RAISE + ) -> None: warnings.warn( "rspace_client.eln.fs.GalleryFilesystem (PyFilesystem2) is deprecated and will be removed " "in rspace-client 3.0; use rspace_client.fs.GalleryFilesystem or RSpaceFilesystem (fsspec)", - DeprecationWarning, stacklevel=2) + DeprecationWarning, + stacklevel=2, + ) """ :param server: RSpace server URL :param api_key: RSpace API key @@ -70,16 +86,25 @@ def __init__(self, server: str, api_key: str, on_mismatch: str = ON_MISMATCH_RAI write (including generic PyFilesystem operations); individual :meth:`upload` calls may override it. """ - super(GalleryFilesystem, self).__init__() + super().__init__() self.on_mismatch = check_policy(on_mismatch) self.eln_client = eln.ELNClient(server, api_key) # The Gallery root is a system folder with a GF id; a user's own folder named # "Gallery" (FL...) would otherwise be picked when it sorts first in Home. - gallery = next((file for file in self._all_records(None) - if file.get('name') == 'Gallery' and str(file.get('globalId', '')).startswith('GF')), None) + gallery = next( + ( + file + for file in self._all_records(None) + if file.get("name") == "Gallery" + and str(file.get("globalId", "")).startswith("GF") + ), + None, + ) if gallery is None: - raise errors.CreateFailed("no folder named 'Gallery' in the Home folder listing") - self.gallery_id = gallery['id'] + raise errors.CreateFailed( + "no folder named 'Gallery' in the Home folder listing" + ) + self.gallery_id = gallery["id"] def _all_records(self, folder_id) -> Iterator[dict]: """All records of a folder listing, following its 'next' links: the Home folder @@ -87,21 +112,23 @@ def _all_records(self, folder_id) -> Iterator[dict]: page = self.eln_client.list_folder_tree(folder_id) followed = set() while True: - if 'records' not in page: + if "records" not in page: # a listing without records is malformed, not empty: removedir relies on this raise errors.OperationFailed(msg="folder listing carries no 'records'") - yield from page['records'] + yield from page["records"] # not link_exists(): that raises when a page carries no _links at all - if not any(link.get('rel') == 'next' for link in page.get('_links') or []): + if not any(link.get("rel") == "next" for link in page.get("_links") or []): return - next_link = self.eln_client.get_link(page, 'next') + next_link = self.eln_client.get_link(page, "next") if next_link in followed: - raise errors.OperationFailed(msg="folder listing 'next' links form a loop: " + str(next_link)) + raise errors.OperationFailed( + msg="folder listing 'next' links form a loop: " + str(next_link) + ) followed.add(next_link) - page = self.eln_client.get_link_contents(page, 'next') + page = self.eln_client.get_link_contents(page, "next") def getinfo(self, path, namespaces=None) -> Info: - is_file = path.split('/')[-1][:2] == "GL" + is_file = path.split("/")[-1][:2] == "GL" info = None if is_folder(path): info = self.eln_client.get_folder(path_to_id(path)) @@ -109,29 +136,35 @@ def getinfo(self, path, namespaces=None) -> Info: info = self.eln_client.get_file_info(path_to_id(path)) if info is None: raise errors.ResourceNotFound(path) - return GalleryInfo({ - "basic": { - "name": (is_folder(path) and "GF" or "GL") + path_to_id(path), - "is_dir": is_folder(path), - }, - "details": { - "size": info.get('size', 0), - "type": is_folder(path) and "1" or "2", - }, - "rspace": _with_parsable_created(info), - }) - - def listdir(self, path: Text) -> List[Text]: - id = path in [u'.', u'/', u'./'] and self.gallery_id or path_to_id(path) - return [file['globalId'] for file in self._all_records(id)] - - def makedir(self, path: Text, permissions: Optional[Permissions] = None, recreate: bool = False) -> SubFS[FS]: - new_folder_name = path.split('/')[-1] - parent_id = path_to_id(path[:-(len(new_folder_name) + 1)]) - new_id = self.eln_client.create_folder(new_folder_name, parent_id)['id'] + return GalleryInfo( + { + "basic": { + "name": (is_folder(path) and "GF" or "GL") + path_to_id(path), + "is_dir": is_folder(path), + }, + "details": { + "size": info.get("size", 0), + "type": is_folder(path) and "1" or "2", + }, + "rspace": _with_parsable_created(info), + } + ) + + def listdir(self, path: str) -> list[str]: + id = path in [".", "/", "./"] and self.gallery_id or path_to_id(path) + return [file["globalId"] for file in self._all_records(id)] + + def makedir( + self, path: str, permissions: Permissions | None = None, recreate: bool = False + ) -> SubFS[FS]: + new_folder_name = path.split("/")[-1] + parent_id = path_to_id(path[: -(len(new_folder_name) + 1)]) + new_id = self.eln_client.create_folder(new_folder_name, parent_id)["id"] return self.opendir("/GF" + str(new_id)) - def openbin(self, path: Text, mode: Text = 'r', buffering: int = -1, **options) -> BinaryIO: + def openbin( + self, path: str, mode: str = "r", buffering: int = -1, **options + ) -> BinaryIO: """ This method is added for conformance with the FS interface, but in almost all circumstances you probably want to be using upload and @@ -156,38 +189,50 @@ def openbin(self, path: Text, mode: Text = 'r', buffering: int = -1, **options) if _mode.writing: file = BytesIO() + def upload_callback(): file.seek(0) self.upload(path, file) + file.close = upload_callback return file - raise errors.Unsupported("mode {!r}".format(_mode)) + raise errors.Unsupported(f"mode {_mode!r}") - def remove(self, path: Text) -> None: + def remove(self, path: str) -> None: raise NotImplementedError - def removedir(self, path: Text, recursive: bool = False, force: bool = False) -> None: - if path in [u'.', u'/', u'./']: + def removedir( + self, path: str, recursive: bool = False, force: bool = False + ) -> None: + if path in [".", "/", "./"]: raise errors.RemoveRootError() - if (not is_folder(path)): + if not is_folder(path): raise errors.DirectoryExpected(path) # only the first page is needed to know the folder is not empty if next(self._all_records(path_to_id(path)), None) is not None: raise errors.DirectoryNotEmpty(path) self.eln_client.delete_folder(path_to_id(path)) - def setinfo(self, path: Text, info: Mapping[Text, Mapping[Text, object]]) -> None: + def setinfo(self, path: str, info: Mapping[str, Mapping[str, object]]) -> None: raise NotImplementedError - def download(self, path: Text, file: BinaryIO, chunk_size: Optional[int] = None, **options: Any) -> None: + def download( + self, path: str, file: BinaryIO, chunk_size: int | None = None, **options: Any + ) -> None: if chunk_size is not None: self.eln_client.download_file(path_to_id(path), file, chunk_size) else: self.eln_client.download_file(path_to_id(path), file) - def upload(self, path: Text, file: BinaryIO, chunk_size: Optional[int] = None, - on_mismatch: Optional[str] = None, **options: Any) -> Placement: + def upload( + self, + path: str, + file: BinaryIO, + chunk_size: int | None = None, + on_mismatch: str | None = None, + **options: Any, + ) -> Placement: """ :param path: Global Id of a folder in the appropriate gallery section or else if empty then the upload will be placed in the Api @@ -210,9 +255,15 @@ def upload(self, path: Text, file: BinaryIO, chunk_size: Optional[int] = None, folder_id = path_to_id(path) if path else None try: response = self.eln_client.upload_file(file, folder_id) - return placement(self.eln_client, response, requested_path=path or None, rerouted=False) + return placement( + self.eln_client, response, requested_path=path or None, rerouted=False + ) except ClientBase.ApiError as err: - section = None if folder_id is None else folder_section(self.eln_client, folder_id) + section = ( + None + if folder_id is None + else folder_section(self.eln_client, folder_id) + ) if section is None: raise filename = _filename_for(file, options) @@ -224,14 +275,26 @@ def upload(self, path: Text, file: BinaryIO, chunk_size: Optional[int] = None, except (AttributeError, OSError, ValueError): pass response = self.eln_client.upload_file(file, None) - placed = placement(self.eln_client, response, requested_path=path, rerouted=True) + placed = placement( + self.eln_client, response, requested_path=path, rerouted=True + ) logger.info( "RSpace Gallery: %s could not go in %s (section '%s'); placed in %s instead", - "'{}'".format(filename) if filename else "file", path, section, placed.path) + f"'{filename}'" if filename else "file", + path, + section, + placed.path, + ) return placed raise GallerySectionMismatch( - mismatch_message("'{}'".format(filename) if filename else "the file", path, section, guessed, err), + mismatch_message( + f"'{filename}'" if filename else "the file", + path, + section, + guessed, + err, + ), folder_section=section, folder_global_id="GF" + str(folder_id), file_media_type=guessed, diff --git a/rspace_client/exceptions.py b/rspace_client/exceptions.py index 833ad73..5e80809 100644 --- a/rspace_client/exceptions.py +++ b/rspace_client/exceptions.py @@ -8,7 +8,6 @@ (e.g. ``ClientBase.ApiError``). Those names remain as aliases of the classes defined here and will be removed in 3.0. """ -from typing import Optional import requests @@ -42,8 +41,8 @@ class ApiError(RSpaceError): def __init__( self, error_message: str, - response_status_code: Optional[int] = None, - response: Optional[requests.Response] = None, + response_status_code: int | None = None, + response: requests.Response | None = None, ): super().__init__(error_message) self.response_status_code = response_status_code diff --git a/rspace_client/fs/__init__.py b/rspace_client/fs/__init__.py index ac71c02..48b86aa 100644 --- a/rspace_client/fs/__init__.py +++ b/rspace_client/fs/__init__.py @@ -19,14 +19,15 @@ you want if a stored path has to survive a rename. The full RSpace record for any entry is under the ``rspace`` key of its info dict. """ + import fsspec -from .base import RSpaceFSBase, ReadOnlyError, RemoteApiError, make_entry +from .base import ReadOnlyError, RemoteApiError, RSpaceFSBase, make_entry from .gallery import GalleryFilesystem, GallerySectionMismatch, Placement from .inventory import InventoryFilesystem -from .workspace import WorkspaceFilesystem from .rspace import RSpaceFilesystem from .tree import format_tree, print_tree +from .workspace import WorkspaceFilesystem # also declared as an ``fsspec.specs`` entry point in pyproject.toml, so that # ``fsspec.filesystem("rspace")`` works before this package was imported diff --git a/rspace_client/fs/base.py b/rspace_client/fs/base.py index 356d4a7..b713d53 100644 --- a/rspace_client/fs/base.py +++ b/rspace_client/fs/base.py @@ -26,6 +26,7 @@ * a ``glob`` that understands the ``/**`` pattern Galaxy's search sends, with the escaping Galaxy applies, so that a segment carrying ``[GL83]`` can be found. """ + from __future__ import annotations import errno @@ -33,19 +34,25 @@ import io import os import re +from collections.abc import Callable, Iterable, Iterator, Mapping from dataclasses import dataclass from datetime import datetime, timezone -from typing import (Any, BinaryIO, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, - Tuple) +from typing import ( + Any, + BinaryIO, +) from fsspec.spec import AbstractBufferedFile, AbstractFileSystem from rspace_client.client_base import ClientBase -from rspace_client.exceptions import ApiError, AuthenticationError, RSpaceConnectionError +from rspace_client.exceptions import ( + ApiError, + AuthenticationError, + RSpaceConnectionError, +) from . import paths - # ------------------------------------------------------------------ errors # # fsspec callers (``exists``, ``walk``, ``copy``, Galaxy's file source) expect ``OSError`` @@ -69,9 +76,11 @@ class ReadOnlyError(PermissionError): """A write was refused because of the filesystem's posture, not by the server.""" -def os_error_for(exc: Exception, path: str) -> Optional[OSError]: +def os_error_for(exc: Exception, path: str) -> OSError | None: """The ``OSError`` that stands for a client exception, or None to re-raise as it is.""" - if getattr(exc, "fs_passthrough", False): # e.g. GallerySectionMismatch: already explained + if getattr( + exc, "fs_passthrough", False + ): # e.g. GallerySectionMismatch: already explained return None if isinstance(exc, RSpaceConnectionError): return ConnectionError(f"{path!r}: {exc}") @@ -82,7 +91,11 @@ def os_error_for(exc: Exception, path: str) -> Optional[OSError]: return FileNotFoundError(errno.ENOENT, f"{path!r}: {exc}", path) if status in (401, 403): return PermissionError(errno.EACCES, f"{path!r}: {exc}", path) - if status in (502, 503, 504): # the server or a proxy in front of it is not answering + if status in ( + 502, + 503, + 504, + ): # the server or a proxy in front of it is not answering return ConnectionError(f"{path!r}: {exc}") if isinstance(exc, ApiError): # a 500 included: RSpace answers one for a request it understood but could not @@ -92,9 +105,27 @@ def os_error_for(exc: Exception, path: str) -> Optional[OSError]: #: Public methods whose first argument is a path and which may call the server. -_TRANSLATED_METHODS = ("ls", "scandir", "info", "cat_file", "get_file", "put_file", "_open", - "download_fileobj", "upload_fileobj", "mkdir", "makedirs", "rmdir", - "rm_file", "link", "glob", "cp_file", "mv", "created", "modified") +_TRANSLATED_METHODS = ( + "ls", + "scandir", + "info", + "cat_file", + "get_file", + "put_file", + "_open", + "download_fileobj", + "upload_fileobj", + "mkdir", + "makedirs", + "rmdir", + "rm_file", + "link", + "glob", + "cp_file", + "mv", + "created", + "modified", +) _CLIENT_ERRORS = (ApiError, AuthenticationError, RSpaceConnectionError) @@ -144,26 +175,30 @@ def translate_class(cls) -> None: def writes(method): """Mark a method that changes the server: it is refused unless ``writable=True``.""" + @functools.wraps(method) def wrapper(self, path, *args, **kwargs): self._require_writable(path) return method(self, path, *args, **kwargs) + return wrapper def deletes(method): """Mark a method that removes something: it is refused unless ``allow_delete=True``.""" + @functools.wraps(method) def wrapper(self, path, *args, **kwargs): self._require_delete(path) return method(self, path, *args, **kwargs) + return wrapper # ------------------------------------------------------------------ entries -def to_epoch(value: Any) -> Optional[float]: +def to_epoch(value: Any) -> float | None: """Convert an RSpace timestamp (ISO-8601 string, or epoch millis/seconds) to epoch seconds.""" if value is None or value == "": return None @@ -181,8 +216,15 @@ def to_epoch(value: Any) -> Optional[float]: return parsed.timestamp() -def make_entry(segment: str, is_dir: bool, raw: Optional[Mapping] = None, size: Optional[int] = None, - created: Any = None, modified: Any = None, writable: Optional[bool] = None) -> dict: +def make_entry( + segment: str, + is_dir: bool, + raw: Mapping | None = None, + size: int | None = None, + created: Any = None, + modified: Any = None, + writable: bool | None = None, +) -> dict: """Build an entry dict. ``segment`` is the entry's own path segment; ``ls`` prefixes the parent path later. @@ -190,7 +232,7 @@ def make_entry(segment: str, is_dir: bool, raw: Optional[Mapping] = None, size: is locked). Left None, the key is absent, which means "unknown" rather than a guess: a record shared read-only with you is equally unwritable and looks no different from here. """ - entry: Dict[str, Any] = { + entry: dict[str, Any] = { "name": segment, "type": "directory" if is_dir else "file", "size": size, @@ -215,14 +257,15 @@ class Target: belongs to (an Inventory record, an ELN document), ``field_gid`` the field a file was reached through, and ``section`` the Inventory root section the path went through. """ + kind: str - gid: Optional[str] = None - parent_gid: Optional[str] = None - field_gid: Optional[str] = None - section: Optional[str] = None + gid: str | None = None + parent_gid: str | None = None + field_gid: str | None = None + section: str | None = None -def client_or_new(client, factory, server: Optional[str], api_key: Optional[str], what: str): +def client_or_new(client, factory, server: str | None, api_key: str | None, what: str): """The client that was passed in, or a new one from ``server`` and ``api_key``.""" if client is not None: return client @@ -252,7 +295,9 @@ def stream_pages(client: ClientBase, first_page: Mapping, key: str) -> Iterator[ return next_link = client.get_link(page, "next") if next_link in followed: - raise OSError(errno.EIO, f"RSpace listing 'next' links form a loop: {next_link}") + raise OSError( + errno.EIO, f"RSpace listing 'next' links form a loop: {next_link}" + ) followed.add(next_link) page = client.get_link_contents(page, "next") @@ -297,9 +342,9 @@ class RSpaceFSBase(AbstractFileSystem): #: top-down reuse the same handful of entries, so a small bound is plenty. NAME_CACHE_LIMIT = 4096 #: ``Target.kind`` values that are files: listing one raises ``NotADirectoryError``. - FILE_KINDS: Tuple[str, ...] = () + FILE_KINDS: tuple[str, ...] = () #: Field types (lower case) that can hold a file; other fields are not browsable. - FILE_BEARING_FIELD_TYPES: Tuple[str, ...] = () + FILE_BEARING_FIELD_TYPES: tuple[str, ...] = () #: False where the RSpace API cannot delete a file (the Gallery): a move is then refused #: before anything is copied, since the second half could never happen. CAN_DELETE_FILES = True @@ -312,15 +357,23 @@ def __init_subclass__(cls, **kwargs) -> None: # branch cannot forget it translate_class(cls) - def __init__(self, *, writable: bool = False, allow_delete: bool = False, - path_style: str = "name", **storage_options: Any) -> None: + def __init__( + self, + *, + writable: bool = False, + allow_delete: bool = False, + path_style: str = "name", + **storage_options: Any, + ) -> None: # fsspec caches directory listings by default and never expires them; this # filesystem's own name cache is cleared on every write, so leave listings uncached # unless the caller (Galaxy's cache options, say) asks for them storage_options.setdefault("use_listings_cache", False) super().__init__(**storage_options) if path_style not in paths.PATH_STYLES: - raise ValueError(f"path_style must be one of {paths.PATH_STYLES}, got {path_style!r}") + raise ValueError( + f"path_style must be one of {paths.PATH_STYLES}, got {path_style!r}" + ) self.writable = writable self.allow_delete = allow_delete #: "name" -> segments look like 'Images'; "labelled" -> 'Images [GF12]'; "id" -> 'GF12'. @@ -329,7 +382,7 @@ def __init__(self, *, writable: bool = False, allow_delete: bool = False, #: (parent path, segment) -> global ID, for segments written as a plain name. A name #: can only be resolved against its parent's listing, so without this every operation #: on a deep path would re-list every directory above it. - self._name_cache: Dict[Tuple[str, str], str] = {} + self._name_cache: dict[tuple[str, str], str] = {} # ------------------------------------------------------------ paths @@ -348,13 +401,15 @@ def _segment(self, name, gid: str) -> str: """Path segment for a record, in this filesystem's path style.""" return paths.segment_for(self.path_style, name, gid) - def _upload_target(self, path: str) -> Tuple[str, str]: + def _upload_target(self, path: str) -> tuple[str, str]: """Split an upload path into the container to put the file in and the name to give it: the last segment is the name of the file to create and its parent is the container (a Gallery folder, an Inventory record, a document field).""" name = paths.last_segment(path) if not name or paths.is_root(path): - raise IsADirectoryError(errno.EISDIR, f"{path!r}: a file path is needed to upload to", path) + raise IsADirectoryError( + errno.EISDIR, f"{path!r}: a file path is needed to upload to", path + ) return self._parent(path), name @staticmethod @@ -367,13 +422,19 @@ def _upload_kwargs(name: str) -> dict: def _require_writable(self, path: str) -> None: if not self.writable: raise ReadOnlyError( - errno.EROFS, f"{path!r}: this filesystem was opened read-only; pass writable=True " - f"to allow writes", str(path)) + errno.EROFS, + f"{path!r}: this filesystem was opened read-only; pass writable=True " + f"to allow writes", + str(path), + ) def _require_delete(self, path: str) -> None: if not self.allow_delete: raise ReadOnlyError( - errno.EROFS, f"{path!r}: deletion is disabled; pass allow_delete=True to allow it", str(path)) + errno.EROFS, + f"{path!r}: deletion is disabled; pass allow_delete=True to allow it", + str(path), + ) @property def read_only(self) -> bool: @@ -390,7 +451,9 @@ def scandir(self, path: str) -> Iterator[dict]: path = self._strip_protocol(path) return self._listing(path) - def ls(self, path: str, detail: bool = True, refresh: bool = False, **kwargs) -> list: + def ls( + self, path: str, detail: bool = True, refresh: bool = False, **kwargs + ) -> list: path = self._strip_protocol(path) out = None if refresh else self.dircache.get(path) if out is None: @@ -459,16 +522,22 @@ def _record(self, gid: str) -> dict: """The raw RSpace record that owns fields (an Inventory record, an ELN document).""" raise NotImplementedError(f"{type(self).__name__} does not implement _record") - def _file_fields(self, record: Mapping) -> List[dict]: + def _file_fields(self, record: Mapping) -> list[dict]: """The record's fields that can hold a file. Other field types are not browsable.""" - return [f for f in record.get("fields") or [] - if str(f.get("type", "")).lower() in self.FILE_BEARING_FIELD_TYPES and f.get("globalId")] - - def _field(self, owner_gid: str, field_gid: str, record: Optional[Mapping] = None) -> dict: + return [ + f + for f in record.get("fields") or [] + if str(f.get("type", "")).lower() in self.FILE_BEARING_FIELD_TYPES + and f.get("globalId") + ] + + def _field( + self, owner_gid: str, field_gid: str, record: Mapping | None = None + ) -> dict: record = record if record is not None else self._record(owner_gid) return self._find_field(self._file_fields(record), field_gid, owner_gid) - def _gids(self, segments: List[str], start: int = 0) -> Iterator[Tuple[int, str]]: + def _gids(self, segments: list[str], start: int = 0) -> Iterator[tuple[int, str]]: """``(index, global id)`` for each segment from ``start`` on. A segment carrying a global ID says what it addresses; a bare name is looked up in its parent's listing.""" for index in range(start, len(segments)): @@ -477,20 +546,34 @@ def _gids(self, segments: List[str], start: int = 0) -> Iterator[Tuple[int, str] gid = self._lookup("/".join(segments[:index]), segments[index]) yield index, gid - def _entry(self, record: Mapping, is_dir: bool, gid: Optional[str] = None, - name: Optional[str] = None, **extra: Any) -> dict: + def _entry( + self, + record: Mapping, + is_dir: bool, + gid: str | None = None, + name: str | None = None, + **extra: Any, + ) -> dict: """The entry for an RSpace record, named after it in this filesystem's path style.""" gid = gid or record["globalId"] - return make_entry(self._segment(record.get("name") if name is None else name, gid), is_dir, - raw=record, size=record.get("size"), created=record.get("created"), - modified=record.get("lastModified"), **extra) + return make_entry( + self._segment(record.get("name") if name is None else name, gid), + is_dir, + raw=record, + size=record.get("size"), + created=record.get("created"), + modified=record.get("lastModified"), + **extra, + ) @staticmethod def _find_field(fields: Iterable[Mapping], field_gid: str, owner: str) -> dict: for field in fields: if field.get("globalId") == field_gid: return field - raise FileNotFoundError(errno.ENOENT, f"no field {field_gid} on {owner}", f"{owner}/{field_gid}") + raise FileNotFoundError( + errno.ENOENT, f"no field {field_gid} on {owner}", f"{owner}/{field_gid}" + ) def _is_empty(self, path: str) -> bool: """True if the directory has no children, without listing all of them.""" @@ -511,8 +594,11 @@ def _lookup(self, parent: str, segment: str) -> str: if key in self._name_cache: break else: - raise FileNotFoundError(errno.ENOENT, f"{self._join(parent, segment)!r} not found", - self._join(parent, segment)) + raise FileNotFoundError( + errno.ENOENT, + f"{self._join(parent, segment)!r} not found", + self._join(parent, segment), + ) return self._name_cache[key] def _gid_at(self, path: str) -> str: @@ -526,7 +612,7 @@ def clear_name_cache(self) -> None: filesystem; call it yourself if records are renamed elsewhere while it is open.""" self._name_cache.clear() - def invalidate_cache(self, path: Optional[str] = None) -> None: + def invalidate_cache(self, path: str | None = None) -> None: """Drop cached listings (fsspec's) and resolved names (ours). fsspec's default does nothing to the listings cache, so a write through this @@ -549,14 +635,18 @@ def _info_of(self, path: str, target: Target) -> dict: """The entry for a resolved path. Branches implement it.""" raise NotImplementedError(f"{type(self).__name__} does not implement _info_of") - def _stamp(self, path: str, key: str) -> Optional[datetime]: + def _stamp(self, path: str, key: str) -> datetime | None: stamp = self.info(path).get(key) - return datetime.fromtimestamp(stamp, tz=timezone.utc) if stamp is not None else None + return ( + datetime.fromtimestamp(stamp, tz=timezone.utc) + if stamp is not None + else None + ) - def created(self, path: str) -> Optional[datetime]: + def created(self, path: str) -> datetime | None: return self._stamp(path, "created") - def modified(self, path: str) -> Optional[datetime]: + def modified(self, path: str) -> datetime | None: return self._stamp(path, "mtime") # ------------------------------------------------------------ search @@ -565,7 +655,7 @@ def modified(self, path: str) -> Optional[datetime]: #: is allowed, which is how Galaxy sends a ``[``). _GALAXY_SEARCH = re.compile(r"^(?P[^*?]*?)/?\*(?P[^*?/]+)\*$", re.S) - def glob(self, path: str, maxdepth: Optional[int] = None, **kwargs): + def glob(self, path: str, maxdepth: int | None = None, **kwargs): """fsspec glob, with one special case: the ``/**`` pattern a search box sends (Galaxy builds exactly this) is answered by one listing of ```` and a case-insensitive substring match on the last segment, in listing order. fsspec's @@ -575,12 +665,18 @@ def glob(self, path: str, maxdepth: Optional[int] = None, **kwargs): # Galaxy wraps a query as ``**``, so a query that itself starts or ends with a # star ("*.csv") arrives as ``**.csv*``, which fsspec refuses because ``**`` only means # something as a whole path component. Inside a segment the user meant a single star. - path = "/".join(seg if seg == "**" else re.sub(r"\*{2,}", "*", seg) for seg in path.split("/")) + path = "/".join( + seg if seg == "**" else re.sub(r"\*{2,}", "*", seg) + for seg in path.split("/") + ) match = self._GALAXY_SEARCH.match(path) if match and maxdepth in (None, 1): needle = re.sub(r"\\(.)", r"\1", match.group("text")).lower() - found = {entry["name"]: entry for entry in self._listing(match.group("dir")) - if needle in paths.last_segment(entry["name"]).lower()} + found = { + entry["name"]: entry + for entry in self._listing(match.group("dir")) + if needle in paths.last_segment(entry["name"]).lower() + } return found if kwargs.get("detail") else list(found) return super().glob(path, maxdepth=maxdepth, **kwargs) @@ -601,13 +697,17 @@ def _file_id(self, path: str) -> str: def _placed_file(self, path: str, target: Target) -> dict: """The record of the file ``target`` as the directory ``path`` reaches it through holds it; ``FileNotFoundError`` when that directory does not hold it. Branches implement it.""" - raise NotImplementedError(f"{type(self).__name__} does not implement _placed_file") + raise NotImplementedError( + f"{type(self).__name__} does not implement _placed_file" + ) def _download(self, file_id: str, file: BinaryIO, chunk_size: int) -> None: """The client call that streams file ``file_id`` into ``file``. Branches implement it.""" raise NotImplementedError(f"{type(self).__name__} does not implement _download") - def download_fileobj(self, path: str, file: BinaryIO, chunk_size: int = 128) -> None: + def download_fileobj( + self, path: str, file: BinaryIO, chunk_size: int = 128 + ) -> None: """Stream the file at ``path`` into the open binary ``file``.""" self._download(self._file_id(self._strip_protocol(path)), file, chunk_size) @@ -616,13 +716,17 @@ def upload_fileobj(self, path: str, file: BinaryIO, **options: Any): to give it and its parent is the container to put it in. Branches implement it.""" raise NotImplementedError(f"{type(self).__name__} cannot upload") - def cat_file(self, path: str, start: Optional[int] = None, end: Optional[int] = None, **kwargs) -> bytes: + def cat_file( + self, path: str, start: int | None = None, end: int | None = None, **kwargs + ) -> bytes: buffer = io.BytesIO() self.download_fileobj(path, buffer) data = buffer.getvalue() return data[start:end] if (start is not None or end is not None) else data - def get_file(self, rpath: str, lpath, callback=None, outfile=None, **kwargs) -> None: + def get_file( + self, rpath: str, lpath, callback=None, outfile=None, **kwargs + ) -> None: """Download straight into the local file, without the whole-file buffer ``open`` needs.""" if isinstance(lpath, (str, bytes)) or hasattr(lpath, "__fspath__"): rpath = self._strip_protocol(rpath) @@ -634,7 +738,9 @@ def get_file(self, rpath: str, lpath, callback=None, outfile=None, **kwargs) -> else: self.download_fileobj(rpath, lpath) - def put_file(self, lpath, rpath: str, callback=None, mode: str = "overwrite", **kwargs) -> None: + def put_file( + self, lpath, rpath: str, callback=None, mode: str = "overwrite", **kwargs + ) -> None: """Upload the local file as the RSpace file at ``rpath``.""" if os.path.isdir(lpath): # fsspec's put() hands directories through put_file as well, and relies on the @@ -644,8 +750,15 @@ def put_file(self, lpath, rpath: str, callback=None, mode: str = "overwrite", ** with open(lpath, "rb") as handle: self.upload_fileobj(rpath, handle, **kwargs) - def _open(self, path: str, mode: str = "rb", block_size=None, autocommit: bool = True, - cache_options=None, **kwargs): + def _open( + self, + path: str, + mode: str = "rb", + block_size=None, + autocommit: bool = True, + cache_options=None, + **kwargs, + ): """Reads buffer the whole file (RSpace serves no byte ranges). Writes buffer until the file is closed, or until the transaction commits, and upload in one request.""" path = self._strip_protocol(path) @@ -657,13 +770,15 @@ def _open(self, path: str, mode: str = "rb", block_size=None, autocommit: bool = raise IsADirectoryError(errno.EISDIR, f"{path!r} is a directory", path) if mode.startswith("x") and self.exists(path): raise FileExistsError(errno.EEXIST, f"{path!r} exists", path) - return RSpaceWriteFile(self, path, mode="wb", block_size=2 ** 62, autocommit=autocommit) + return RSpaceWriteFile( + self, path, mode="wb", block_size=2**62, autocommit=autocommit + ) raise ValueError(f"mode {mode!r} is not supported; use 'rb' or 'wb'") # ------------------------------------------------------------ folders (templates) @staticmethod - def _new_folder(path: str) -> Tuple[str, str]: + def _new_folder(path: str) -> tuple[str, str]: """``(parent path, folder name)`` for mkdir. 'New [GF1]' creates 'New', as does 'New'; a bare global ID is refused because it names nothing to create.""" segment = paths.last_segment(path) @@ -672,9 +787,15 @@ def _new_folder(path: str) -> Tuple[str, str]: raise ValueError(f"{path!r}: mkdir takes a folder name, not a global ID") return RSpaceFSBase._parent(path), label if gid is not None else segment - def _create_folder(self, path: str, name: str, siblings: Iterable[Mapping], - create: Callable[[], Mapping], folder_prefixes: Tuple[str, ...], - exist_ok: bool) -> str: + def _create_folder( + self, + path: str, + name: str, + siblings: Iterable[Mapping], + create: Callable[[], Mapping], + folder_prefixes: tuple[str, ...], + exist_ok: bool, + ) -> str: """Create ``name`` unless a folder of that name is already among ``siblings``. RSpace would happily make a second folder with the same name; the filesystem contract says to refuse instead (or, with ``exist_ok``, to return the existing one). Returns the @@ -690,8 +811,13 @@ def _create_folder(self, path: str, name: str, siblings: Iterable[Mapping], self.invalidate_cache() return self._join(parent, self._segment(name, gid)) - def _remove_folder(self, path: str, folder_gid: Optional[str], delete: Callable[[str], Any], - not_a_folder: Exception) -> None: + def _remove_folder( + self, + path: str, + folder_gid: str | None, + delete: Callable[[str], Any], + not_a_folder: Exception, + ) -> None: """Delete the empty folder at ``path``. ``folder_gid`` is its global ID, or None when the path is not a removable folder, in which case ``not_a_folder`` is raised.""" if paths.is_root(path): @@ -713,7 +839,9 @@ def makedirs(self, path: str, exist_ok: bool = False) -> None: path = self._strip_protocol(path) if exist_ok and self.exists(path): if not self.isdir(path): - raise FileExistsError(errno.EEXIST, f"{path!r} exists and is not a directory", path) + raise FileExistsError( + errno.EEXIST, f"{path!r} exists and is not a directory", path + ) return self.mkdir(path, create_parents=False, exist_ok=exist_ok) @@ -723,12 +851,12 @@ def rmdir(self, path: str) -> None: def rm_file(self, path: str) -> None: raise NotImplementedError(f"{type(self).__name__} cannot delete files") - def rm(self, path, recursive: bool = False, maxdepth: Optional[int] = None) -> None: + def rm(self, path, recursive: bool = False, maxdepth: int | None = None) -> None: """Remove files and empty directories. Recursive removal is refused: RSpace records are not something a filesystem should delete wholesale.""" if recursive: raise NotImplementedError("recursive removal is not supported on RSpace") - for one in ([path] if isinstance(path, str) else path): + for one in [path] if isinstance(path, str) else path: one = self._strip_protocol(one) if self._resolve(one).kind in self.FILE_KINDS: self.rm_file(one) @@ -737,7 +865,9 @@ def rm(self, path, recursive: bool = False, maxdepth: Optional[int] = None) -> N def link(self, path: str, media_file_gid: str) -> dict: """Attach a Gallery file by reference. Only the branches with ``CAN_LINK`` can.""" - raise NotImplementedError(f"{path!r}: the Gallery holds the files, it cannot link to them") + raise NotImplementedError( + f"{path!r}: the Gallery holds the files, it cannot link to them" + ) def cp_file(self, path1: str, path2: str, **kwargs) -> None: """Copy a file within this filesystem by downloading and uploading it.""" @@ -753,12 +883,19 @@ def _require_movable(self, path1: str, recursive: bool) -> None: if not self.CAN_DELETE_FILES: raise NotImplementedError( f"{path1!r} cannot be moved: the RSpace API cannot delete a Gallery file, so only " - f"a copy is possible") + f"a copy is possible" + ) if recursive: raise NotImplementedError("recursive move is not supported on RSpace") - def mv(self, path1: str, path2: str, recursive: bool = False, maxdepth: Optional[int] = None, - **kwargs) -> None: + def mv( + self, + path1: str, + path2: str, + recursive: bool = False, + maxdepth: int | None = None, + **kwargs, + ) -> None: self._require_writable(path2) self._require_movable(path1, recursive) self.cp_file(path1, path2) diff --git a/rspace_client/fs/gallery.py b/rspace_client/fs/gallery.py index 3315fb1..27bf6eb 100644 --- a/rspace_client/fs/gallery.py +++ b/rspace_client/fs/gallery.py @@ -22,19 +22,29 @@ (``on_mismatch="raise"``, the default) or lets RSpace place the file in the correct section and reports where it landed (``on_mismatch="reroute"``). """ + from __future__ import annotations import errno import logging +from collections.abc import Iterator, Mapping from dataclasses import dataclass -from typing import Any, BinaryIO, Iterator, Mapping, Optional +from typing import Any, BinaryIO from rspace_client.client_base import ClientBase from rspace_client.eln import eln from rspace_client.exceptions import RSpaceError from . import paths -from .base import RSpaceFSBase, Target, client_or_new, deletes, make_entry, stream_pages, writes +from .base import ( + RSpaceFSBase, + Target, + client_or_new, + deletes, + make_entry, + stream_pages, + writes, +) logger = logging.getLogger(__name__) @@ -61,29 +71,59 @@ # listed falls through to "Miscellaneous", matching the server default. _SECTION_BY_EXTENSION = { # Images - "png": "Images", "jpg": "Images", "jpeg": "Images", "gif": "Images", - "bmp": "Images", "tif": "Images", "tiff": "Images", + "png": "Images", + "jpg": "Images", + "jpeg": "Images", + "gif": "Images", + "bmp": "Images", + "tif": "Images", + "tiff": "Images", # Audios - "mp3": "Audios", "wav": "Audios", "wma": "Audios", "aac": "Audios", + "mp3": "Audios", + "wav": "Audios", + "wma": "Audios", + "aac": "Audios", "ogg": "Audios", # Videos - "mp4": "Videos", "mov": "Videos", "hdmov": "Videos", "m4v": "Videos", - "wmv": "Videos", "avi": "Videos", "mpg": "Videos", "mpeg": "Videos", - "flv": "Videos", "3gp": "Videos", + "mp4": "Videos", + "mov": "Videos", + "hdmov": "Videos", + "m4v": "Videos", + "wmv": "Videos", + "avi": "Videos", + "mpg": "Videos", + "mpeg": "Videos", + "flv": "Videos", + "3gp": "Videos", # Documents (a fixed set, NOT a catch-all) - "doc": "Documents", "docx": "Documents", "rtf": "Documents", - "pdf": "Documents", "odt": "Documents", "ods": "Documents", - "odp": "Documents", "txt": "Documents", "ppt": "Documents", - "pptx": "Documents", "xls": "Documents", "xlsx": "Documents", - "csv": "Documents", "pps": "Documents", "md": "Documents", + "doc": "Documents", + "docx": "Documents", + "rtf": "Documents", + "pdf": "Documents", + "odt": "Documents", + "ods": "Documents", + "odp": "Documents", + "txt": "Documents", + "ppt": "Documents", + "pptx": "Documents", + "xls": "Documents", + "xlsx": "Documents", + "csv": "Documents", + "pps": "Documents", + "md": "Documents", # Chemistry (documented subset; the server accepts more) - "skc": "Chemistry", "mrv": "Chemistry", "cxsmiles": "Chemistry", - "cxsmarts": "Chemistry", "cdx": "Chemistry", "cdxml": "Chemistry", - "csrdf": "Chemistry", "cml": "Chemistry", + "skc": "Chemistry", + "mrv": "Chemistry", + "cxsmiles": "Chemistry", + "cxsmarts": "Chemistry", + "cdx": "Chemistry", + "cdxml": "Chemistry", + "csrdf": "Chemistry", + "cml": "Chemistry", } -def classify_media_section(filename: Optional[str]) -> Optional[str]: +def classify_media_section(filename: str | None) -> str | None: """ Guess which Gallery section RSpace will file ``filename`` under, mirroring the server-side classification. Returns a section name (e.g. "Images"), @@ -106,7 +146,7 @@ def _a_or_an(word: str) -> str: def check_policy(on_mismatch: str) -> str: if on_mismatch not in _ON_MISMATCH_VALUES: - raise ValueError("on_mismatch must be one of {}".format(_ON_MISMATCH_VALUES)) + raise ValueError(f"on_mismatch must be one of {_ON_MISMATCH_VALUES}") return on_mismatch @@ -123,8 +163,15 @@ class GallerySectionMismatch(ClientBase.ApiError): fs_passthrough = True - def __init__(self, message, *, folder_section=None, folder_global_id=None, - file_media_type=None, response_status_code=None): + def __init__( + self, + message, + *, + folder_section=None, + folder_global_id=None, + file_media_type=None, + response_status_code=None, + ): super().__init__(message, response_status_code=response_status_code) self.folder_section = folder_section self.folder_global_id = folder_global_id @@ -139,15 +186,16 @@ class Placement: file could not go into the requested folder and RSpace filed it in the section its media type belongs to; ``path`` is a readable description of where that is. """ - file_global_id: Optional[str] - folder_global_id: Optional[str] - section: Optional[str] + + file_global_id: str | None + folder_global_id: str | None + section: str | None path: str rerouted: bool - requested_path: Optional[str] = None + requested_path: str | None = None -def folder_section(eln_client: eln.ELNClient, folder_id) -> Optional[str]: +def folder_section(eln_client: eln.ELNClient, folder_id) -> str | None: """The Gallery section (mediaType) a folder belongs to, or None if it cannot be determined. Best-effort: never raises, so it cannot mask the real outcome of an upload.""" try: @@ -160,14 +208,21 @@ def human_path(folder: Mapping[str, Any]) -> str: """Best-effort readable path for a folder, e.g. 'Gallery/Documents/Api Inbox'. Uses the API's pathToRootFolder when present, otherwise the section and folder name.""" trail = folder.get("pathToRootFolder") - names = [f.get("name") for f in trail if f.get("name")] if isinstance(trail, list) else [] + names = ( + [f.get("name") for f in trail if f.get("name")] + if isinstance(trail, list) + else [] + ) if names: return "/".join(names) - return "/".join(["Gallery"] + [folder[k] for k in ("mediaType", "name") if folder.get(k)]) + return "/".join( + ["Gallery"] + [folder[k] for k in ("mediaType", "name") if folder.get(k)] + ) -def placement(eln_client: eln.ELNClient, response: Any, requested_path: Optional[str], - rerouted: bool) -> Placement: +def placement( + eln_client: eln.ELNClient, response: Any, requested_path: str | None, rerouted: bool +) -> Placement: """Build a Placement from an upload response, resolving the parent folder for section/path feedback where possible. Tolerates a response that is not a dict (e.g. None): a caller may wrap ``upload_file`` and discard its return value, and Placement @@ -191,13 +246,20 @@ def placement(eln_client: eln.ELNClient, response: Any, requested_path: Optional ) -def mismatch_message(named: str, container: str, section: str, guessed: Optional[str], err: Exception) -> str: +def mismatch_message( + named: str, container: str, section: str, guessed: str | None, err: Exception +) -> str: """The explanation a person reads when a folder's section refuses their file.""" - message = (f"Could not upload {named} to Gallery folder {container or '/'}. That folder " - f"is in the '{section}' section, which only accepts {section} files") + message = ( + f"Could not upload {named} to Gallery folder {container or '/'}. That folder " + f"is in the '{section}' section, which only accepts {section} files" + ) if guessed and guessed != section: - looks = ("does not match a specialised section and belongs in 'Miscellaneous'" - if guessed == MISCELLANEOUS_SECTION else f"looks like {_a_or_an(guessed)} '{guessed}' file") + looks = ( + "does not match a specialised section and belongs in 'Miscellaneous'" + if guessed == MISCELLANEOUS_SECTION + else f"looks like {_a_or_an(guessed)} '{guessed}' file" + ) message += f", but {named} {looks}" remedy = f"Choose a folder in the '{guessed}' section instead" else: @@ -205,9 +267,11 @@ def mismatch_message(named: str, container: str, section: str, guessed: Optional # Lead with what the person in front of the screen can act on; the API-level option is # a parenthetical for library callers, who are not always the audience (this message # reaches Galaxy users verbatim). - return message + (f". {remedy}, or upload without choosing a folder and RSpace will file it in the " - f"right section itself (library callers can pass on_mismatch='reroute' to do that " - f"automatically). Original API error: {err}") + return message + ( + f". {remedy}, or upload without choosing a folder and RSpace will file it in the " + f"right section itself (library callers can pass on_mismatch='reroute' to do that " + f"automatically). Original API error: {err}" + ) class GalleryFilesystem(RSpaceFSBase): @@ -217,21 +281,36 @@ class GalleryFilesystem(RSpaceFSBase): FILE_KINDS = ("file",) CAN_DELETE_FILES = False # the RSpace API has no call to delete a Gallery file - def __init__(self, server: Optional[str] = None, api_key: Optional[str] = None, *, - eln_client: Optional[eln.ELNClient] = None, writable: bool = False, - allow_delete: bool = False, path_style: str = "name", - on_mismatch: str = ON_MISMATCH_RAISE, page_size: int = 100, - fetch_sizes: bool = True, **storage_options: Any) -> None: - super().__init__(writable=writable, allow_delete=allow_delete, path_style=path_style, - **storage_options) + def __init__( + self, + server: str | None = None, + api_key: str | None = None, + *, + eln_client: eln.ELNClient | None = None, + writable: bool = False, + allow_delete: bool = False, + path_style: str = "name", + on_mismatch: str = ON_MISMATCH_RAISE, + page_size: int = 100, + fetch_sizes: bool = True, + **storage_options: Any, + ) -> None: + super().__init__( + writable=writable, + allow_delete=allow_delete, + path_style=path_style, + **storage_options, + ) #: records fetched per API request while a listing is consumed, as in the other branches self.page_size = max(1, int(page_size)) - self.eln_client = client_or_new(eln_client, eln.ELNClient, server, api_key, "GalleryFilesystem") + self.eln_client = client_or_new( + eln_client, eln.ELNClient, server, api_key, "GalleryFilesystem" + ) self.on_mismatch = check_policy(on_mismatch) #: fetch each file's own record while listing, because the folder-tree endpoint #: carries no size (one extra request per file) self.fetch_sizes = fetch_sizes - self._gallery_id: Optional[int] = None + self._gallery_id: int | None = None # ------------------------------------------------------------ RSpace plumbing @@ -242,19 +321,25 @@ def gallery_id(self) -> int: # the Gallery root is a system folder with a GF id (the workspace branch hides it # by the same rule); a user's own folder named "Gallery" is an FL and is skipped for record in self._all_records(None): - if (record.get("name") == GALLERY_FOLDER_NAME - and str(record.get("globalId", "")).startswith("GF")): + if record.get("name") == GALLERY_FOLDER_NAME and str( + record.get("globalId", "") + ).startswith("GF"): self._gallery_id = int(record["id"]) break else: raise FileNotFoundError( - errno.ENOENT, f"no folder named {GALLERY_FOLDER_NAME!r} in the Home folder listing", "") + errno.ENOENT, + f"no folder named {GALLERY_FOLDER_NAME!r} in the Home folder listing", + "", + ) return self._gallery_id def _all_records(self, folder_id) -> Iterator[dict]: """Stream a folder's contents, following the tree listing's 'next' links only as far as the consumer reads.""" - first_page = self.eln_client.list_folder_tree(folder_id, page_size=self.page_size) + first_page = self.eln_client.list_folder_tree( + folder_id, page_size=self.page_size + ) return stream_pages(self.eln_client, first_page, "records") def _resolve(self, path: str) -> Target: @@ -290,50 +375,76 @@ def _scan_records(self, folder_id, want_sizes: bool) -> Iterator[dict]: # wanted: folder-tree items carry no size and consumers such as Galaxy require an # integer size for every file. for record in self._all_records(folder_id): - if want_sizes and record.get("globalId", "")[:2] == FILE_PREFIX and record.get("size") is None: + if ( + want_sizes + and record.get("globalId", "")[:2] == FILE_PREFIX + and record.get("size") is None + ): try: record = self.eln_client.get_file_info(record["id"]) - except ClientBase.ApiError: # keep listing even if one file cannot be read - logger.debug("could not read file details for %s", record.get("globalId")) + except ( + ClientBase.ApiError + ): # keep listing even if one file cannot be read + logger.debug( + "could not read file details for %s", record.get("globalId") + ) yield self._record_entry(record) def _info_of(self, path: str, target: Target) -> dict: if target.kind == "root": return make_entry("", True, raw={"name": GALLERY_FOLDER_NAME}) if target.kind == "folder": - return self._entry(self.eln_client.get_folder(target.gid[2:]), True, target.gid) + return self._entry( + self.eln_client.get_folder(target.gid[2:]), True, target.gid + ) return self._entry(self._placed_file(path, target), False, target.gid) def _placed_file(self, path: str, target: Target) -> dict: """The file's record, provided it sits in the folder the path names.""" record = self.eln_client.get_file_info(target.gid[2:]) - if str(record.get("parentFolderId")) != str(self._folder_id(self._parent(path))): - raise FileNotFoundError(errno.ENOENT, f"{path!r}: {target.gid} is not in this folder", path) + if str(record.get("parentFolderId")) != str( + self._folder_id(self._parent(path)) + ): + raise FileNotFoundError( + errno.ENOENT, f"{path!r}: {target.gid} is not in this folder", path + ) return record # ------------------------------------------------------------ folders @writes - def mkdir(self, path: str, create_parents: bool = True, exist_ok: bool = False, **kwargs) -> None: + def mkdir( + self, path: str, create_parents: bool = True, exist_ok: bool = False, **kwargs + ) -> None: path = self._strip_protocol(path) if paths.is_root(path): raise FileExistsError(errno.EEXIST, "the root exists", path) parent, name = self._new_folder(path) folder_id = self._folder_id(parent) - self._create_folder(path, name, self._all_records(folder_id), - lambda: self.eln_client.create_folder(name, folder_id), - FOLDER_PREFIXES, exist_ok) + self._create_folder( + path, + name, + self._all_records(folder_id), + lambda: self.eln_client.create_folder(name, folder_id), + FOLDER_PREFIXES, + exist_ok, + ) @deletes def rmdir(self, path: str) -> None: path = self._strip_protocol(path) target = self._resolve(path) - self._remove_folder(path, target.gid if target.kind == "folder" else None, - self.eln_client.delete_folder, - NotADirectoryError(errno.ENOTDIR, f"{path!r} is not a folder", path)) + self._remove_folder( + path, + target.gid if target.kind == "folder" else None, + self.eln_client.delete_folder, + NotADirectoryError(errno.ENOTDIR, f"{path!r} is not a folder", path), + ) def rm_file(self, path: str) -> None: - raise NotImplementedError("deleting Gallery files is not supported by the RSpace API") + raise NotImplementedError( + "deleting Gallery files is not supported by the RSpace API" + ) # ------------------------------------------------------------ files @@ -343,8 +454,9 @@ def _download(self, file_id: str, file: BinaryIO, chunk_size: int) -> None: # ------------------------------------------------------------ upload with section routing @writes - def upload_fileobj(self, path: str, file: BinaryIO, on_mismatch: Optional[str] = None, - **options: Any) -> Placement: + def upload_fileobj( + self, path: str, file: BinaryIO, on_mismatch: str | None = None, **options: Any + ) -> Placement: """ Write ``file`` to the Gallery file at ``path``: the last segment is the name to give the file and its parent is the folder to put it in. A file directly under the root @@ -368,11 +480,19 @@ def upload_fileobj(self, path: str, file: BinaryIO, on_mismatch: Optional[str] = container, name = self._upload_target(path) folder_id = None if paths.is_root(container) else self._folder_id(container) try: - response = self.eln_client.upload_file(file, folder_id, **self._upload_kwargs(name)) + response = self.eln_client.upload_file( + file, folder_id, **self._upload_kwargs(name) + ) self.invalidate_cache() - return placement(self.eln_client, response, requested_path=container, rerouted=False) + return placement( + self.eln_client, response, requested_path=container, rerouted=False + ) except ClientBase.ApiError as err: - section = None if folder_id is None else folder_section(self.eln_client, folder_id) + section = ( + None + if folder_id is None + else folder_section(self.eln_client, folder_id) + ) if section is None: raise filename = options.get("filename") or name @@ -383,12 +503,20 @@ def upload_fileobj(self, path: str, file: BinaryIO, on_mismatch: Optional[str] = file.seek(0) except (AttributeError, OSError, ValueError): pass - response = self.eln_client.upload_file(file, None, **self._upload_kwargs(name)) + response = self.eln_client.upload_file( + file, None, **self._upload_kwargs(name) + ) self.invalidate_cache() - placed = placement(self.eln_client, response, requested_path=container, rerouted=True) + placed = placement( + self.eln_client, response, requested_path=container, rerouted=True + ) logger.info( "RSpace Gallery: %s could not go in %s (section '%s'); placed in %s instead", - f"'{filename}'" if filename else "file", container, section, placed.path) + f"'{filename}'" if filename else "file", + container, + section, + placed.path, + ) return placed # `from None` rather than `from err`: this exception reaches people through @@ -397,7 +525,13 @@ def upload_fileobj(self, path: str, file: BinaryIO, on_mismatch: Optional[str] = # message, and the original error stays available on the exception's # attributes, so nothing is lost by not stacking three tracebacks. raise GallerySectionMismatch( - mismatch_message(f"'{filename}'" if filename else "the file", container, section, guessed, err), + mismatch_message( + f"'{filename}'" if filename else "the file", + container, + section, + guessed, + err, + ), folder_section=section, folder_global_id="GF" + str(folder_id), file_media_type=guessed, diff --git a/rspace_client/fs/inventory.py b/rspace_client/fs/inventory.py index 59e5e13..4c81331 100644 --- a/rspace_client/fs/inventory.py +++ b/rspace_client/fs/inventory.py @@ -34,17 +34,27 @@ collects the list). Read-only by default: ``writable=True`` allows attaching files to any record, ``allow_delete=True`` allows removing attachments. """ + from __future__ import annotations import errno -from typing import Any, BinaryIO, Iterator, Optional +from collections.abc import Iterator +from typing import Any, BinaryIO from rspace_client.client_base import Pagination from rspace_client.eln import eln from rspace_client.inv import inv from . import paths -from .base import RSpaceFSBase, Target, client_or_new, deletes, make_entry, stream_pages, writes +from .base import ( + RSpaceFSBase, + Target, + client_or_new, + deletes, + make_entry, + stream_pages, + writes, +) ATTACHMENT_PREFIX = "IF" FIELD_PREFIX = "SF" # a template-defined field on a sample, template or instrument @@ -82,15 +92,29 @@ class InventoryFilesystem(RSpaceFSBase): FILE_BEARING_FIELD_TYPES = ("attachment",) CAN_LINK = True - def __init__(self, server: Optional[str] = None, api_key: Optional[str] = None, *, - inv_client: Optional[inv.InventoryClient] = None, - eln_client: Optional[eln.ELNClient] = None, writable: bool = False, - allow_delete: bool = False, path_style: str = "name", - page_size: int = 100, via_gallery: Optional[bool] = None, - **storage_options: Any) -> None: - super().__init__(writable=writable, allow_delete=allow_delete, path_style=path_style, - **storage_options) - self.inv_client = client_or_new(inv_client, inv.InventoryClient, server, api_key, "InventoryFilesystem") + def __init__( + self, + server: str | None = None, + api_key: str | None = None, + *, + inv_client: inv.InventoryClient | None = None, + eln_client: eln.ELNClient | None = None, + writable: bool = False, + allow_delete: bool = False, + path_style: str = "name", + page_size: int = 100, + via_gallery: bool | None = None, + **storage_options: Any, + ) -> None: + super().__init__( + writable=writable, + allow_delete=allow_delete, + path_style=path_style, + **storage_options, + ) + self.inv_client = client_or_new( + inv_client, inv.InventoryClient, server, api_key, "InventoryFilesystem" + ) #: Put uploaded bytes in the Gallery and link them, rather than creating a file that #: exists only inside Inventory. See ``upload_fileobj``. Needs an ELN client as well #: as an Inventory one; left as None it turns itself on whenever one can be had, and @@ -102,7 +126,8 @@ def __init__(self, server: Optional[str] = None, api_key: Optional[str] = None, raise ValueError( "via_gallery=True needs an ELN client as well as an Inventory one: pass " "eln_client=, or server and api_key, or via_gallery=False to create files " - "that exist only inside Inventory") + "that exist only inside Inventory" + ) self.via_gallery = bool(eln_client) if via_gallery is None else via_gallery #: how many records to fetch per API request while streaming a listing; a #: performance knob, not something a user of the filesystem sees. @@ -114,9 +139,9 @@ def _resolve(self, path: str) -> Target: if paths.is_root(path): return Target("root") segments = paths.segments(path) - section: Optional[str] = None - previous_gid: Optional[str] = None - target: Optional[Target] = None + section: str | None = None + previous_gid: str | None = None + target: Target | None = None first = 0 if segments[0] in SECTIONS: section = segments[0] @@ -137,9 +162,15 @@ def _resolve(self, path: str) -> Target: continue if prefix not in RECORD_GETTERS: raise FileNotFoundError(errno.ENOENT, f"{path!r} not found", path) - shortcut = prefix == "SA" and previous_gid is not None and previous_gid.startswith("SS") + shortcut = ( + prefix == "SA" + and previous_gid is not None + and previous_gid.startswith("SS") + ) previous_gid = gid - target = Target("shortcut" if shortcut else "record", gid=gid, section=section) + target = Target( + "shortcut" if shortcut else "record", gid=gid, section=section + ) if target is None: raise FileNotFoundError(errno.ENOENT, f"{path!r} not found", path) return target @@ -160,16 +191,18 @@ def _record(self, gid: str) -> dict: def _section_items(self, section: str) -> Iterator[dict]: """Stream a section's records, fetching the next API page only when it is reached.""" method, key = SECTION_LISTERS[section] - first_page = getattr(self.inv_client, method)(Pagination(page_number=0, page_size=self.page_size)) + first_page = getattr(self.inv_client, method)( + Pagination(page_number=0, page_size=self.page_size) + ) return stream_pages(self.inv_client, first_page, key) # ------------------------------------------------------------ entry builders - def _file_entry(self, attachment: dict, gid: Optional[str] = None) -> dict: + def _file_entry(self, attachment: dict, gid: str | None = None) -> dict: return self._entry(attachment, False, gid) @staticmethod - def _virtual_dir(name: str, extra: Optional[dict] = None) -> dict: + def _virtual_dir(name: str, extra: dict | None = None) -> dict: raw = {"name": name, "virtual": True} raw.update(extra or {}) return make_entry(name, True, raw=raw) @@ -180,7 +213,11 @@ def _field_entry(self, field: dict) -> dict: return self._entry(raw, True) def _shortcut_entry(self, sample: dict) -> dict: - return self._entry(dict(sample, shortcut="sample"), True, name=f"sample: {sample.get('name', '')}") + return self._entry( + dict(sample, shortcut="sample"), + True, + name=f"sample: {sample.get('name', '')}", + ) # ------------------------------------------------------------ children of a directory @@ -188,7 +225,9 @@ def _children(self, target: Target, names_only: bool = False) -> Iterator[dict]: if target.kind == "root": return self._root_children() if target.kind == "section": - return (self._entry(item, True) for item in self._section_items(target.section)) + return ( + self._entry(item, True) for item in self._section_items(target.section) + ) if target.kind == "field": attachment = self._field(target.parent_gid, target.gid).get("attachment") return iter([self._file_entry(attachment)] if attachment else []) @@ -243,9 +282,14 @@ def _placed_file(self, path: str, target: Target) -> dict: (for a shortcut, the sample). A replaced field attachment is kept by the server as deleted, and is not there either.""" attachment = self.inv_client.get_attachment_by_id(target.gid[2:]) - if attachment.get("parentGlobalId") != target.parent_gid or attachment.get("deleted"): + if attachment.get("parentGlobalId") != target.parent_gid or attachment.get( + "deleted" + ): raise FileNotFoundError( - errno.ENOENT, f"{path!r}: {target.gid} is not attached to {target.parent_gid or 'this folder'}", path) + errno.ENOENT, + f"{path!r}: {target.gid} is not attached to {target.parent_gid or 'this folder'}", + path, + ) return attachment def _require_empty_field(self, target: Target, container: str) -> None: @@ -259,14 +303,18 @@ def _require_empty_field(self, target: Target, container: str) -> None: errno.EEXIST, f"{container!r} already holds {existing.get('name')!r}; an attachment field " f"takes a single file and adding another would replace it. Remove the existing " - f"file first.", container) + f"file first.", + container, + ) @deletes def rm_file(self, path: str) -> None: path = self._strip_protocol(path) target = self._resolve(path) if target.kind != "attachment": - raise IsADirectoryError(errno.EISDIR, f"{path!r} is not an attachment", path) + raise IsADirectoryError( + errno.EISDIR, f"{path!r} is not an attachment", path + ) self.inv_client.delete_attachment_by_id(target.gid[2:]) self.invalidate_cache() @@ -294,14 +342,16 @@ def upload_fileobj(self, path: str, file: BinaryIO, **options: Any) -> dict: self._require_empty_field(target, container) elif target.kind not in ("record", "shortcut"): raise NotImplementedError( - f"{container!r}: files attach to a record or one of its attachment fields") + f"{container!r}: files attach to a record or one of its attachment fields" + ) if target.gid[:2] not in ATTACHABLE_PREFIXES: # Checked before the Gallery upload: the server would refuse the link afterwards # and the uploaded file could never be deleted. raise NotImplementedError( f"{container!r}: RSpace does not accept attachments on " f"{'a bench' if target.gid[:2] == 'BE' else 'a sample template'}. " - f"Attach to a container, sample, subsample or instrument instead.") + f"Attach to a container, sample, subsample or instrument instead." + ) result = self._attach(target.gid, file, name) self.invalidate_cache() return result @@ -311,13 +361,16 @@ def _attach(self, parent_gid: str, file: BinaryIO, name: str) -> dict: ``via_gallery`` is off.""" if not self.via_gallery: return self.inv_client.upload_attachment_by_global_id( - parent_gid, file, **self._upload_kwargs(name)) + parent_gid, file, **self._upload_kwargs(name) + ) # No folder id: the Gallery files it into the section its media type belongs to, so # this cannot hit the section-mismatch rule that a chosen folder would. uploaded = self.eln_client.upload_file(file, **self._upload_kwargs(name)) # by global id, not through link(): a field global id does not resolve as a path on # its own, because a field is only addressable underneath its record. - return self.inv_client.attach_gallery_file_by_global_id(parent_gid, uploaded["globalId"]) + return self.inv_client.attach_gallery_file_by_global_id( + parent_gid, uploaded["globalId"] + ) @writes def link(self, path: str, media_file_gid: str) -> dict: @@ -327,9 +380,13 @@ def link(self, path: str, media_file_gid: str) -> dict: path = self._strip_protocol(path) target = self._resolve(path) if target.kind not in ("record", "shortcut", "field"): - raise NotImplementedError(f"{path!r}: a Gallery file links to a record or an attachment field") + raise NotImplementedError( + f"{path!r}: a Gallery file links to a record or an attachment field" + ) if target.kind == "field": self._require_empty_field(target, path) - result = self.inv_client.attach_gallery_file_by_global_id(target.gid, media_file_gid) + result = self.inv_client.attach_gallery_file_by_global_id( + target.gid, media_file_gid + ) self.invalidate_cache() return result diff --git a/rspace_client/fs/paths.py b/rspace_client/fs/paths.py index 0abb447..d0acf82 100644 --- a/rspace_client/fs/paths.py +++ b/rspace_client/fs/paths.py @@ -19,18 +19,19 @@ Each filesystem adds its own vocabulary on top of this (the Inventory sections, for instance); what lives here is only what all of them share. """ + from __future__ import annotations import re -from typing import Optional, Tuple - from posixpath import basename GLOBAL_ID = re.compile(r"^[A-Z]{2}\d+$") LABELLED = re.compile(r"^(?P