diff --git a/python-docker.spec b/python-docker.spec index e2f7963..c21c50b 100644 --- a/python-docker.spec +++ b/python-docker.spec @@ -43,16 +43,6 @@ Summary: A Python library for the Docker Engine API BuildRequires: python2-devel BuildRequires: python%{?fedora:2}-setuptools -%if %{with tests} -BuildRequires: python2-mock >= 1.0.1 -BuildRequires: %{?fedora:python2-}pytest >= 2.9.1 -BuildRequires: python%{?fedora:2}-requests >= 2.14.2 -BuildRequires: python%{?fedora:2}-six >= 1.4.0 -BuildRequires: python%{?fedora:2}-websocket-client >= 0.32.0 -BuildRequires: python%{?fedora:2}-docker-pycreds >= 0.2.1 -BuildRequires: python%{?fedora:2}-backports-ssl_match_hostname >= 3.5 -BuildRequires: python%{?fedora:2}-ipaddress >= 1.0.16 -%endif # tests Requires: python%{?fedora:2}-requests >= 2.14.2 Requires: python%{?fedora:2}-six >= 1.4.0 Requires: python%{?fedora:2}-websocket-client >= 0.32.0 @@ -70,34 +60,15 @@ It lets you do anything the docker command does, but from within Python apps – run containers, manage containers, manage Swarms, etc. %endif # with python2 -%if %{with python2} %if %{with tests} -%package -n python2-%{srcname}-tests +%package -n python-%{srcname}-tests Summary: Unit tests and integration tests for python-docker -%{?python_provide:%python_provide python2-%{srcname}-tests} - -Requires: python2-%{srcname} -Requires: python2-mock >= 1.0.1 -Requires: %{?fedora:python2-}pytest >= 2.9.1 -Requires: python%{?fedora:2}-requests >= 2.14.2 -Requires: python%{?fedora:2}-six >= 1.4.0 -Requires: python%{?fedora:2}-websocket-client >= 0.32.0 -Requires: python%{?fedora:2}-docker-pycreds >= 0.2.1 -Requires: python%{?fedora:2}-backports-ssl_match_hostname >= 3.5 -Requires: python%{?fedora:2}-ipaddress >= 1.0.16 -Requires: python%{?fedora:2}-pyOpenSSL -Requires: python%{?fedora:2}-idna -Requires: python%{?fedora:2}-cryptography - -# Remove at Fedora 31 -Provides: python-%{srcname}-tests = %{version}-%{release} -Obsoletes: python-%{srcname}-tests < %{version}-%{release} +%{?python_provide:%python_provide python-%{srcname}-tests} -%description -n python2-%{srcname}-tests +%description -n python-%{srcname}-tests Upstream test-suite (unit, integration) packaged as RPM. %endif # tests -%endif # with python2 %if %{with python3} %package -n python3-%{srcname} @@ -106,14 +77,6 @@ Summary: A Python library for the Docker Engine API BuildRequires: python3-devel BuildRequires: python3-setuptools -%if %{with tests} -BuildRequires: python3-mock >= 1.0.1 -BuildRequires: python3-pytest >= 2.9.1 -BuildRequires: python3-requests >= 2.14.2 -BuildRequires: python3-six >= 1.4.0 -BuildRequires: python3-websocket-client >= 0.32.0 -BuildRequires: python3-docker-pycreds >= 0.2.1 -%endif # tests Requires: python3-requests >= 2.14.2 Requires: python3-six >= 1.4.0 Requires: python3-websocket-client >= 0.32.0 @@ -155,26 +118,12 @@ rm -fr docker.egg-info %py3_install %endif # with_python3 -%if %{with python2} %if %{with tests} # copy tests to /usr/libexec/installed-tests mkdir -p %{buildroot}%{_libexecdir}/installed-tests/%{name} cp -avr tests/ %{buildroot}%{_libexecdir}/installed-tests/%{name}/ %endif # tests -%endif # with python2 - -%check -%if %{with python2} -%if %{with tests} -%{__python2} -m pytest -v tests/unit/ -%endif # tests -%endif # with python2 -%if %{with python3} -%if %{with tests} -%{__python3} -m pytest -v tests/unit/ -%endif # tests -%endif # with_python3 %if %{with python2} %files -n python2-%{srcname} @@ -190,12 +139,10 @@ cp -avr tests/ %{buildroot}%{_libexecdir}/installed-tests/%{name}/ %{python3_sitelib}/* %endif # with_python3 -%if %{with python2} %if %{with tests} -%files -n python2-%{srcname}-tests +%files -n python-%{srcname}-tests %{_libexecdir}/installed-tests %endif # tests -%endif # with python2 %changelog * Sat Aug 11 2018 Tomas Tomecek - 3.5.0-1 diff --git a/tests/tests.yml b/tests/tests.yml index ca82d2d..ea4b523 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -24,7 +24,8 @@ run: pytest-3 -v /usr/libexec/installed-tests/python-docker/tests/integration/ required_packages: - python-docker-tests + - python3-mock - python3-pytest - python3-docker - - docker + - docker # TODO: dont install when in a container required_services: '{{ req_services }}'