[Distutils] advice re: packaging tasks

Donald Stufft donald at stufft.io
Wed Oct 1 02:00:03 CEST 2014

> On Sep 30, 2014, at 7:44 PM, Chris Jerdonek <chris.jerdonek at gmail.com> wrote:
> Hi,
> I was curious what others do for the following packaging tasks, or if
> you have any recommendations otherwise.  There is also a code
> organization question at the end.
> 1) For starters, it's very easy to make mistakes in one's MANIFEST.in,
> so I hacked the sdist command in my setup.py to list the differences
> between one's project repo and the generated sdist each time you run
> "python setup.py sdist".  Are there better solutions for this out
> there so I don't have to rely on my own hack?


> 2)  Secondly, like many, my README files are in markdown, so I hacked
> a command in my setup.py to use Pandoc to convert README.md to a .rst
> file for use as the long_description argument to setup().  I also
> check in the resulting file for troubleshooting purposes, etc.  Are
> there more elegant solutions for this that people know of?

Not that I’m aware of.

> Also, for commands like the latter, is it better to define them in
> one's setup.py, or simply to have separate scripts in one's repo?

I’d probably do it in the setup.py, or as an invoke task, see

> Lastly, as these setup-related tasks grow larger and more complicated,
> I found it helped to break them out into a separate setup package that
> sits alongside my project's main package library (and even adding
> tests in some cases).  Is this normal?  Have other people run into
> this?

This is especially the case when I start using invoke.

> Thanks,
> --Chris
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig

Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

More information about the Distutils-SIG mailing list