[packages/python-arrow] - updated to 0.17.0, added tests and -apidocs
qboosh
qboosh at pld-linux.org
Tue Jul 15 21:33:20 CEST 2025
commit c99652f0e66b264f6585362c3c2c0be5876dda4b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Jul 15 21:34:55 2025 +0200
- updated to 0.17.0, added tests and -apidocs
python-arrow.spec | 133 ++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 105 insertions(+), 28 deletions(-)
---
diff --git a/python-arrow.spec b/python-arrow.spec
index 494e660..fcc4199 100644
--- a/python-arrow.spec
+++ b/python-arrow.spec
@@ -1,34 +1,56 @@
#
# Conditional build:
+%bcond_without doc # Sphinx documentation
+%bcond_without tests # unit tests
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
-## Disable the tests as apparently the version 0.4.2 does not ship them
-%bcond_with tests # do not perform "make test"
%define module arrow
Summary: Better dates and times for Python
+Summary(pl.UTF-8): Lepsze daty i czasy dla Pythona
Name: python-%{module}
-Version: 0.4.2
-Release: 14
+# keep 0.x here for python2 support
+Version: 0.17.0
+Release: 1
License: Apache v2.0
-Group: Development/Libraries
-Source0: http://pypi.python.org/packages/source/a/%{module}/%{module}-%{version}.tar.gz
-# Source0-md5: 5caa8442fd3a84a5ad0155a1f626ef1d
-URL: http://pypi.python.org/pypi/arrow
-BuildRequires: rpmbuild(macros) >= 1.710
-BuildRequires: rpm-pythonprov
+Group: Libraries/Python
+#Source0Download: https://pypi.org/simple/arrow/
+Source0: https://files.pythonhosted.org/packages/source/a/arrow/%{module}-%{version}.tar.gz
+# Source0-md5: 76d66d0d03effad1407fb4dcebce9566
+URL: https://pypi.org/project/arrow/
%if %{with python2}
-BuildRequires: python-chai
-BuildRequires: python-dateutil
-BuildRequires: python-distribute
-BuildRequires: python-modules
-BuildRequires: python-six
+BuildRequires: python-modules >= 1:2.7
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-backports.functools_lru_cache >= 1.2.1
+# optional
+BuildRequires: python-dateparser >= 0.7
+BuildRequires: python-dateutil >= 2.7.0
+BuildRequires: python-pytest >= 4.6
+BuildRequires: python-pytest-mock >= 2.0
+BuildRequires: python-pytz >= 2019
+BuildRequires: python-simplejson
+%endif
%endif
%if %{with python3}
-BuildRequires: python3-modules
+BuildRequires: python3-modules >= 1:3.5
+BuildRequires: python3-setuptools
+%if %{with tests}
+# optional
+BuildRequires: python3-dateparser >= 0.7
+BuildRequires: python3-dateutil >= 2.7.0
+BuildRequires: python3-pytest >= 6.0
+BuildRequires: python3-pytest-mock >= 3.2
+BuildRequires: python3-pytz >= 2019
+BuildRequires: python3-simplejson
+%endif
%endif
-Requires: python-dateutil
-Requires: python-six
+BuildRequires: rpmbuild(macros) >= 1.714
+BuildRequires: rpm-pythonprov
+%if %{with doc}
+BuildRequires: sphinx-pdg-2 >= 1.8
+%endif
+Requires: python-modules >= 1:2.7
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -42,11 +64,21 @@ that supports many common creation scenarios.
Simply put, it helps you work with dates and times with fewer imports
and a lot less code.
+%description -l pl.UTF-8
+Arrow to biblioteka Pythona oferująca sensowne, przyjazne dla
+człowieka podejście do tworzenia, operowania, formatowania i
+konwertowania dat, czasów i znaczników czasu. Implementuje i
+uaktualnia typ datetime, łatając luki w funkcjonalności oraz zapewnia
+inteligentne API modułu, obsługujące wiele scenariuszy tworzenia.
+
+Mówiąc prosto, pozwala pracować z datami i czasami z mniejszą liczbą
+importów i znacznie mniejszą ilością kodu.
+
%package -n python3-arrow
Summary: Better dates and times for Python
-Group: Development/Libraries
-Requires: python3-dateutil
-Requires: python3-six
+Summary(pl.UTF-8): Lepsze daty i czasy dla Pythona
+Group: Libraries/Python
+Requires: python3-modules >= 1:3.5
%description -n python3-arrow
Arrow is a Python library that offers a sensible, human-friendly
@@ -58,19 +90,57 @@ that supports many common creation scenarios.
Simply put, it helps you work with dates and times with fewer imports
and a lot less code.
+%description -n python3-arrow -l pl.UTF-8
+Arrow to biblioteka Pythona oferująca sensowne, przyjazne dla
+człowieka podejście do tworzenia, operowania, formatowania i
+konwertowania dat, czasów i znaczników czasu. Implementuje i
+uaktualnia typ datetime, łatając luki w funkcjonalności oraz zapewnia
+inteligentne API modułu, obsługujące wiele scenariuszy tworzenia.
+
+Mówiąc prosto, pozwala pracować z datami i czasami z mniejszą liczbą
+importów i znacznie mniejszą ilością kodu.
+
+%package apidocs
+Summary: API documentation for Python arrow module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona arrow
+Group: Documentation
+
+%description apidocs
+API documentation for Python arrow module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona arrow.
+
%prep
%setup -q -n %{module}-%{version}
-# Remove bundled egg-info in case it exists
-rm -r %{module}.egg-info
+# Remove bundled egg-info
+%{__rm} -r %{module}.egg-info
%build
%if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS=pytest_cov.plugin,pytest_mock.plugin \
+%{__python} -m pytest tests
+%endif
%endif
%if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS=pytest_cov.plugin,pytest_mock.plugin \
+%{__python3} -m pytest tests
+%endif
+%endif
+
+%if %{with doc}
+%{__make} -C docs html \
+ SPHINXBUILD=sphinx-build-2
%endif
%install
@@ -89,17 +159,24 @@ rm -rf $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%files
%defattr(644,root,root,755)
-# pr pending https://github.com/crsmithdev/arrow/pull/70
-#%doc LICENSE README.md HISTORY.md
+%doc CHANGELOG.rst README.rst
%{py_sitescriptdir}/arrow
%{py_sitescriptdir}/arrow-%{version}-py*.egg-info
+%endif
%if %{with python3}
%files -n python3-%{module}
%defattr(644,root,root,755)
-#%doc LICENSE README.md HISTORY.md
+%doc CHANGELOG.rst README.rst
%{py3_sitescriptdir}/arrow
%{py3_sitescriptdir}/arrow-%{version}-py*.egg-info
%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-arrow.git/commitdiff/c99652f0e66b264f6585362c3c2c0be5876dda4b
More information about the pld-cvs-commit
mailing list