]>
Commit | Line | Data |
---|---|---|
491d315c | 1 | # TODO: finish doc and tests (BRs) |
059ee964 JK |
2 | # |
3 | # Conditional build: | |
b9bca61e | 4 | %bcond_with doc # Sphinx documentation |
491d315c | 5 | %bcond_with tests # pytest tests |
059ee964 JK |
6 | %bcond_without python2 # CPython 2.x module |
7 | %bcond_without python3 # CPython 3.x module | |
8 | ||
9 | %define module virtualenv | |
74c7b14d | 10 | Summary: Tool to create isolated Python environments |
d91e0815 | 11 | Summary(pl.UTF-8): Narzędzie do tworzenia oddzielonych środowisk Pythona |
74c7b14d | 12 | Name: python-virtualenv |
b9bca61e | 13 | Version: 20.13.0 |
fa12a7ac | 14 | Release: 3 |
74c7b14d PZ |
15 | License: MIT |
16 | Group: Development/Languages | |
1ace5ffd | 17 | #Source0Download: https://pypi.org/simple/virtualenv/ |
c49c046d | 18 | Source0: https://files.pythonhosted.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz |
b9bca61e | 19 | # Source0-md5: 95176f0639dc033650f0f3f9fdff299e |
220a0db6 | 20 | Patch0: multilib.patch |
1ace5ffd | 21 | URL: https://pypi.org/project/virtualenv/ |
059ee964 | 22 | %if %{with python2} |
1ace5ffd | 23 | BuildRequires: python >= 1:2.7 |
4beaafdc | 24 | BuildRequires: python-modules >= 1:2.7.10-6 |
491d315c JB |
25 | BuildRequires: python-setuptools >= 1:41 |
26 | BuildRequires: python-setuptools_scm >= 2 | |
1ace5ffd | 27 | %if %{with tests} |
491d315c | 28 | # runtime dependencies |
95fd94cd | 29 | BuildRequires: python-distlib >= 0.3.1 |
491d315c | 30 | BuildRequires: python-distlib < 1 |
95fd94cd | 31 | BuildRequires: python-filelock >= 3.2 |
491d315c JB |
32 | BuildRequires: python-filelock < 4 |
33 | BuildRequires: python-importlib_metadata >= 0.12 | |
34 | BuildRequires: python-importlib_resources >= 1.0 | |
95fd94cd | 35 | BuildRequires: python-pathlib2 >= 2.3.3 |
491d315c | 36 | BuildRequires: python-pathlib2 < 3 |
95fd94cd | 37 | BuildRequires: python-platformdirs >= 2 |
491d315c | 38 | BuildRequires: python-platformdirs < 3 |
95fd94cd | 39 | BuildRequires: python-six >= 1.9 |
491d315c JB |
40 | BuildRequires: python-six < 2 |
41 | # test-only dependencies | |
42 | BuildRequires: python-coverage >= 4 | |
43 | BuildRequires: python-coverage-enable-subprocess >= 1 | |
44 | BuildRequires: python-flaky >= 3 | |
45 | BuildRequires: python-pytest >= 4 | |
46 | BuildRequires: python-pytest-env >= 0.6.2 | |
47 | BuildRequires: python-pytest-freezegun >= 0.4.1 | |
48 | BuildRequires: python-pytest-mock >= 2 | |
49 | BuildRequires: python-pytest-randomly >= 1 | |
50 | BuildRequires: python-pytest-timeout >= 1 | |
1ace5ffd | 51 | %endif |
059ee964 JK |
52 | %endif |
53 | %if %{with python3} | |
491d315c | 54 | BuildRequires: python3 >= 1:3.5 |
4beaafdc | 55 | BuildRequires: python3-modules >= 1:3.5.0-6 |
491d315c JB |
56 | BuildRequires: python3-setuptools >= 1:41 |
57 | BuildRequires: python3-setuptools_scm >= 2 | |
1ace5ffd | 58 | %if %{with tests} |
491d315c | 59 | # runtime dependencies |
95fd94cd | 60 | BuildRequires: python3-distlib >= 0.3.1 |
491d315c | 61 | BuildRequires: python3-distlib < 1 |
95fd94cd | 62 | BuildRequires: python3-filelock >= 3.2 |
491d315c JB |
63 | BuildRequires: python3-filelock < 4 |
64 | %if "%{py3_ver}" < "3.8" | |
65 | BuildRequires: python3-importlib-metadata >= 0.12 | |
66 | %endif | |
67 | %if "%{py3_ver}" < "3.7" | |
68 | BuildRequires: python3-importlib-resources >= 1.0 | |
69 | %endif | |
95fd94cd | 70 | BuildRequires: python3-platformdirs >= 2 |
491d315c | 71 | BuildRequires: python3-platformdirs < 3 |
1ace5ffd | 72 | BuildRequires: python3-pytest |
95fd94cd | 73 | BuildRequires: python3-six >= 1.9 |
491d315c JB |
74 | BuildRequires: python3-six < 2 |
75 | # test-only dependencies | |
76 | BuildRequires: python-coverage >= 4 | |
77 | BuildRequires: python-coverage-enable-subprocess >= 1 | |
78 | BuildRequires: python-flaky >= 3 | |
79 | BuildRequires: python-packaging >= 20.0 | |
80 | BuildRequires: python-pytest >= 4 | |
81 | BuildRequires: python-pytest-env >= 0.6.2 | |
82 | BuildRequires: python-pytest-freezegun >= 0.4.1 | |
83 | BuildRequires: python-pytest-mock >= 2 | |
84 | BuildRequires: python-pytest-randomly >= 1 | |
85 | BuildRequires: python-pytest-timeout >= 1 | |
1ace5ffd | 86 | %endif |
059ee964 | 87 | %endif |
7cef4d31 | 88 | %if %{with doc} |
491d315c JB |
89 | BuildRequires: python3-sphinx-argparse >= 0.2.5 |
90 | BuildRequires: python3-sphinx_rtd_theme >= 0.4.3 | |
91 | BuildRequires: python3-proselint >= 0.10.2 | |
92 | BuildRequires: python3-towncrier >= 21.3 | |
93 | BuildRequires: sphinx-pdg >= 3 | |
7cef4d31 | 94 | %endif |
91a4a405 | 95 | BuildRequires: rpm-pythonprov |
48d5306d | 96 | BuildRequires: rpmbuild(macros) >= 1.714 |
4577d65b JR |
97 | # Blame binary-only python packages authors |
98 | # virtualenv wants *.py | |
1ace5ffd | 99 | Requires: python-devel-src >= 1:2.7 |
b9bca61e JP |
100 | Requires: python-distlib >= 0.3.1 |
101 | Requires: python-filelock >= 3.2 | |
ee159451 | 102 | Requires: python-pathlib2 >= 2.3.3 |
b9bca61e | 103 | Requires: python-platformdirs >= 2 |
c49c046d JB |
104 | # for virtualenv-2 wrapper |
105 | Requires: python-setuptools | |
b9bca61e | 106 | Requires: python-six >= 1.9 |
74c7b14d PZ |
107 | BuildArch: noarch |
108 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
109 | ||
110 | %description | |
111 | virtualenv is a tool to create isolated Python environments. | |
112 | virtualenv is a successor to workingenv, and an extension of | |
113 | virtual-python. It is written by Ian Bicking, and sponsored by the | |
114 | Open Planning Project. It is licensed under an MIT-style permissive | |
115 | license. | |
116 | ||
d91e0815 JB |
117 | %description -l pl.UTF-8 |
118 | virtualenv to narzędzie do tworzenia oddzielonych środowisk Pythona. | |
119 | Jest to następca workignenv i rozszerzenie virtual-pythona. Jest | |
120 | tworzone przez Iana Bickinga i sponsorowane przez Open Planning | |
121 | Project. Zostało wydane na liberalnej licencji w stylu MIT. | |
122 | ||
059ee964 JK |
123 | %package -n python3-%{module} |
124 | Summary: Tool to create isolated Python environments | |
125 | Summary(pl.UTF-8): Narzędzie do tworzenia oddzielonych środowisk Pythona | |
126 | Group: Libraries/Python | |
b9bca61e JP |
127 | Requires: python3-distlib >= 0.3.1 |
128 | Requires: python3-filelock >= 3.2 | |
1ace5ffd | 129 | Requires: python3-modules >= 1:3.4 |
b9bca61e | 130 | Requires: python3-platformdirs >= 2 |
c49c046d JB |
131 | # for virtualenv-3 wrapper |
132 | Requires: python3-setuptools | |
b9bca61e | 133 | Requires: python3-six >= 1.9 |
059ee964 JK |
134 | |
135 | %description -n python3-%{module} | |
136 | virtualenv is a tool to create isolated Python environments. | |
137 | virtualenv is a successor to workingenv, and an extension of | |
138 | virtual-python. It is written by Ian Bicking, and sponsored by the | |
139 | Open Planning Project. It is licensed under an MIT-style permissive | |
140 | license. | |
141 | ||
142 | %description -n python3-%{module} -l pl.UTF-8 | |
143 | virtualenv to narzędzie do tworzenia oddzielonych środowisk Pythona. | |
144 | Jest to następca workignenv i rozszerzenie virtual-pythona. Jest | |
145 | tworzone przez Iana Bickinga i sponsorowane przez Open Planning | |
146 | Project. Zostało wydane na liberalnej licencji w stylu MIT. | |
147 | ||
4beaafdc JK |
148 | %package -n virtualenv |
149 | Summary: Tool to create isolated Python environments | |
150 | Summary(pl.UTF-8): Narzędzie do tworzenia oddzielonych środowisk Pythona | |
151 | Group: Libraries/Python | |
152 | %if %{with python3} | |
153 | Requires: python3-virtualenv = %{version}-%{release} | |
154 | %else | |
155 | Requires: python-virtualenv = %{version}-%{release} | |
156 | %endif | |
4577d65b | 157 | |
4beaafdc JK |
158 | %description -n virtualenv |
159 | virtualenv is a tool to create isolated Python environments. | |
160 | virtualenv is a successor to workingenv, and an extension of | |
161 | virtual-python. It is written by Ian Bicking, and sponsored by the | |
162 | Open Planning Project. It is licensed under an MIT-style permissive | |
163 | license. | |
4577d65b | 164 | |
4beaafdc JK |
165 | %description -n virtualenv -l pl.UTF-8 |
166 | virtualenv to narzędzie do tworzenia oddzielonych środowisk Pythona. | |
167 | Jest to następca workignenv i rozszerzenie virtual-pythona. Jest | |
168 | tworzone przez Iana Bickinga i sponsorowane przez Open Planning | |
169 | Project. Zostało wydane na liberalnej licencji w stylu MIT. | |
4577d65b | 170 | |
4beaafdc JK |
171 | %prep |
172 | %setup -q -n virtualenv-%{version} | |
220a0db6 | 173 | %patch0 -p1 |
74c7b14d PZ |
174 | |
175 | %build | |
059ee964 | 176 | %if %{with python2} |
491d315c JB |
177 | %py_build |
178 | ||
179 | %if %{with tests} | |
180 | %{__python} -m pytest tests | |
181 | %endif | |
059ee964 JK |
182 | %endif |
183 | ||
184 | %if %{with python3} | |
491d315c JB |
185 | %py3_build |
186 | ||
187 | %if %{with tests} | |
188 | %{__python3} -m pytest tests | |
189 | %endif | |
059ee964 | 190 | %endif |
74c7b14d | 191 | |
059ee964 | 192 | %if %{with doc} |
c49c046d | 193 | %{__make} -C docs text |
059ee964 | 194 | %endif |
a7ec8cea | 195 | |
74c7b14d PZ |
196 | %install |
197 | rm -rf $RPM_BUILD_ROOT | |
74c7b14d | 198 | |
059ee964 JK |
199 | %if %{with python2} |
200 | %py_install | |
48d5306d | 201 | cp -p $RPM_BUILD_ROOT%{_bindir}/virtualenv{,-2} |
059ee964 | 202 | %endif |
f5fa4dd1 | 203 | |
4beaafdc JK |
204 | %if %{with python3} |
205 | %py3_install | |
48d5306d | 206 | cp -p $RPM_BUILD_ROOT%{_bindir}/virtualenv{,-3} |
4beaafdc JK |
207 | %endif |
208 | ||
74c7b14d PZ |
209 | %clean |
210 | rm -rf $RPM_BUILD_ROOT | |
211 | ||
059ee964 | 212 | %if %{with python2} |
74c7b14d PZ |
213 | %files |
214 | %defattr(644,root,root,755) | |
b9bca61e | 215 | %doc LICENSE README.md %{?with_doc:docs/_build/text/*.txt} |
48d5306d | 216 | %attr(755,root,root) %{_bindir}/virtualenv-2 |
b9bca61e | 217 | %{py_sitescriptdir}/virtualenv |
491d315c | 218 | %{py_sitescriptdir}/virtualenv-%{version}-py*.egg-info |
059ee964 JK |
219 | %endif |
220 | ||
221 | %if %{with python3} | |
222 | %files -n python3-%{module} | |
223 | %defattr(644,root,root,755) | |
b9bca61e | 224 | %doc LICENSE README.md %{?with_doc:docs/_build/text/*.txt} |
48d5306d | 225 | %attr(755,root,root) %{_bindir}/virtualenv-3 |
b9bca61e | 226 | %{py3_sitescriptdir}/virtualenv |
491d315c | 227 | %{py3_sitescriptdir}/virtualenv-%{version}-py*.egg-info |
059ee964 | 228 | %endif |
4beaafdc JK |
229 | |
230 | %files -n virtualenv | |
231 | %defattr(644,root,root,755) | |
232 | %attr(755,root,root) %{_bindir}/virtualenv |