473,396 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Distutils: relative paths


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

Jul 18 '05 #1
1 1283

"Frans Englich" <fr***********@telia.com> wrote in message
news:ma***************************************@pyt hon.org...

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


If I interpret it correctly, "the files are expected to be part of the package in the source
directories" means that you cannot specify a sibling directory as package data, so the easiest way
is to make "schemas" child of foo. If this is not possible, you may check the 'data_files' option
(http://www.python.org/doc/current/dist/node12.html).

George
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Doug | last post by:
If I were to write an include with a relative path like include("../conf/config.php"); What is the use? As far as I understand it, the path is relative to the first script that is called by...
2
by: Michael Ströder | last post by:
HI! Is it possible to probe for installed libs with DistUtils? I'd like to automatically search for optional libs and adjust C compiler switchers before starting the build of a the extension...
5
by: jason | last post by:
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server... Although it easy when you go - say - two levels down: .../includes it...
2
by: Joe | last post by:
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have some source with a tree directory structure that segments include files in various directories: #include...
2
by: Alex | last post by:
Hi. I need some help on this. I have a user control (a header) in my root directory, and all my pages use that control. Then a created a folder (in my root directory) and put a new page inside it,...
6
by: ajikoe | last post by:
Hello I tried to combine c++ and python together. So I follow from this website: http://kortis.to/radix/python_ext/ I have this code: # prmodule.c static PyObject *pr_isprime(PyObject *self,...
8
by: JJ | last post by:
I'm confused about paths. I have a functionn that uses the mappath method, which I think requires a virtual path (is that the same as a relative path?). But this doesn't always work as the...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
2
by: BD | last post by:
Hi there. Using 8.2 on Windows. I have a situation where I have a db backup, which I want to deploy to a group of developer workstations. The target directory for the database files will be...
2
by: Peted | last post by:
Hi i have a circumstance where a user unzips a file, with a certain layer of directories to get to a textfile. So in any directory on the HDD they may end up with something like ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.