summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Dreyer <ktdreyer@ktdreyer.com>2015-04-03 11:26:18 -0600
committerKen Dreyer <ktdreyer@ktdreyer.com>2015-04-03 11:26:18 -0600
commit8eb72e08325b62a6e9b497dca925a50340b44afb (patch)
treec58eaf2e4f5abaecef6ed94bb19a489d1626b0fe
parent792d03a154d3f198cfbb0f712778d00715d3bd05 (diff)
downloadpython-testscenarios-8eb72e08325b62a6e9b497dca925a50340b44afb.tar.gz
python-testscenarios-8eb72e08325b62a6e9b497dca925a50340b44afb.tar.xz
python-testscenarios-8eb72e08325b62a6e9b497dca925a50340b44afb.zip
Add python3 support (RHBZ #1208889)python3
-rw-r--r--python-testscenarios.spec50
1 files changed, 49 insertions, 1 deletions
diff --git a/python-testscenarios.spec b/python-testscenarios.spec
index 702775d..5ddc178 100644
--- a/python-testscenarios.spec
+++ b/python-testscenarios.spec
@@ -1,8 +1,12 @@
+%if 0%{?fedora}
+%global with_python3 1
+%endif
+
%global pypi_name testscenarios
Name: python-%{pypi_name}
Version: 0.4
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Testscenarios, a pyunit extension for dependency injection
License: ASL 2.0 and BSD
@@ -13,6 +17,11 @@ BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
Requires: python-testtools
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-testtools
+%endif # with_python3
%description
testscenarios provides clean dependency injection for python unittest style
@@ -21,26 +30,65 @@ a single test suite) or for classic dependency injection (provide tests with
dependencies externally to the test code itself, allowing easy testing in
different situations).
+%if 0%{?with_python3}
+%package -n python3-%{pypi_name}
+Summary: Testscenarios, a pyunit extension for dependency injection
+Group: Development/Languages
+Requires: python3
+
+%description -n python3-%{pypi_name}
+testscenarios provides clean dependency injection for python unittest style
+tests. This can be used for interface testing (testing many implementations via
+a single test suite) or for classic dependency injection (provide tests with
+dependencies externally to the test code itself, allowing easy testing in
+different situations).
+%endif # with_python3
+
%prep
%setup -q -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
+%if 0%{?with_python3}
+cp -a . %{py3dir}
+%endif # with_python3
+
%build
%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
+
%install
%{__python} setup.py install --skip-build --root %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
+%endif # with_python3
+
%files
%doc Apache-2.0 BSD GOALS HACKING NEWS README doc/
%{python_sitelib}/%{pypi_name}
%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+%if 0%{?with_python3}
+%files -n python3-%{pypi_name}
+%doc Apache-2.0 BSD GOALS HACKING NEWS README doc/
+%{python3_sitelib}/*
+%endif # with_python3
+
%changelog
+* Fri Apr 03 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.4-5
+- Add python3 support (RHBZ #1208889)
+
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild