473,466 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

distutils setup.cfg question.

Ok, I give up. I searched the CVS code, and can't find the place that
turns an include_dirs option in setup.cfg into a list of
directories. The reason I was looking for it is that I can't figure
out how to make include_dirs include multiple directories from
setup.cfg. Everything I try winds up putting
-I<contents_of_include_dirs>. I couldn't even find the place where the
string value that is returned by ConfigParser is enclosed in a list.

Help?

Thankx,
<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 18 '05 #1
2 2301
Mike Meyer wrote:
Ok, I give up. I searched the CVS code, and can't find the place that
turns an include_dirs option in setup.cfg into a list of
directories. The reason I was looking for it is that I can't figure
out how to make include_dirs include multiple directories from
setup.cfg. Everything I try winds up putting
-I<contents_of_include_dirs>. I couldn't even find the place where the
string value that is returned by ConfigParser is enclosed in a list.


I did it this way:

% cd work/py2.4/Lib/distutils/
% grep setup.cfg *
dist.py: on Windows/Mac, and setup.cfg in the current directory.
dist.py: # All platforms support local setup.cfg
dist.py: local_file = "setup.cfg"

So it is clearly dist.py. There, setup.cfg is returned from
find_config_files. This is called a single time only in dist.py,
namely from parse_config_files. As you can see, this is then set
as the global include_dirs option. Apparently, include_dirs really
*is* a single string, then.

Now, where is it split into multiple substrings?
% grep include_dirs *.py */*.py

This gives a long list. However, in two places, include_dirs is split:
command/config.py: self.include_dirs =
string.split(self.include_dirs, os.pathsep)
command/build_ext.py: self.include_dirs =
string.split(self.include_dirs, os.pathsep)

Both places have similar code:

if self.include_dirs is None:
self.include_dirs = self.distribution.include_dirs or []
elif type(self.include_dirs) is StringType:
self.include_dirs = string.split(self.include_dirs, os.pathsep)

HTH,
Martin
Jul 18 '05 #2
"Martin v. Löwis" <ma****@v.loewis.de> writes:
Mike Meyer wrote:
Ok, I give up. I searched the CVS code, and can't find the place that
turns an include_dirs option in setup.cfg into a list of
directories. The reason I was looking for it is that I can't figure
out how to make include_dirs include multiple directories from
setup.cfg. Everything I try winds up putting
-I<contents_of_include_dirs>. I couldn't even find the place where the
string value that is returned by ConfigParser is enclosed in a list.
% grep include_dirs *.py */*.py

This gives a long list. However, in two places, include_dirs is split:
command/config.py: self.include_dirs =
string.split(self.include_dirs, os.pathsep)
command/build_ext.py: self.include_dirs =
string.split(self.include_dirs, os.pathsep)


That's the code I was missing. And I missed it because I wasn't
looking in subdirectories (duh).
Both places have similar code:

if self.include_dirs is None:
self.include_dirs = self.distribution.include_dirs or []
elif type(self.include_dirs) is StringType:
self.include_dirs = string.split(self.include_dirs, os.pathsep)


That helps immensely. But it seems to make setup.cfg non-portable, in
that you have to change the path separator in it to the one for the
platform you are on. I guess that since editing setup.cfg is expected,
that's not to bad.

Next question: I'd like to submit a bug report and patch for the
documentation of distutils. Where do I get copies of the source to
work on?

Thanks,
<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 18 '05 #3

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

Similar topics

5
by: Christian Seberino | last post by:
I have a setup.py with something like this: import glob .... setup( ..., ..., data_files =
1
by: Mathieu Malaterre | last post by:
Hello, I thought this would be easy but I guess I didn't get the distutil feeling. I am trying to write a setup for install my package but I don't understand how to do that. organisation: ...
15
by: Colin J. Williams | last post by:
The distutils download page has: -------------------------------------------------------- Current stable release The current stable release is Distutils 1.0.2; you can download it as: *...
1
by: Terry Hancock | last post by:
Some time ago, I got the idea that I wanted to build image resources from vector graphic originals, instead of marshalling hundreds of tiny little icon images by hand. I wrote "BuildImage" to do...
5
by: Fuzzyman | last post by:
Python 2.4 is built with Microsoft Visiual C++ 7. This means that it uses msvcr7.dll, which *isn't* a standard part of the windows operating system. This means that if you build a windows installer...
0
by: Maarten Sneep | last post by:
I'm trying to build PyBison on Mac OS X, and I'm running into some problems with the distutils. Just for starters: PyBison requires Pyrex. This is not a problem, and Pyrex seems to work without...
0
by: Glenn Pierce | last post by:
Hi I have a question about writing a portable setup.py script for distutils. I have a directory structure like this. FreeImage/ |----------Source/ | |------ FreeImage.h |...
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,...
7
by: Eric S. Johansson | last post by:
is there anyway I can, in a setup.py file, set and internal equivalent to the '--install-scripts' commandline option? script installation directory but I don't want on the command line where...
9
by: jtravs | last post by:
Hi all, I suspect that I'm doing something stupid, I would like some other opinions though. I'm getting started with ctypes and am trying to use distutils to help build my module. At the moment...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.