I'm pretty sure that most if not all debian packages already ship the required information for pip to see them as installed, and if they are installed and they satisfy the dependency constraints that pip has for those projects, then they'll be used.
The question of having pip automatically install a debian package instead of using PyPI basically comes down to a few problems:
- pip doesn't know how to invoke apt (and yum, and Conda, and everything else). - how do we translate "foo" on PyPI to the equivalent package in Debian (and Fedora, and Conda, etc)
- how do we handle virtual environments?
Nobody has ever come up with a particularly good answer to those problems, so pip upstream hasn't been able to even consider doing something like that.
Of course Debian could patch it's copy of pip to do that, that would make some of those questions easier, but not all of them, and would drastically diverge it's behavior from the "expected" behavior, which makes it a rough idea in general for Debian to
diverge that drastically.
On 2/12/2023 3:18:55 AM, Ian Norton <
[email protected]> wrote:
https://packaging.python.org/en/latest/specifications/recording-installed-packages/
defines the python spec where a package such as pyparsing would create
a tree of files under:
site-packages/pyparsing-3.0.9-dist-info/ including RECORD which is
essentially a sha256-based manifest of files and some others.
On Sun, 12 Feb 2023 at 08:12, Ian Norton wrote:
You've made me wonder if it would be feasible to have a debian-centric
tool that populates .dist-info from debs?
On Sun, 12 Feb 2023 at 08:05, Ian Norton wrote:
I requested this kind of thing from the pip folks as https://github.com/pypa/pip/issues/11644 and others have requested
similar, such as https://github.com/pypa/pip/issues/11607
On Sun, 12 Feb 2023 at 04:56, Philippe Cerfon wrote:
Hey.
I hope this is not too off topic.
As far as I understand, dh-python, when building packages somehow automatically uses the Debian package names and even prevents e.g. setuptools from downloading any dependencies by setting a (hopefully
not running) proxy.
I wondered whether it's possible to make tools like pip and setuptools directly use the Debian python packages when resolving dependencies.
The main motivation are security constraints, so I had to configure
pip so that it cannot just download packages from PyPI (which is
rather easy, simply setting no-index in pip.conf).
But then of course it also fails to e.g. do an editable install of a locally developed package, when it tries to resolve the dependencies.
So I wondered whether it's possible to prevent pip from downloading
any remote stuff, while still resolving dependencies (respectively consider them as being resolved) *if* the package is locally installed from the Debian archive?
(If a dependency isn't installed from a package it may of course fail.)
Thanks,
Philippe.
PS: Please keep me CCed.
[88f0dcef-4969-48af-98f1-0c69549b4875]
<div id="__MailbirdStyleContent" style="font-size: 12pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
I'm pretty sure that most if not all debian packages already ship the required information for pip to see them as installed, and if they are
installed and they satisfy the dependency constraints that pip has for those projects, then they'll be used.<div class="mb_sig"></div> <div><br></div><div>The question of
having pip automatically install a debian package instead of using PyPI basically comes down to a few problems:</div><div><br></div><div>- pip doesn't know how to invoke apt (and yum, and Conda, and everything else).</div><div>- how do we translate "foo"
on PyPI to the equivalent package in Debian (and Fedora, and Conda, etc)</div><div>- how do we handle virtual environments?</div><div><br></div><div>Nobody has ever come up with a particularly good answer to those problems, so pip upstream hasn't been
able to even consider doing something like that.</div><div><br></div><div>Of course Debian could patch it's copy of pip to do that, that would make some of those questions easier, but not all of them, and would drastically diverge it's behavior from the "
expected" behavior, which makes it a rough idea in general for Debian to diverge that drastically.</div><blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left:
10px;min-width: 500px"> <p style="color: #AAAAAA; margin-top: 10px;">On 2/12/2023 3:18:55 AM, Ian Norton <
[email protected]> wrote:</p><div style="font-family:Arial,Helvetica,sans-serif">
https://packaging.python.org/en/
latest/specifications/recording-installed-packages/<br>defines the python spec where a package such as pyparsing would create<br>a tree of files under:<br>site-packages/pyparsing-3.0.9-dist-info/ including RECORD which is<br>essentially a sha256-
based manifest of files and some others.<br><br>On Sun, 12 Feb 2023 at 08:12, Ian Norton <
[email protected]> wrote:<br>><br>> You've made me wonder if it would be feasible to have a debian-centric<br>> tool that populates .dist-info from
debs?<br>><br>> On Sun, 12 Feb 2023 at 08:05, Ian Norton <
[email protected]> wrote:<br>> ><br>> > I requested this kind of thing from the pip folks as<br>> >
https://github.com/pypa/pip/issues/11644 and others have requested<
> > similar, such as https://github.com/pypa/pip/issues/11607<br>> ><br>> > On Sun, 12 Feb 2023 at 04:56, Philippe Cerfon <[email protected]> wrote:<br>> > ><br>> > > Hey.<br>> > ><br>> > >
I hope this is not too off topic.<br>> > ><br>> > > As far as I understand, dh-python, when building packages somehow<br>> > > automatically uses the Debian package names and even prevents e.g.<br>> > > setuptools
from downloading any dependencies by setting a (hopefully<br>> > > not running) proxy.<br>> > ><br>> > ><br>> > > I wondered whether it's possible to make tools like pip and setuptools<br>> > > directly
use the Debian python packages when resolving dependencies.<br>> > ><br>> > > The main motivation are security constraints, so I had to configure<br>> > > pip so that it cannot just download packages from PyPI (which is<br>&
gt; > > rather easy, simply setting no-index in pip.conf).<br>> > ><br>> > > But then of course it also fails to e.g. do an editable install of a<br>> > > locally developed package, when it tries to resolve the
dependencies.<br>> > ><br>> > > So I wondered whether it's possible to prevent pip from downloading<br>> > > any remote stuff, while still resolving dependencies (respectively<br>> > > consider them as being
resolved) *if* the package is locally installed<br>> > > from the Debian archive?<br>> > > (If a dependency isn't installed from a package it may of course fail.)<br>> > ><br>> > ><br>> > > Thanks,<br>&
gt; > > Philippe.<br>> > ><br>> > > PS: Please keep me CCed.<br>> > ><br><br></
[email protected]></
[email protected]></
[email protected]></div></blockquote></div><img class="mailbird" width="1" height="1" style="
border:0; width:1; height:1; display: none;" src="
https://tracking.getmailbird.com/OpenTrackingPixel/?messageId=Mailbird-3d2f35ae-00ad-4864-a8f9-a39876df65ae@stufft.io&senderHash=57787FD98DE4EB8FA6FBC42D73E38B5233F15C50A1E6C93FEFCDDA0F25910CC6&
recipientHash=A680344B9C0D740131327222AC7C19830233B381EF4AD31267DCE32D1054E966&internalId=9e1e3ba6-db12-46a9-85ae-4abc99011e73" alt="88f0dcef-4969-48af-98f1-0c69549b4875">
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)