FAQ
Is there a straightforward way to tell distutils to merge
.py files from more than one source directory into a single
package when installing?

PyGUI consists of some generic modules and some platform
specific ones, that conceptually all live at the same level
within a single package. In the source, there is a subdirectory
for each platform containing the platform-dependent files.
When run from the source, __path__ manipulation is done to
make the appropriate platform subdirectory appear to be part
of the main package.

However, when installing, I would like to just copy the
generic files plus the relevant platform ones directly into
the destination package directory, so that __path__ fiddling
is not needed. This is so that bundling tools such as py2app
and py2exe can find all the relevant modules without requiring
any hacking.

But distutils doesn't appear to support this. Unless I'm
missing something, you only get to specify one source directory
for each package.

Anyone have any ideas for getting around this?

--
Greg

Search Discussions

  • Miki Tebeka at May 11, 2011 at 1:15 pm
    Greg,
    Is there a straightforward way to tell distutils to merge
    .py files from more than one source directory into a single
    package when installing?
    The Selenium Python bindings does something like that, have a look at http://selenium.googlecode.com/svn/trunk/setup.py

    The other option is to write some code in setup.py before calling "setup" to do the merge.

    HTH
    --
    Miki Tebeka <miki.tebeka at gmail.com>
    http://pythonwise.blogspot.com
  • Gregory Ewing at May 11, 2011 at 10:50 pm

    Miki Tebeka wrote:

    .py files from more than one source directory into a single
    package when installing?
    The Selenium Python bindings does something like that, have a look at http://selenium.googlecode.com/svn/trunk/setup.py
    Unless I'm missing something, nothing out of the ordinary is
    happening there. Each destination directory is getting .py
    files from just one source directory.

    I'm not talking about a package with multiple submodules,
    I know how to do that. I'm talking about putting .py files
    from more than one source directory into the same intallation
    directory.

    E.g. Source:

    stuff/__init__.py
    stuff/dir1/foo.py
    stuff/dir2/blarg.py

    Installation:

    stuff/__init__.py
    stuff/foo.py
    stuff/blarg.py

    --
    Greg

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMay 11, '11 at 5:35a
activeMay 11, '11 at 10:50p
posts3
users2
websitepython.org

2 users in discussion

Gregory Ewing: 2 posts Miki Tebeka: 1 post

People

Translate

site design / logo © 2022 Grokbase