[Tutor] Packaging questions

Julius Hamilton juliushamilton100 at gmail.com
Sat Dec 11 06:47:01 EST 2021


Hey,

I just went through the pip packaging tutorial. It seemed to be mainly for
making importable modules, i.e. files of functions you can access via

import library

I was hoping to package a command line application that can be used by
invoking its name on the command line.

The tutorial had me (basically) make an outermost project directory and put
the actual project code in a subdirectory, “src”, and specify that was the
“root” directory in the config file.

As far as I could tell, the only other essential file was either a
“setup.cfg” file or a “setup.py” file, (and a blank “__init__” file in src
as well). Could anyone let me know why I would choose the one over the
other, and if some people choose to have both?

Which information in the config file is mandatory? I entered name,
description, long_description, project_urls, license and much else. What’s
the bare minimum possible?

What should I do if I want my pip installation to be a command line
application instead of an importable library of functions? Do I need a more
sophisticated setup.py file which installs an executable in usr/bin or
something?

Thanks very much,
Julius


More information about the Tutor mailing list