[Distutils] obtaining project name and packages

Chris Jerdonek chris.jerdonek at gmail.com
Wed Mar 29 14:41:27 EDT 2017


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


More information about the Distutils-SIG mailing list