3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
9 Summary: Simple module to parse ISO 8601 dates
10 Summary(pl.UTF-8): Prosty moduł do analizy dat ISO 8601
11 Name: python-%{module}
12 # keep 0.x here for python2 support
16 Group: Development/Languages/Python
17 #Source0Download: https://pypi.org/simple/iso8601/
18 Source0: https://files.pythonhosted.org/packages/source/i/iso8601/%{module}-%{version}.tar.gz
19 # Source0-md5: ffe057a29bbc9defec7fdcf75ce6e25f
20 URL: https://bitbucket.org/micktwomey/pyiso8601
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.714
24 BuildRequires: python-devel >= 1:2.6
25 %{?with_tests:BuildRequires: python-pytest >= 2.4.2}
26 BuildRequires: python-setuptools
29 BuildRequires: python3-devel >= 1:3.2
30 %{?with_tests:BuildRequires: python3-pytest >= 2.4.2}
31 BuildRequires: python3-setuptools
34 BuildRequires: sphinx-pdg-2 >= 1.2.1
36 Requires: python-modules >= 1:2.6
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 This module parses the most common forms of ISO 8601 date strings
42 (e.g. 2007-01-14T20:34:22+00:00) into datetime objects.
44 %description -l pl.UTF-8
45 Ten moduł analizuje najbardziej popularne postaci łańcuchów dat ISO
46 8601 (np. 2007-01-14T20:34:22+00:00) i przekształca na obiekty
49 %package -n python3-%{module}
50 Summary: Simple module to parse ISO 8601 dates
51 Summary(pl.UTF-8): Prosty moduł do analizy dat ISO 8601
52 Group: Development/Languages/Python
53 Requires: python3-modules >= 1:3.2
55 %description -n python3-%{module}
56 This module parses the most common forms of ISO 8601 date strings
57 (e.g. 2007-01-14T20:34:22+00:00) into datetime objects.
59 %description -n python3-%{module} -l pl.UTF-8
60 Ten moduł analizuje najbardziej popularne postaci łańcuchów dat ISO
61 8601 (np. 2007-01-14T20:34:22+00:00) i przekształca na obiekty
65 Summary: API documentation for Python iso8601 module
66 Summary(pl.UTF-8): Dokumentacja API modułu Pythona iso8601
70 API documentation for Python iso8601 module.
72 %description apidocs -l pl.UTF-8
73 Dokumentacja API modułu Pythona iso8601.
76 %setup -qn %{module}-%{version}
83 %{__python} -m pytest iso8601/test_iso8601.py
91 %{__python3} -m pytest iso8601/test_iso8601.py
96 %{__make} -C docs html \
97 SPHINXBUILD=sphinx-build-2
101 rm -rf $RPM_BUILD_ROOT
107 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/iso8601/test_*
113 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/iso8601/test_*
117 rm -rf $RPM_BUILD_ROOT
121 %defattr(644,root,root,755)
122 %doc LICENSE README.rst
123 %{py_sitescriptdir}/iso8601
124 %{py_sitescriptdir}/iso8601-%{version}-py*.egg-info
128 %files -n python3-%{module}
129 %defattr(644,root,root,755)
130 %doc LICENSE README.rst
131 %{py3_sitescriptdir}/iso8601
132 %{py3_sitescriptdir}/iso8601-%{version}-py*.egg-info
137 %defattr(644,root,root,755)
138 %doc docs/_build/html/{_modules,_static,*.html,*.js}