3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without tests # unit tests
8 Summary: Add options to doctest examples while they are running
9 Summary(pl.UTF-8): Dodawanie opcji do przykładów doctest w trakcie ich działania
10 Name: python-%{module}
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/dtopt/
16 Source0: https://files.pythonhosted.org/packages/source/d/dtopt/dtopt-%{version}.tar.gz
17 # Source0-md5: 9a41317149e926fcc408086aedee6bab
18 URL: https://pypi.org/project/dtopt/
20 BuildRequires: python-setuptools
23 BuildRequires: python3-devel >= 1:3.2
24 BuildRequires: python3-modules >= 1:3.2
25 BuildRequires: python3-setuptools
27 BuildRequires: rpm-pythonprov
28 BuildRequires: rpmbuild(macros) >= 1.714
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 dtopts adds options to doctest examples while they are running. When
34 using the doctest module it is often convenient to use the ELLIPSIS
35 option, which allows you to use ... as a wildcard. But you either have
36 to setup the test runner to use this option, or you must put
37 "#doctest: +ELLIPSIS" on every example that uses this feature. dtopt
38 lets you enable this option globally from within a doctest, by doing:
39 >>> from dtopt import ELLIPSIS
41 %description -l pl.UTF-8
42 dtopts dodaje opcje do przykładów doctest w trakcie ich działania.
43 Przy korzystaniu z modułu doctest często wygodne jest użycie opcji
44 ELLIPSIS, pozwalającej na użycie ... jako maski globalnej. Ale albo
45 trzeba konfigurować narzędzie uruchamiające do użycia tej opcji, albo
46 umieszczać "#doctest: +ELLIPSIS" przy każdym przykładzie używającym
47 tej opcji. dtopt pozwala włączyć tę opcję globalnie z poziomu doctest
49 >>> from dtopt import ELLIPSIS
51 %package -n python3-dtopt
52 Summary: Add options to doctest examples while they are running
53 Summary(pl.UTF-8): Dodawanie opcji do przykładów doctest w trakcie ich działania
54 Group: Libraries/Python
56 %description -n python3-dtopt
57 dtopts adds options to doctest examples while they are running. When
58 using the doctest module it is often convenient to use the ELLIPSIS
59 option, which allows you to use ... as a wildcard. But you either have
60 to setup the test runner to use this option, or you must put
61 "#doctest: +ELLIPSIS" on every example that uses this feature. dtopt
62 lets you enable this option globally from within a doctest, by doing:
63 >>> from dtopt import ELLIPSIS
65 %description -n python3-dtopt -l pl.UTF-8
66 dtopts dodaje opcje do przykładów doctest w trakcie ich działania.
67 Przy korzystaniu z modułu doctest często wygodne jest użycie opcji
68 ELLIPSIS, pozwalającej na użycie ... jako maski globalnej. Ale albo
69 trzeba konfigurować narzędzie uruchamiające do użycia tej opcji, albo
70 umieszczać "#doctest: +ELLIPSIS" przy każdym przykładzie używającym
71 tej opcji. dtopt pozwala włączyć tę opcję globalnie z poziomu doctest
73 >>> from dtopt import ELLIPSIS
76 %setup -q -n %{module}-%{version}
78 # Remove bundled egg info
87 %{__python} dtopt/tests.py
94 %if 0 && %{with tests}
95 # as of 0.1, uses python2 syntax
97 %{__python3} dtopt/tests.py 2>&1 | tee tests.log
99 grep -q ' 1 failures' tests.log
104 rm -rf $RPM_BUILD_ROOT
109 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/dtopt/tests.py*
116 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/dtopt/tests.py
117 # probably won't be compiled due to python2 syntax
118 rm -f $RPM_BUILD_ROOT%{py3_sitescriptdir}/dtopt/__pycache__/tests.cpython-*.py*
122 rm -rf $RPM_BUILD_ROOT
125 %defattr(644,root,root,755)
127 %{py_sitescriptdir}/dtopt
128 %{py_sitescriptdir}/dtopt-%{version}-py*.egg-info
131 %files -n python3-dtopt
132 %defattr(644,root,root,755)
134 %{py3_sitescriptdir}/dtopt
135 %{py3_sitescriptdir}/dtopt-%{version}-py*.egg-info