how to include python modules not under distribution root in setup.py?

3

I am new to python and am figuring out and using distutils to create a distribution for a python project,

in the setup.py file you indicate which python modules to be included with the option

py_modules = ['mod1', 'pkg.mod2']

which would include the files under the distribution root 'mod1' and also can include files in packages within the distribution root 'pkg/mod2'. Is it possible to include files above the distribution root folder?
for example a python module found several directories above:../../../../../pkg2/mod3

or must I go about changing the distribution root?

Thanks,

user2497792

Posted 2013-06-18T15:39:49.917

Reputation: 93

Answers

0

You can use package_dir for this.

setup(
    package_dir={'mod3': '../../../../../pkg2/mod3'},
    packages=['mod3']
)

fahhem

Posted 2013-06-18T15:39:49.917

Reputation: 191