<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 29, 2017 at 1:55 PM, Thomas Kluyver <span dir="ltr"><<a href="mailto:thomas@kluyver.me.uk" target="_blank">thomas@kluyver.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have a tool that does this from a wheel:<br>
<a href="https://github.com/takluyver/wheeldex" rel="noreferrer" target="_blank">https://github.com/takluyver/<wbr>wheeldex</a><br>
<br>
>From an sdist, I think you need to either build a wheel or install it<br>
before you can get this information reliably.<br></blockquote><div><br></div><div>Src: <a href="https://code.launchpad.net/~tseaver/pkginfo/trunk">https://code.launchpad.net/~tseaver/pkginfo/trunk</a></div><div><br></div><div>PyPI: <a href="https://pypi.python.org/pypi/pkginfo">https://pypi.python.org/pypi/pkginfo</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This package provides an API for querying the distutils metadata written in the PKG-INFO file inside a source distriubtion (an sdist) or a binary distribution (e.g., created by running bdist_egg). It can also query the EGG-INFO directory of an installed distribution, and the *.egg-info stored in a “development checkout” (e.g, created by running setup.py develop).<br></blockquote><div><br></div><div>Docs: <a href="https://pythonhosted.org/pkginfo/">https://pythonhosted.org/pkginfo/</a> </div><div> </div><div><a href="https://bazaar.launchpad.net/~tseaver/pkginfo/trunk/files/head:/pkginfo/tests/">https://bazaar.launchpad.net/~tseaver/pkginfo/trunk/files/head:/pkginfo/tests/</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Some of my installed packages have a 'top_level.txt' file in the<br>
.dist-info folder, containing a list of the top-level package names<br>
installed by that distribution. I don't believe this is formally<br>
specified anywhere, though, and packages created by flit do not have it.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
Thomas<br>
</font></span><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
On Wed, Mar 29, 2017, at 07:41 PM, Chris Jerdonek wrote:<br>
> Hi, this seems like a simple question, but I haven't been able to find<br>
> the answer online:<br>
><br>
> What is the current recommended way to get (1) the name of a project,<br>
> and (2) the names of the top-level packages installed by a project<br>
> (not counting the project's dependencies).  You have access to / can<br>
> run the project's setup.py, and you're also allowed to assume that the<br>
> project is installed.<br>
><br>
> For example, for (1) I know you can do--<br>
><br>
>     $ python setup.py --name<br>
><br>
> But I'm not sure if accessing setup.py is no longer recommended (as<br>
> opposed to going through a tool like pip).<br>
><br>
> Thanks a lot,<br>
> --Chris<br>
> ______________________________<wbr>_________________<br>
> Distutils-SIG maillist  -  <a href="mailto:Distutils-SIG@python.org">Distutils-SIG@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/distutils-sig" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/distutils-sig</a><br>
______________________________<wbr>_________________<br>
Distutils-SIG maillist  -  <a href="mailto:Distutils-SIG@python.org">Distutils-SIG@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/distutils-sig" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/distutils-sig</a><br>
</div></div></blockquote></div><br></div></div>