summaryrefslogtreecommitdiff
path: root/macros.python
diff options
context:
space:
mode:
Diffstat (limited to 'macros.python')
-rw-r--r--macros.python18
1 files changed, 16 insertions, 2 deletions
diff --git a/macros.python b/macros.python
index 334c0ab..59df735 100644
--- a/macros.python
+++ b/macros.python
@@ -63,7 +63,14 @@ find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $pyth
}
%py_install_wheel() %{expand:\\\
- pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
+ %{__python} -m pip install -I dist/%{1} --root %{buildroot} --prefix %{_prefix} --no-deps --no-index --no-warn-script-location
+ rm -rfv %{buildroot}%{_bindir}/__pycache__
+ for distinfo in %{buildroot}%{python_sitelib}/*.dist-info %{buildroot}%{python_sitearch}/*.dist-info; do
+ if [ -f ${distinfo}/direct_url.json ]; then
+ rm -fv ${distinfo}/direct_url.json
+ sed -i '/direct_url.json/d' ${distinfo}/RECORD
+ fi
+ done
}
%python_provide() %{lua:
@@ -189,7 +196,14 @@ find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $pyth
}
%py3_install_wheel() %{expand:\\\
- pip%{python3_version} install -I dist/%{1} --root %{buildroot} --no-deps
+ %{__python3} -m pip install -I dist/%{1} --root %{buildroot} --prefix %{_prefix} --no-deps --no-index --no-warn-script-location
+ rm -rfv %{buildroot}%{_bindir}/__pycache__
+ for distinfo in %{buildroot}%{python3_sitelib}/*.dist-info %{buildroot}%{python3_sitearch}/*.dist-info; do
+ if [ -f ${distinfo}/direct_url.json ]; then
+ rm -fv ${distinfo}/direct_url.json
+ sed -i '/direct_url.json/d' ${distinfo}/RECORD
+ fi
+ done
}
# python3_pkgversion specifies the version of Python 3 in the distro. It can be
# a specific version (e.g. 34 in Fedora EPEL7)