[Distutils] obtaining project name and packages

Thomas Kluyver thomas at kluyver.me.uk
Wed Mar 29 14:55:28 EDT 2017


I have a tool that does this from a wheel:
https://github.com/takluyver/wheeldex

>From an sdist, I think you need to either build a wheel or install it
before you can get this information reliably.

Some of my installed packages have a 'top_level.txt' file in the
.dist-info folder, containing a list of the top-level package names
installed by that distribution. I don't believe this is formally
specified anywhere, though, and packages created by flit do not have it.

Thomas

On Wed, Mar 29, 2017, at 07:41 PM, Chris Jerdonek wrote:
> Hi, this seems like a simple question, but I haven't been able to find
> the answer online:
> 
> What is the current recommended way to get (1) the name of a project,
> and (2) the names of the top-level packages installed by a project
> (not counting the project's dependencies).  You have access to / can
> run the project's setup.py, and you're also allowed to assume that the
> project is installed.
> 
> For example, for (1) I know you can do--
> 
>     $ python setup.py --name
> 
> But I'm not sure if accessing setup.py is no longer recommended (as
> opposed to going through a tool like pip).
> 
> Thanks a lot,
> --Chris
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig


More information about the Distutils-SIG mailing list