%global pypi_name cloudpathlib Name: python-%{pypi_name} Version: 0.26.0 Release: 1%{?dist} Summary: pathlib-style classes for cloud storage services License: MIT URL: https://github.com/drivendataorg/cloudpathlib Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros %global _description %{expand: cloudpathlib gives Amazon S3, Google Cloud Storage, Azure Blob Storage and plain HTTP(S) locations the pathlib.Path interface, with transparent local caching of downloaded files. Each backend imports its cloud SDK only when it is used; the python3-cloudpathlib+s3, +gs and +azure packages pull in the SDK for one service. It is used by immlib and pyAFQ.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %pyproject_extras_subpkg -n python3-%{pypi_name} s3 gs azure %prep %autosetup -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires -x s3,gs,azure %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check # The sdist has no tests. Import everything (the three SDKs are installed), # construct a real client for each service without credentials, and exercise # the local mock backend, which implements the CloudPath interface on disk. %pyproject_check_import %{py3_test_envvars} %{python3} - <<'PYEOF' import tempfile from cloudpathlib import AnyPath, CloudPath from cloudpathlib.local import LocalS3Client, LocalS3Path c = LocalS3Client(local_storage_dir=tempfile.mkdtemp()) p = LocalS3Path("s3://bucket/dir/file.txt", client=c) p.write_text("hello") assert p.exists() and p.read_text() == "hello" assert [q.name for q in LocalS3Path("s3://bucket/dir", client=c).iterdir()] == ["file.txt"] assert (p.parent / "other.txt").key == "dir/other.txt" p.unlink(); assert not p.exists() import pathlib; assert isinstance(AnyPath("/tmp"), pathlib.Path) from cloudpathlib import S3Client, GSClient assert S3Client(no_sign_request=True).CloudPath("s3://b/k").bucket == "b" from google.cloud import storage assert GSClient(storage_client=storage.Client.create_anonymous_client()).CloudPath("gs://b/k").blob == "k" print("local backend ok") PYEOF %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Fri Oct 16 2026 Morgan Hough - 0.26.0-1 - Initial package (immlib dependency, pyAFQ chain), with the s3, gs and azure extras as subpackages.