I've got a package that includes an extension that has a number of
header files in the directory with the extension. They are specified
as "depends = [...]" in the Extension class. However, Distutils
doesn't seem to do anything with them.
If I do an sdist, the include files aren't added to the tarball.
If I do a bdist_rpm, the source files get copied into the build
directory and the build starts, but the header files aren't copied
with the source file, so the build fails with a missing header file.
I find it hard to believe that this is a bug in distutils, so I'd
appreciate it if someone could tell me what I'm doing wrong.
Thanks,
<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. 3 2118
Mike Meyer wrote: I've got a package that includes an extension that has a number of header files in the directory with the extension. They are specified as "depends = [...]" in the Extension class. However, Distutils doesn't seem to do anything with them.
If I do an sdist, the include files aren't added to the tarball.
IIRC you need to add a MANIFEST.IN file to get non-Python files
(including those already referenced in your setup.py) in the mix. You'll
propably need a MANIFEST.IN looking something like the following:
include *.txt
include MANIFEST.in
include setup.py
include setup.cfg
recursive-include src *.c *.h
recursive-include docs *.html *.css *.gif *.jpg *.txt
prune someolddir
HTH,
--
Vincent Wehren If I do a bdist_rpm, the source files get copied into the build directory and the build starts, but the header files aren't copied with the source file, so the build fails with a missing header file.
I find it hard to believe that this is a bug in distutils, so I'd appreciate it if someone could tell me what I'm doing wrong.
Thanks, <mike
Mike Meyer <mw*@mired.or g> writes: I've got a package that includes an extension that has a number of header files in the directory with the extension. They are specified as "depends = [...]" in the Extension class. However, Distutils doesn't seem to do anything with them.
If I do an sdist, the include files aren't added to the tarball.
If I do a bdist_rpm, the source files get copied into the build directory and the build starts, but the header files aren't copied with the source file, so the build fails with a missing header file.
I find it hard to believe that this is a bug in distutils, so I'd appreciate it if someone could tell me what I'm doing wrong.
vincent has the solution (you need to specify them in MANIFEST.in),
but I'll add my 2 cents.
depends = [...] is used in building (it's like dependencies in make).
If one of those files change, distutils will rebuild the extension.
But that's all distutils does with it. It's braindead including stuff
in the source distribution, including depends, data files, and other
stuff you'd think it would do. When in doubt, add it to MANIFEST.in.
--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)phy sics(dot)mcmast er(dot)ca
co**********@ph ysics.mcmaster. ca (David M. Cooke) writes: vincent has the solution (you need to specify them in MANIFEST.in), but I'll add my 2 cents.
Yup. That solved the problem.
depends = [...] is used in building (it's like dependencies in make). If one of those files change, distutils will rebuild the extension. But that's all distutils does with it. It's braindead including stuff in the source distribution, including depends, data files, and other stuff you'd think it would do. When in doubt, add it to MANIFEST.in.
That pretty much sucks. I've filed a bug report (1083299) about it. If
I find time, I'll look into a fixing it myself.
<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Christian Seberino |
last post by:
I have a program that has Python and C code.
I added Extension stuff to setup.py and all .c and .h
files get into tarball fine.
(I have something like Extension("foo", glob.glob("bar/*.") )
When I try to INSTALL the package it says header (.h)
file is an unknown type. How fix this???
|
by: Christian Seberino |
last post by:
(distutils question)
I know how to configure C code with Extension class in setup.py.
But, how do you handle header files??.. Do you mention them in your
Extension(...) line??
It seems you must
1. Treat them like data files and put them *somewhere*.
|
by: Christian Seberino |
last post by:
I specify packages in my setup.py but what if I want
all py files in a directory but one???
How remove just that one?? (Without listing all files I want explicitly??)
I need header files to build a C extension but I DON't want headers
installed.
*How do I include header files in the tar.gz (tarball) file but NOT have
them be installed when "python setup.py install" done??
|
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:
|
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
| |
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))
|
by: olsongt |
last post by:
I'm doing something a little wierd in one of my projects. I'm
generating a C source file based on information extracted from python's
header files. Although I can just generate the file and check the
result into source control, I'd rather have the file generated during
the install process instead of doing it manually.
So I'd like to:
+ have the file generated when a unix user runs setup.py install.
+ have the file generated when I...
|
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...
|
by: Gary Jefferson |
last post by:
My setup.py (with extension) seems to work great for build and
install, but for bdist_rpm, compilation of the extension fails because
some of the headers needed to build the extension aren't in the bdist
tarball.
I've tried adding a 'depends=' to the Extension definition with
these header files present, but they still don't get put in the
tarball.
What's the key to getting headers or other files included
|
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...
|
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...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |