Ben Finney | 7 Sep 08:03 2013

Installing resource data files and finding them

Howdy all,

How do I package a Python application with its resource files separate
from the Python modules, such that the resource files can be discovered
by the Python code when it runs?

I am working on an existing Python application code base. The
application currently assumes that its resource files will be installed
to the same location as the python modules (using the Distutils
‘package_data’ option).

But this violates the Filesystem Hierarchy Standard used on GNU+Linux
<URL:>. By that
standard, platform-independent resources belong in ‘/usr/share/…’, while
platform-dependent code libraries belong in ‘/usr/lib/…’.

Currently the upstream Python code uses ‘os.path.dirname(__file__)’ and
similar, to discover the location of the resource files. It thereby
assumes that the resource files are installed to the same location as
the Python code. The Distutils ‘package_data’ option appears to enforce
this, and I can't find any way for the files to be installed to a
different place using that option.

The Distutils ‘data_files’ option doesn't seem suitable for this
purpose. It allows the location to be specified (using ‘python
./ --data-files=FOODIR’),, but there appears to be no way for
the application to know what location was specified later.

I will need to change both the build configuration and the application
code, so that instead it allows the resource files to be installed to an
(Continue reading)

Radha Krishna Srimanthula | 7 Mar 16:02 2013

Info/ Examples of uninstall hook in distutils2


I have setup my library to use distutils2. I am using the install command to do some custom actions. I'd like to implement a uninstall hook to do some clean up from the the custom actions. 

How do I go about doing this? Which command hook should I hook into?

Would be of great help if someone could point me in the right direction. Any help will be greatly appreciated.


You received this message because you are subscribed to the Google Groups "The fellowship of the packaging" group.
To unsubscribe from this group and stop receiving emails from it, send an email to the-fellowship-of-the-packaging+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/
For more options, visit
Marcus Smith | 8 Aug 16:46 2012

packaging in or out of 3.3?

I downloaded py3.3 beta last need and didn't see packaging, and it doesn't show on the what's new page.
Will it be in 3.3?  If not, what's the story?

Éric Araujo | 22 Mar 04:02 2012

Re: Is distutils2 at a beta level?

Hi Dennis,

>> What you can do is add distutils2 support in parallel to your
>> script based on distutils or setuptools.  Call “pysetup generate-setup”
>> in an empty directory and use the generated to see what I mean.
> Is this something that can be done with distutils2 and python2.7 right
> now?
Yes, if you use the development version from the repository or the 1.0a4
release that was cut a week or two ago.

> I'm really excited about the work being done here and would like
> to start trying it out.
Great!  We need feedback from users, even if the manpower and the time
to fix all the things is limited.

> I installed distutils2 with pip, but can't find pysetup installed
> anywhere.  Just curious if this is possible to try using the
> "pysetup generate-setup" as you recommend.
Upgrade your existing install with pip and you’ll get the pysetup command.

> Thanks again for the effort here guys.  A lot of people in the python
> community are excited for the 1.0 release!
Thanks for the kind words!

higery | 21 Mar 13:47 2012

plan to participate GSOC2012 ?

Hey, guys,

Does we have the plan to participate GSOC this year?

Best regards,

kristian kvilekval | 14 Mar 01:39 2012

distutils2 and the "develop" command

There are several references around the web saying this will be part of distutils2.

Our developers depend on it.. Is this going to be in a release soon?

Éric Araujo | 27 Feb 14:40 2012

Removing support for old Python versions

Hi Tarek and all,

Someone suggested me that it was not very useful to support Python 3.1.
 From memory, I think the arguments were that it is not widely used,
Python 3 adopters may be more prone to updating to 3.2 quickly, many
people go from 2.7 to 3.2 or wait for the memory improvements in 3.3,
and the codebase is more complicated because 3.1 doesn’t have
__pycache__ directories.  So, do you think it is worth it to support 3.1?

On the same note, do we still care about 2.4?  Having to build _hashlib
is a pain, especially on Windows.


Éric Araujo | 3 Feb 17:46 2012

Re: PyCon US 2012 poster on distutils2/packaging

Hi Nick,

Sorry nobody replied earlier.  This mailing list is definitely
appropriate to request comments on a poster, talk or any document.
Technically the distutils-sig ML is the generic list where all 
tools are discussed and represented, whereas this list was created to
discuss distutils2 only in a setting without hot arguments, but feel 
to use either.