-
Notifications
You must be signed in to change notification settings - Fork 1.9k
pkg-utils python sitelib for SLES15 #8969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The name of python sitelib macro changes Signed-off-by: Shaun Tancheff <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #8969 +/- ##
==========================================
- Coverage 78.74% 78.57% -0.17%
==========================================
Files 388 388
Lines 119972 119972
==========================================
- Hits 94466 94271 -195
- Misses 25506 25701 +195
Continue to review full report at Codecov.
|
@Conan-Kudo would you mind taking a look at this. |
Ugh, this is where SUSE's completely different implementation of the Python macros kind of bites us... I'll look into it. |
rpm/generic/zfs.spec.in
Outdated
@@ -87,17 +87,28 @@ | |||
%define __python_pkg_version 2 | |||
%define __python_cffi_pkg python-cffi | |||
%define __python_setuptools_pkg python-setuptools | |||
%define __python_sitelib %{python_sitelib} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just do this:
%define __python_sitelib %(%{__python} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This %{__python} -Ic
only works for python3.
However I can use the selected __python value to cleanup and make it generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-I
is not required. You can swap it for -Es
instead.
rpm/generic/zfs.spec.in
Outdated
%define __python_sitelib %{python3_sitelib} | ||
%else | ||
%define __python_sitelib %{python_sitelib} | ||
%endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop all this.
rpm/generic/zfs.spec.in
Outdated
%define __python_sitelib %{python%{__python_pkg_version}_sitelib} | ||
%else | ||
%define __python_sitelib %{python_sitelib} | ||
%endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop all this.
The name of python sitelib macro changes Signed-off-by: Shaun Tancheff <[email protected]> --- Changes since v1: Incorporate comments from @Conan-Kudo to simplify patch
The name of python sitelib macro changes Signed-off-by: Shaun Tancheff <[email protected]> --- Changes since v1: Correct __py_major -> __py_major_version Changes since v1: Incorporate comments from @Conan-Kudo to simplify patch
rpm/generic/zfs.spec.in
Outdated
@@ -99,6 +99,13 @@ | |||
%define __python_cffi_pkg python%{__python_pkg_version}-cffi | |||
%define __python_setuptools_pkg python%{__python_pkg_version}-setuptools | |||
%endif | |||
%define __py_major_version %(%{__python} -c "import sys; print(str(sys.version_info[0]))") | |||
%if 0%{?__py_major_version} >= 3 | |||
%define __python_sitelib %(%{__python} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using -Ic
, use -Esc
and then we don't have to care about the %__py_major_version
and that logic can be dropped.
We don't need to reference %python_sitelib
at all either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better .. Thanks!
The name of python sitelib macro changes Signed-off-by: Shaun Tancheff <[email protected]> --- Changes since v3: Use python -Esc to find python_lib Changes since v2: Correct __py_major -> __py_major_version Changes since v1: Incorporate comments from @Conan-Kudo to simplify patch
Use python -Esc to set __python_sitelib. Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shaun Tancheff <[email protected]> Closes openzfs#8969
Use python -Esc to set __python_sitelib. Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shaun Tancheff <[email protected]> Closes openzfs#8969
Use python -Esc to set __python_sitelib. Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shaun Tancheff <[email protected]> Closes openzfs#8969
Use python -Esc to set __python_sitelib. Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shaun Tancheff <[email protected]> Closes openzfs#8969
Use python -Esc to set __python_sitelib. Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shaun Tancheff <[email protected]> Closes openzfs#8969
Use python -Esc to set __python_sitelib. Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shaun Tancheff <[email protected]> Closes openzfs#8969
Use python -Esc to set __python_sitelib. Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shaun Tancheff <[email protected]> Closes openzfs#8969
Use python -Esc to set __python_sitelib. Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shaun Tancheff <[email protected]> Closes #8969
The name of python sitelib macro changed for openSuSE 15
Attempting to run make pkg-utils fails with errors expecting to find
Processing files: python3-pyzfs-0.8.1-1.noarch
error: File not found: /tmp/.../usr/lib/python2.7/site-packages/libzfs_core/*
error: File not found: /tmp/.../usr/lib/python2.7/site-packages/pyzfs*
Executing(%doc): /bin/sh -e /tmp/zfs-build-shaun-3VGQcteZ/TMP/rpm-tmp.ONu8QE
This resolves the issue by updating the rpm macro python3_sitelib where required.
Signed-off-by: Shaun Tancheff [email protected]