[issue25592] distutils docs: data_files always uses sys.prefix
New submission from Jeroen Demeyer:
The documentation for distutils claims that sys.exec_prefix is used in certain cases to install data_files, but this is simply not true (maybe it was true in the past or this sentence was copy/pasted from somewhere else?)
----------
assignee: docs@python
components: Documentation
files: data_files_doc.patch
keywords: patch
messages: 254432
nosy: docs@python, jdemeyer
priority: normal
severity: normal
status: open
title: distutils docs: data_files always uses sys.prefix
versions: Python 2.7
Added file: http://bugs.python.org/file40993/data_files_doc.patch
_______________________________________
Python tracker
Changes by Berker Peksag
Change by Jeroen Demeyer
Change by Jeroen Demeyer
Éric Araujo
Jeroen Demeyer
If you’re not sure about the reason for that sentence, I think you should not remove it from the docs
If the docs are wrong, their history doesn't matter that much: the docs should be fixed regardless.
test the conditions (package with extension module)
I did that before posting this bug report. I also looked at the distutils sources. I couldn't find any evidence that data_files are ever installed in sys.exec_prefix.
----------
_______________________________________
Python tracker
Jeroen Demeyer
Jeroen Demeyer
Éric Araujo
If the docs are wrong, their history doesn't matter that much
What I was saying is that I am not sure that the docs are wrong.
Distutils is more touchy that the rest of the stdlib and I err on the side of caution.
----------
_______________________________________
Python tracker
Jeroen Demeyer
Éric Araujo
Jeroen Demeyer
Did you try with a minimal project containing a C extension? Did you install in a system where sys.prefix != sys.exec_prefix?
Yes to both questions.
----------
_______________________________________
Python tracker
Change by Antoine Pitrou
Antoine Pitrou
Jeroen Demeyer
it seems that Jeroen's analysis is right.
So would you be willing to merge the PR then?
----------
_______________________________________
Python tracker
Antoine Pitrou
Change by miss-islington
Change by miss-islington
Change by miss-islington
Éric Araujo
Antoine Pitrou
Antoine Pitrou
Jeroen Demeyer
Fixing this on 2.7 would require additional investigation (distutils might have diverged)
Let's be honest, we are talking about distutils here. So it's way more likely that it didn't diverge and that the behavior is exactly the same on 2.7 and 3.8. So I would suggest to backport it to 2.7 also.
----------
_______________________________________
Python tracker
Change by Antoine Pitrou
Antoine Pitrou
Jeroen Demeyer
Could you still give it a quick check?
I did just that. For reference, these are the steps:
- Checkout the "2.7" branch of the cpython git repo
- ./configure --prefix=/tmp/prefix --exec-prefix=/tmp/eprefix && make && make install
- Install pip (https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py)
- /tmp/prefix/pip install --no-deps --verbose pari_jupyter # This requires the PARI/GP library to be installed
- Note that all Jupyter stuff is installed in /tmp/prefix/share/jupyter while the directory /tmp/eprefix/share does not exist
----------
_______________________________________
Python tracker
Jeroen Demeyer
Change by miss-islington
Change by miss-islington
Change by miss-islington
Antoine Pitrou
Change by Antoine Pitrou
Antoine Pitrou
participants (5)
-
Antoine Pitrou
-
Berker Peksag
-
Jeroen Demeyer
-
miss-islington
-
Éric Araujo