]>
Commit | Line | Data |
---|---|---|
5c9c0f33 ER |
1 | # |
2 | # Conditional build: | |
dbf254af | 3 | %bcond_with doc # Sphinx documentation (not included in sdist) |
4c8a2e1b | 4 | %bcond_without tests # unit tests |
5c9c0f33 ER |
5 | |
6 | %define module iso8601 | |
7 | Summary: Simple module to parse ISO 8601 dates | |
6c5ec07f | 8 | Summary(pl.UTF-8): Prosty moduł do analizy dat ISO 8601 |
dbf254af JB |
9 | Name: python3-%{module} |
10 | Version: 1.0.2 | |
77210250 | 11 | Release: 3 |
5c9c0f33 | 12 | License: MIT |
6c5ec07f | 13 | Group: Development/Languages/Python |
a3e46659 | 14 | #Source0Download: https://pypi.org/simple/iso8601/ |
09f7179f | 15 | Source0: https://files.pythonhosted.org/packages/source/i/iso8601/%{module}-%{version}.tar.gz |
dbf254af | 16 | # Source0-md5: 51e301556c344ca8a7a27d83eef771ec |
9db94d01 | 17 | URL: https://bitbucket.org/micktwomey/pyiso8601 |
dbf254af JB |
18 | BuildRequires: python3-devel >= 1:3.6.2 |
19 | %{?with_tests:BuildRequires: python3-pytest >= 6.2.2} | |
20 | BuildRequires: python3-setuptools | |
6c5ec07f JB |
21 | BuildRequires: rpm-pythonprov |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
4c8a2e1b | 23 | %if %{with doc} |
dbf254af | 24 | BuildRequires: sphinx-pdg-3 >= 1.2.1 |
4c8a2e1b | 25 | %endif |
dbf254af | 26 | Requires: python3-modules >= 1:3.6.2 |
5c9c0f33 ER |
27 | BuildArch: noarch |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | This module parses the most common forms of ISO 8601 date strings | |
32 | (e.g. 2007-01-14T20:34:22+00:00) into datetime objects. | |
33 | ||
6c5ec07f JB |
34 | %description -l pl.UTF-8 |
35 | Ten moduł analizuje najbardziej popularne postaci łańcuchów dat ISO | |
36 | 8601 (np. 2007-01-14T20:34:22+00:00) i przekształca na obiekty | |
37 | datetime. | |
38 | ||
4c8a2e1b JB |
39 | %package apidocs |
40 | Summary: API documentation for Python iso8601 module | |
41 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona iso8601 | |
42 | Group: Documentation | |
43 | ||
44 | %description apidocs | |
45 | API documentation for Python iso8601 module. | |
46 | ||
47 | %description apidocs -l pl.UTF-8 | |
48 | Dokumentacja API modułu Pythona iso8601. | |
49 | ||
5c9c0f33 ER |
50 | %prep |
51 | %setup -qn %{module}-%{version} | |
52 | ||
53 | %build | |
09f7179f JB |
54 | %py3_build |
55 | ||
56 | %if %{with tests} | |
4c8a2e1b | 57 | %{__python3} -m pytest iso8601/test_iso8601.py |
09f7179f | 58 | %endif |
5c9c0f33 | 59 | |
4c8a2e1b JB |
60 | %if %{with doc} |
61 | %{__make} -C docs html \ | |
dbf254af | 62 | SPHINXBUILD=sphinx-build-3 |
4c8a2e1b JB |
63 | %endif |
64 | ||
5c9c0f33 ER |
65 | %install |
66 | rm -rf $RPM_BUILD_ROOT | |
6c5ec07f | 67 | |
6c5ec07f JB |
68 | %py3_install |
69 | ||
70 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/iso8601/test_* | |
5c9c0f33 ER |
71 | |
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
6c5ec07f | 77 | %doc LICENSE README.rst |
6c5ec07f JB |
78 | %{py3_sitescriptdir}/iso8601 |
79 | %{py3_sitescriptdir}/iso8601-%{version}-py*.egg-info | |
4c8a2e1b JB |
80 | |
81 | %if %{with doc} | |
82 | %files apidocs | |
83 | %defattr(644,root,root,755) | |
84 | %doc docs/_build/html/{_modules,_static,*.html,*.js} | |
85 | %endif |