Skip to content

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

Merged
merged 4 commits into from
Jul 9, 2019

Conversation

stancheff
Copy link
Contributor

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]

The name of python sitelib macro changes

Signed-off-by: Shaun Tancheff <[email protected]>
@codecov
Copy link

codecov bot commented Jun 29, 2019

Codecov Report

Merging #8969 into master will decrease coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Flag Coverage Δ
#kernel 79.37% <ø> (-0.15%) ⬇️
#user 66.25% <ø> (-0.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 681a85c...052acf4. Read the comment docs.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jul 2, 2019
@behlendorf
Copy link
Contributor

@Conan-Kudo would you mind taking a look at this.

@Conan-Kudo
Copy link
Contributor

Ugh, this is where SUSE's completely different implementation of the Python macros kind of bites us... I'll look into it.

@behlendorf behlendorf added the Component: Packaging custom packages label Jul 2, 2019
@@ -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}
Copy link
Contributor

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())")

Copy link
Contributor Author

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.

Copy link
Contributor

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.

%define __python_sitelib %{python3_sitelib}
%else
%define __python_sitelib %{python_sitelib}
%endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop all this.

%define __python_sitelib %{python%{__python_pkg_version}_sitelib}
%else
%define __python_sitelib %{python_sitelib}
%endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop all this.

stancheff added 2 commits July 9, 2019 04:51
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
@@ -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())")
Copy link
Contributor

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.

Copy link
Contributor Author

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
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jul 9, 2019
@behlendorf behlendorf merged commit 02fad92 into openzfs:master Jul 9, 2019
@stancheff stancheff deleted the sles15-build branch July 10, 2019 21:41
TulsiJain pushed a commit to TulsiJain/zfs that referenced this pull request Jul 20, 2019
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
TulsiJain pushed a commit to TulsiJain/zfs that referenced this pull request Jul 20, 2019
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
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Aug 13, 2019
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
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Aug 22, 2019
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
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Aug 23, 2019
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
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 17, 2019
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
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 18, 2019
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
tonyhutter pushed a commit that referenced this pull request Sep 26, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Packaging custom packages Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants