bea6365
# Sphinx-generated HTML documentation is not suitable for packaging; see
bea6365
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
bea6365
#
bea6365
# We can generate PDF documentation as a substitute.
bea6365
%bcond_without doc_pdf
bea6365
19e4e21
Name:           python-gcsfs
da1d555
Version:        2023.6.0
f3a0cf5
Release:        3%{?dist}
26b9aff
Summary:        Convenient Filesystem interface over GCS
26b9aff
d0e6454
License:        BSD-3-Clause
3e2742a
URL:            https://github.com/fsspec/gcsfs
1feacee
# We must use the GitHub archive rather than the PyPI sdist if we want to have
1feacee
# all the necessary files to build the Sphinx docs.
1feacee
Source0:        %{url}/archive/%{version}/gcsfs-%{version}.tar.gz
da1d555
# update versioneer, backported to latest tag
da1d555
# https://github.com/fsspec/gcsfs/pull/568
da1d555
Patch0:         0001-feat-update-versioneer.patch
26b9aff
BuildArch:      noarch
26b9aff
19e4e21
BuildRequires:  python3-devel
19e4e21
# Testing:
19e4e21
BuildRequires:  python3dist(pytest)
19e4e21
BuildRequires:  python3dist(vcrpy)
19e4e21
# Docs:
bea6365
%if %{with doc_pdf}
bea6365
BuildRequires:  make
19e4e21
BuildRequires:  python3dist(sphinx)
19e4e21
BuildRequires:  python3dist(sphinx-rtd-theme)
bea6365
BuildRequires:  python3-sphinx-latex
bea6365
BuildRequires:  latexmk
bea6365
%endif
19e4e21
26b9aff
%description
26b9aff
Pythonic file-system for Google Cloud Storage.
26b9aff
19e4e21
%package -n     python3-gcsfs
26b9aff
Summary:        %{summary}
26b9aff
19e4e21
%description -n python3-gcsfs
26b9aff
Pythonic file-system for Google Cloud Storage.
26b9aff
1feacee
%pyproject_extras_subpkg -n python3-gcsfs gcsfuse,crc
9adc8ec
19e4e21
%package -n python-gcsfs-doc
19e4e21
Summary:        Documentation for gcsfs
26b9aff
19e4e21
%description -n python-gcsfs-doc
19e4e21
Documentation for gcsfs.
26b9aff
26b9aff
%prep
da1d555
%autosetup -n gcsfs-%{version} -S patch -p1
1feacee
# Do not pin the exact corresponding version of fsspec; this makes sense on
1feacee
# PyPI since both are developed under the same organization and have
1feacee
# coordinated releases, but it’s unlikely we’ll be able to maintain this level
1feacee
# of coordination downstream, and it’s better to have “possible” breakage from
1feacee
# version skew than *guaranteed* breakage from version skew.
1feacee
sed -r -i 's/==.*//' requirements.txt
19e4e21
da1d555
%if %{with doc_pdf}
da1d555
# workaround latex's "Too deply nested error"
da1d555
sed -i.backup \
da1d555
'/latex_elements/ a\
da1d555
"maxlistdepth": "99",
da1d555
' docs/source/conf.py
da1d555
da1d555
%endif
da1d555
19e4e21
%generate_buildrequires
da1d555
%pyproject_buildrequires -x gcsfuse,crc
26b9aff
26b9aff
%build
19e4e21
%pyproject_wheel
26b9aff
26b9aff
%install
19e4e21
%pyproject_install
19e4e21
%pyproject_save_files gcsfs
bea6365
%if %{with doc_pdf}
bea6365
PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
bea6365
%make_build -C docs/build/latex LATEXMKOPTS='-quiet'
bea6365
%endif
26b9aff
26b9aff
%check
1feacee
# The package has tests, but nearly all require network access and/or cloud
1feacee
# resources, so we do an import-only “smoke test” instead.
1feacee
#
19e4e21
# gcsfs.cli.gcsfuse imports click (which is not otherwise required) and also
19e4e21
# tries to import a nonexistent 'gcsfs.gcsfuse' module; this seems like a bug
19e4e21
%pyproject_check_import -e 'gcsfs.cli.gcsfuse'
26b9aff
19e4e21
%files -n python3-gcsfs -f %{pyproject_files}
26b9aff
%doc README.rst
26b9aff
19e4e21
%files -n python-gcsfs-doc
bea6365
%if %{with doc_pdf}
bea6365
%doc docs/build/latex/GCSFs.pdf
bea6365
%endif
26b9aff
%license LICENSE.txt
26b9aff
26b9aff
%changelog
f3a0cf5
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2023.6.0-3
f3a0cf5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
f3a0cf5
7304ebb
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2023.6.0-2
7304ebb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
7304ebb
da1d555
* Fri Jul 21 2023 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2023.6.0-1
da1d555
- Update to latest release
da1d555
69a7dfa
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2022.11.0-4
69a7dfa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
69a7dfa
fbf0278
* Mon Jul 10 2023 Python Maint <python-maint@redhat.com> - 2022.11.0-3
fbf0278
- Rebuilt for Python 3.12
fbf0278
1fc8e47
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2022.11.0-2
1fc8e47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
1fc8e47
1feacee
* Wed Nov 23 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 2022.11.0-1
1feacee
- Update to 2022.11.0 (close RHBZ#2130978, close RHBZ#2136233)
1feacee
19e4e21
* Wed Nov 23 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.6.2-10
19e4e21
- Convert to pyproject-rpm-macros
9adc8ec
- Properly package the Extras subpackage for gcsfuse
d0e6454
- Update License to SPDX
3e2742a
- Update URL
bea6365
- Build Sphinx docs as PDF instead of HTML due to issues of bundling, etc.
24d63e6
- Fix spurious executable permission on pbr.json in dist-info
19e4e21
1958100
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.2-9
1958100
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
1958100
a2ff046
* Mon Jun 20 2022 Python Maint <python-maint@redhat.com> - 0.6.2-8
a2ff046
- Rebuilt for Python 3.11
a2ff046
f4b3f43
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.2-7
f4b3f43
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
f4b3f43
f4d6926
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.2-6
f4d6926
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
f4d6926
6fd158f
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.6.2-5
6fd158f
- Rebuilt for Python 3.10
6fd158f
03b1cc8
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.2-4
03b1cc8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
03b1cc8
cdb717f
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.2-3
cdb717f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
cdb717f
26b9aff
* Wed Jun 24 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.6.2-2
26b9aff
- Condition for tests
26b9aff
- Update BR (rhbz#1836686)
26b9aff
26b9aff
* Sun May 17 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.6.2-1
26b9aff
- Initial package for Fedora