473,614 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ 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_i nclude_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.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 18 '05 #1
2 2317
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_i nclude_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_fil es. This is called a single time only in dist.py,
namely from parse_config_fi les. 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_di rs =
string.split(se lf.include_dirs , os.pathsep)
command/build_ext.py: self.include_di rs =
string.split(se lf.include_dirs , os.pathsep)

Both places have similar code:

if self.include_di rs is None:
self.include_di rs = self.distributi on.include_dirs or []
elif type(self.inclu de_dirs) is StringType:
self.include_di rs = string.split(se lf.include_dirs , os.pathsep)

HTH,
Martin
Jul 18 '05 #2
"Martin v. Löwis" <ma****@v.loewi s.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_i nclude_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_di rs =
string.split(se lf.include_dirs , os.pathsep)
command/build_ext.py: self.include_di rs =
string.split(se lf.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_di rs is None:
self.include_di rs = self.distributi on.include_dirs or []
elif type(self.inclu de_dirs) is StringType:
self.include_di rs = string.split(se lf.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.or g> 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
7528
by: Christian Seberino | last post by:
I have a setup.py with something like this: import glob .... setup( ..., ..., data_files =
1
2649
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: setup.py /bin/
15
4115
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: * Distutils-1.0.2.tar.gz (source distribution) (233k) * Distutils-1.0.2.zip (source distribution) (274k) * Distutils-1.0.2.win32.exe (Windows installer) (187k)
1
1713
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 this for me, and so far, it works very well, so I'm trying to make it easier to use and available to more developers. There is a brief (and somewhat dated) tutorial explaining what BuildImage itself does at:
5
2674
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 using distutils - it *requires* msvcr7.dll in order to run. This is true even if your package is a pure python package. This means that when someone tries to use a windows installer created with Python 2.4, on a machine with only python 2.3 - it...
0
1867
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 problems, at least the primes sample module shows a nice 25 to 30 fold speed increase over the pure python version. I used the distutils to create the module from the primes.pyx sample, following the setup.py from the PyBison distrubution:
0
1445
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 | |----------Dist/ | |------FreeImage.lib
6
2340
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, PyObject *args){ int n, input; if (!PyArg_ParseTuple(args, "i", &input))
7
1533
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 things can go horribly wrong if the user forgets. I would like to create a new default setting for this commandline option as well as a couple of other such as the data default directory. --- eric
9
4150
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 I simply want distutils to build a shared c library (not a python extension!). Under linux, the following works, under windows xp id doesn't (which I guess is obvious, but the linux success lead me on). I have two files at the moment...
0
8182
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8130
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8627
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8433
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6088
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5540
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4052
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2568
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 we have to send another system
0
1425
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.