[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-release-team
Subject: Re: Python site packages
From: Michael Jansen <kde () michael-jansen ! biz>
Date: 2013-01-20 15:11:54
Message-ID: 3385027.obkWkEHmMo () gambit
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
On Sunday, January 20, 2013 08:37:28 PM Ben Cooksley wrote:
> On Sun, Jan 20, 2013 at 12:55 PM, Kevin Kofler <kevin.kofler@chello.at> wrote:
> > On Saturday 19 January 2013 at 22:33:19, David Faure wrote:
> > > Because this breaks "make install" for developers.
> > >
> > > (For the recommended case of installing as user rather than as root).
> > > The default should make it easy for everyone who wants to contribute to
> > > KDE.>
> > But that makes things harder for packagers, for the benefit of the vocal,
> > but very small, minority of users who compile KDE directly from source.
> Are you implying that KDE Developers are a "small minority of users"?
>
> Do remember that developers have to compile and install the same
> sources as well, and for many reasons most do not want their
> self-compiled version to affect the system in any way. This build
> system change lowers the barrier to entry for KDE Development in my
> view and should be retained.
>
> It is far easier for packagers (who have experience and the benefits
> of being directly notified of this change) to add a single CMake
> argument to their build scripts than it is for all new developers to
> discover and then use this option. Running into a installation problem
> will just dissuade them and will ultimately harm the KDE Community in
> the long term.
>
> > Kevin Kofler
How about we make all of them happy?
First diff:diff --git a/cmake/modules/FindPythonLibrary.cmake \
b/cmake/modules/FindPythonLibrary.cmake index 7cef79b..7e36347 100644
--- a/cmake/modules/FindPythonLibrary.cmake
+++ b/cmake/modules/FindPythonLibrary.cmake
@@ -58,8 +58,10 @@ if (PYTHONINTERP_FOUND)
if(INSTALL_PYTHON_FILES_IN_PYTHON_PREFIX)
set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR})
else()
- set(PYTHON_SITE_PACKAGES_INSTALL_DIR \
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/python${PYTHON_SHORT_VERSION}/site-packages
- CACHE PATH "The directory where Python modules will be installed to.")
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig \
import get_python_lib; print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))" \
+ OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_INSTALL_DIR + \
OUTPUT_STRIP_TRAILING_WHITESPACE + )
message(STATUS "The Python files will be installed to \
${PYTHON_SITE_PACKAGES_INSTALL_DIR}. Make sure to add them to the Python search path \
(e.g. by setting PYTHONPATH)") endif()
This should fix the problem with site/dist-packages.
Together with:
sysconfig.get_config_vars( 'base' ) or 'prefix'
it should even be able to only print the warning "The Python ...." if \
CMAKE_INSTALL_PREFIX ist different from the python PREFIX.
Sorry. Just had enough time to research the problem. Not enough time to do the change \
and a review request. Perhaps someone else can pick up here.
Mike
[Attachment #5 (unknown)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" \
content="1" /><style type="text/css"> p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Monospace'; font-size:10pt; \
font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">On Sunday, January 20, 2013 08:37:28 PM Ben Cooksley wrote:</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> On Sun, Jan 20, 2013 at \
12:55 PM, Kevin Kofler <kevin.kofler@chello.at> wrote:</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > On Saturday 19 \
January 2013 at 22:33:19, David Faure wrote:</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> >> Because this breaks "make \
install" for developers.</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> >> </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> >> (For the recommended case of installing as user \
rather than as root).</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> >> The default should make it easy for everyone who \
wants to contribute to</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> >> KDE.> </p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> > But that makes things harder for \
packagers, for the benefit of the vocal,</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> > but very small, minority of users who \
compile KDE directly from source.</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> Are you implying that KDE Developers are a "small \
minority of users"?</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> Do remember that developers have to compile and install the \
same</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> \
sources as well, and for many reasons most do not want their</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> self-compiled version to \
affect the system in any way. This build</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> system change lowers the barrier to entry \
for KDE Development in my</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> view and should be retained.</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> </p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> It is far easier for packagers (who have \
experience and the benefits</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> of being directly notified of this change) to add a single \
CMake</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> \
argument to their build scripts than it is for all new developers to</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> discover and then use \
this option. Running into a installation problem</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> will just dissuade them and will ultimately \
harm the KDE Community in</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> the long term.</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> </p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> > Kevin Kofler</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">How about we make all of them \
happy?</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">First diff:diff --git \
a/cmake/modules/FindPythonLibrary.cmake b/cmake/modules/FindPythonLibrary.cmake</p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">index 7cef79b..7e36347 \
100644</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">--- \
a/cmake/modules/FindPythonLibrary.cmake</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">+++ b/cmake/modules/FindPythonLibrary.cmake</p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">@@ -58,8 +58,10 @@ if \
(PYTHONINTERP_FOUND)</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"> if(INSTALL_PYTHON_FILES_IN_PYTHON_PREFIX)</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> \
set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR})</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> else()</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">- \
set(PYTHON_SITE_PACKAGES_INSTALL_DIR \
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/python${PYTHON_SHORT_VERSION}/site-packages</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">- CACHE PATH \
"The directory where Python modules will be installed to.")</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">+ \
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import \
get_python_lib; print(get_python_lib(True, \
prefix='${CMAKE_INSTALL_PREFIX}'))"</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">+ OUTPUT_VARIABLE \
PYTHON_SITE_PACKAGES_INSTALL_DIR</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">+ OUTPUT_STRIP_TRAILING_WHITESPACE</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">+ )</p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> message(STATUS \
"The Python files will be installed to ${PYTHON_SITE_PACKAGES_INSTALL_DIR}. Make \
sure to add them to the Python search path (e.g. by setting PYTHONPATH)")</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> endif()</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">This should fix the problem \
with site/dist-packages.</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; "> </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">Together with:</p> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; "> </p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">sysconfig.get_config_vars( 'base' ) or \
'prefix'</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">it should even be able to \
only print the warning "The Python ...." if CMAKE_INSTALL_PREFIX ist \
different from the python PREFIX.</p> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; "> </p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">Sorry. Just had enough time to research the \
problem. Not enough time to do the change and a review request. Perhaps someone else \
can pick up here.</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; "> </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">Mike</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; "> </p></body></html>
_______________________________________________
release-team mailing list
release-team@kde.org
https://mail.kde.org/mailman/listinfo/release-team
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic