]> git.pld-linux.org Git - packages/python-dtopt.git/blame - python-dtopt.spec
Require python3 modules for testing (distutils)
[packages/python-dtopt.git] / python-dtopt.spec
CommitLineData
b3660d75
ER
1#
2# Conditional build:
3%bcond_without python3 # CPython 3.x module
4%bcond_without tests # do not perform "make test"
5
6%define module dtopt
7Summary: Add options to doctest examples while they are running
8Name: python-%{module}
9Version: 0.1
10Release: 1
11License: MIT
12Group: Libraries/Python
13URL: http://pypi.python.org/pypi/dtopt/
14Source0: http://pypi.python.org/packages/source/d/dtopt/dtopt-%{version}.tar.gz
15# Source0-md5: 9a41317149e926fcc408086aedee6bab
16BuildRequires: python-distribute
17BuildRequires: rpm-pythonprov
18BuildRequires: rpmbuild(macros) >= 1.219
19%if %{with python3}
20BuildRequires: python3-devel
868f4860 21BuildRequires: python3-distribute
d6bdfa6d 22BuildRequires: python3-modules
b3660d75
ER
23%endif
24BuildArch: noarch
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27%description
28dtopts adds options to doctest examples while they are running. When
29using the doctest module it is often convenient to use the ELLIPSIS
30option, which allows you to use ... as a wildcard. But you either have
31to setup the test runner to use this option, or you must put #doctest:
32+ELLIPSIS on every example that uses this feature. dtopt lets you
33enable this option globally from within a doctest, by doing: >>> from
34dtopt import ELLIPSIS
35
36%package -n python3-dtopt
37Summary: Add options to doctest examples while they are running
38Group: Libraries/Python
39
40%description -n python3-dtopt
41dtopts adds options to doctest examples while they are running. When
42using the doctest module it is often convenient to use the ELLIPSIS
43option, which allows you to use ... as a wildcard. But you either have
44to setup the test runner to use this option, or you must put #doctest:
45+ELLIPSIS on every example that uses this feature. dtopt lets you
46enable this option globally from within a doctest, by doing: >>> from
47dtopt import ELLIPSIS
48
49%prep
50%setup -q -n %{module}-%{version}
51
52# Remove bundled egg info if it exists.
53rm -r *.egg-info
54
55%if %{with python3}
56rm -rf py3
57set -- *
58install -d py3
59cp -a "$@" py3
60# There is a print statement in the test that is not python3 compatible.
61rm py3/dtopt/tests.py*
62%endif
63
64%build
65%{__python} setup.py build
66
67%if %{with python3}
68cd py3
69%{__python3} setup.py build
70%endif
71
72%install
73rm -rf $RPM_BUILD_ROOT
74%{__python} setup.py install \
75 --skip-build \
76 --optimize=2 \
77 --root=$RPM_BUILD_ROOT
78
79%py_postclean
80
81%if %{with python3}
82cd py3
83%{__python3} setup.py install \
84 --skip-build \
85 --optimize=2 \
86 --root=$RPM_BUILD_ROOT
87%endif
88
89%clean
90rm -rf $RPM_BUILD_ROOT
91
92%files
93%defattr(644,root,root,755)
94%doc docs/*
95%{py_sitescriptdir}/%{module}
96%{py_sitescriptdir}/%{module}-*.egg-info
97
98%if %{with python3}
99%files -n python3-dtopt
100%defattr(644,root,root,755)
101%doc docs/*
102%{py3_sitescriptdir}/%{module}/*.py
103%{py3_sitescriptdir}/%{module}/__pycache__
104%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
105%endif
This page took 0.051015 seconds and 4 git commands to generate.