Old cruft
Gary E. Miller
gem at rellim.com
Sat Dec 9 05:33:59 UTC 2017
Yo Richard!
On Fri, 8 Dec 2017 22:40:55 -0600
Richard Laager <rlaager at wiktel.com> wrote:
> On 12/08/2017 09:20 PM, Gary E. Miller via devel wrote:
> > By Debian rules, ulness you do some sort of over-ride, '.waf
> > install' should never, ever, install into dist-packages.
>
> You're still misunderstanding. Debian has just renamed "site-packages"
> to "dist-packages".
Uh, no. You have both.
> They are otherwise exactly the same.
Sort of. By design, on Debian, some go one place, some the other. Having
the distrinction reduces conflicts.
From the Debian doc: https://wiki.debian.org/Python
"dist-packages instead of site-packages. Third party Python software
installed from Debian packages goes into dist-packages, not
site-packages. This is to reduce conflict between the system Python,
and any from-source Python build you might install manually."
> If you were
> prohibited from installing to dist-packages,
No prohibitions that I know of, just bad practice. As the above quote
says: 'to reduce conflict'.
> you would not be able to
> make anything work (without setting PYTHONPATH).
Which is the point, to force the user to set PYTHONPATH, so he can
selectively enable/disable the distro package, or the user compiled
package.
Gentoo goes one further, it encourages people to set PYTHONPATH down to
the user installed package level. One level lower than site-packages.
> I don't know why you keep insisting that site-packages is not for use.
Huh? Not me! It is all I got in Gentoo.
> Can you cite any documentation that says you must use a custom
> location and manually set PYTHONPATH?
Who said anything about custom location? Not me.
Here I see how Debian Python differs from upstream Python:
https://wiki.debian.org/Python#Deviations_from_upstream
"Note that /usr/local/lib/pythonX.Y/dist-packages is in sys.path
so that modules not installed from Debian packages can still be
accessed by the system Python."
So, another diffreence in how Debian uses dist-packages unlike how
Python uses site-packages. PYTHONPATH outside of Debian does not
include local site-packages by default.
> As always, you should not install into /usr, but install
> to /usr/local.
Uh, we know that Python also uses ~USER/.local/pythonX.Y/site-packages
That is commonly done too.
> For a prefix=/usr/local, I'm saying you should install to...
And the exact same even is prefix= not specified.
>
> Standard:
> /usr/local/pythonX.Y/site-packages
Yup, 100% standard, and need PYTHONPATH.
> Debian:
> /usr/local/pythonX.Y/dist-packages
Works for me too.
My problem is that by making things work in Debian, several commits in
the recent moths have been breaking non-Debian installs.
> If we simply remove the fix_python_config.py hack, everything should
> Just Work (as above),
Oh, other things broken in Gentoo. But I'd be happy to test a fix like
that.
> except on Fedora where /usr/local is not in the
> default path.
Can't test Fedora, don't want to know, I'll leave that to Fedora folks.
But, the basic Python upstream is that site-local is NOT in the default
path. Argue with them, not me, I hope they can explain it better than I
can.
> I've proposed adding a warning to `./waf configure` if the calculated
> pythondir is not in sys.path.
Yeah, that would fix most of the damage done in September.
> This will have some false positives
> (e.g. when the directory doesn't exist, but will be in sys.path once
> it is created), but won't have any false negatives.
We'll see...
The PYTHONPATH warnings that got removed in September, were added due to
many user complaints. After the removal, the problem reasserted itself,
and I internally bllamed the users for ignroing what we told them, when
in fact, the warnings had been removed.
A very common case is when a user bought a new RasPi, installed his
plain distro on it, installed NTPsec on it, then wondered why Python
could not site NTPsec. It is exactly the false positive you dismiss that
has been a big and reoccuring issue. I prolly have several end users to
apologize to, as I berated them for ignoring the PYTHONPATH text at install
time, which in fact had been removed.
> The warning would instruct the user to add a .pth file to the
> appropriate location, which we should be able to give them.
Got any doc on the .pth file? All the Python doc I have seen
refers to PYTHONPATH instead.
And this .pth file would have to be different for different
distros.
We gotta do this so it works on the most distros we can. We
gotta stop breaking some distros to 'fix' others.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem at rellim.com Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20171208/4306f066/attachment.bin>
More information about the devel
mailing list