]>
Commit | Line | Data |
---|---|---|
bdab460e ER |
1 | # |
2 | # Conditional build: | |
7d5980d3 | 3 | %bcond_without tests # unit tests |
bdab460e | 4 | |
72030b27 | 5 | %define module docker |
b7e5dc8d | 6 | %define egg_name docker |
6f952153 | 7 | %define pypi_name docker |
45c3e8fc JB |
8 | Summary: A Python 2 library for the Docker Engine API |
9 | Summary(pl.UTF-8): Biblioteka Pythona 2 do API silnika Docker | |
bdab460e | 10 | Name: python-%{module} |
7d5980d3 JB |
11 | Version: 4.4.4 |
12 | Release: 3 | |
13 | Epoch: 1 | |
bdab460e ER |
14 | License: Apache v2.0 |
15 | Group: Libraries/Python | |
7d5980d3 JB |
16 | Source0: https://files.pythonhosted.org/packages/source/d/docker/%{pypi_name}-%{version}.tar.gz |
17 | # Source0-md5: e52f862b113d14c684a6e7dfa3d9e11c | |
b3671e57 | 18 | Patch0: unpin-requirements.patch |
bdab460e | 19 | URL: http://docker-py.readthedocs.org/ |
7d5980d3 JB |
20 | BuildRequires: python-modules >= 1:2.7 |
21 | BuildRequires: python-setuptools >= 1:42 | |
45c3e8fc | 22 | %if %{with tests} |
7d5980d3 JB |
23 | BuildRequires: python-ipaddress >= 1.0.16 |
24 | BuildRequires: python-backports-ssl_match_hostname >= 3.5 | |
45c3e8fc | 25 | BuildRequires: python-pytest >= 4.3.1 |
7d5980d3 JB |
26 | BuildRequires: python-pytest-timeout >= 1.3.3 |
27 | BuildRequires: python-requests >= 2.20.0 | |
28 | BuildRequires: python-six >= 1.10.0 | |
29 | BuildRequires: python-urllib3 >= 1.24.3 | |
30 | BuildRequires: python-websocket-client >= 0.56.0 | |
45c3e8fc | 31 | %endif |
7d5980d3 JB |
32 | BuildRequires: rpm-pythonprov |
33 | BuildRequires: rpmbuild(macros) >= 1.714 | |
2492f669 | 34 | BuildConflicts: python-docker < 2.0 |
99b90030 ER |
35 | # Docker can be remote, so suggest only |
36 | Suggests: docker >= 1.3.3 | |
e0043ac3 JP |
37 | # optional dep for ssh support (required by docker-compose) |
38 | Suggests: python-paramiko >= 2.4.2 | |
bdab460e ER |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
45c3e8fc | 43 | A Python library for the Docker Engine API. It lets you do anything |
6f952153 ER |
44 | the `docker` command does, but from within Python apps - run |
45 | containers, manage containers, manage Swarms, etc. | |
bdab460e | 46 | |
45c3e8fc JB |
47 | %description -l pl.UTF-8 |
48 | Biblioteka Pythona do API silnika Docker. Pozwala zrobić wszystko to, | |
49 | co polecenie "docker", ale z poziomu aplikacji w Pythonie: uruchamiać | |
50 | kontenery, zarządzać nimi, zarządzać Swarmami itp. | |
51 | ||
bdab460e | 52 | %prep |
6f952153 | 53 | %setup -q -n %{pypi_name}-%{version} |
99b90030 | 54 | %patch0 -p1 |
bdab460e | 55 | |
bdab460e | 56 | %build |
45c3e8fc JB |
57 | %py_build |
58 | ||
59 | %if %{with tests} | |
60 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
7d5980d3 | 61 | PYTEST_PLUGINS="pytest_timeout" \ |
45c3e8fc | 62 | PYTHONPATH=$(pwd) \ |
7d5980d3 | 63 | %{__python} -m pytest tests/unit -k 'not TCPSocketStreamTest' |
bdab460e ER |
64 | %endif |
65 | ||
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
7d5980d3 | 68 | |
e1c7d18e | 69 | %py_install |
bdab460e | 70 | |
7d5980d3 | 71 | %py_postclean |
bdab460e ER |
72 | |
73 | %clean | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
bdab460e ER |
76 | %files |
77 | %defattr(644,root,root,755) | |
78 | %doc LICENSE README.md | |
79 | %{py_sitescriptdir}/%{module} | |
72030b27 | 80 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |