Distutils: relative paths

Frans Englich frans.englich at telia.com
Sat Feb 19 18:19:41 EST 2005


Hello,

I have trouble installing a data directory which is not a child of my package 
directory in the source directory.

My source directory looks like this:

./setup.py
schemas/*.xsd
foo/*.py

And when it's installed, it should look like:

site-packages/foo/*.py
site-packages/foo/schemas/*.xsd

In other words, schemas, from being a sibling of foo, became a child of foo.

Now, how is this expressed in the setup.py?

I tried this:

setup( name="Foo",
    packages=["foo"],
    package_data={ "foo": ["../schemas/*.xsd"] },
    package_dir={ "foo": "foo"},
	[...]

but it resulted in schemas being a package, not child of foo(!). 

I've read the relevant page in the reference manual, 
http://www.python.org/doc/current/dist/node11.html

but I can't find the trick. Any ideas?


Cheers,

		Frans




More information about the Python-list mailing list