Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > distutils: "build" command

Reply
Thread Tools

distutils: "build" command

 
 
TP
Guest
Posts: n/a
 
      03-05-2009
Hi everybody,

I have programmed a python package, and I would like to use distutils with
it. My package has the following structure after doing sdist and build:

$ python setup.py sdist
[...]
$ python setup.py build
[...]
$ tree
..
|-- MANIFEST
|-- MANIFEST.in
|-- README
|-- build
| `-- lib
| `-- utils
| |-- __init__.py
| `-- __init__.pyc
|-- dist
| `-- utils-1.0.tar.gz
|-- utils
| |-- __init__.py
| |-- __init__.pyc
| |-- utils_1
| | |-- __init__.py
| | |-- __init__.pyc
| | `-- toto.py
| `-- utils2
| |-- __init__.py
| `-- foo.py
`-- setup.py

So, in the "build" directory, I do not get all the the modules ("utils1"
and "utils2" directory), but only the first level of the package (files
under "utils" directory). Whereas all the files are included in the
utils-1.0.tar.gz archive made with "sdist".
How to modify setup.py and/or MANIFEST.in to include all the subdirectories
in the "build" directory when doing "setup.py build"? I have googled a bit
without finding anything.
These are my MANIFEST.in and setup.py files:

$ cat MANIFEST.in
include README
recursive-include utils *.py

$ cat setup.py
from distutils.core import setup

setup( name = 'utils'
, version = '1.0'
, url = ''
, author = ''
, author_email = ''
, packages = [ 'utils' ] )

Thanks in advance

--
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\
9&1+,\'Z4(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      03-06-2009
En Thu, 05 Mar 2009 14:10:38 -0200, TP <(E-Mail Removed)>
escribió:

> Hi everybody,
>
> I have programmed a python package, and I would like to use distutils
> with
> it. My package has the following structure after doing sdist and build:
>
> $ python setup.py sdist
> [...]
> $ python setup.py build
> [...]
> $ tree
> .
> |-- MANIFEST
> |-- MANIFEST.in
> |-- README
> |-- build
> | `-- lib
> | `-- utils
> | |-- __init__.py
> | `-- __init__.pyc
> |-- dist
> | `-- utils-1.0.tar.gz
> |-- utils
> | |-- __init__.py
> | |-- __init__.pyc
> | |-- utils_1
> | | |-- __init__.py
> | | |-- __init__.pyc
> | | `-- toto.py
> | `-- utils2
> | |-- __init__.py
> | `-- foo.py
> `-- setup.py
>
> So, in the "build" directory, I do not get all the the modules ("utils1"
> and "utils2" directory), but only the first level of the package (files
> under "utils" directory). Whereas all the files are included in the
> utils-1.0.tar.gz archive made with "sdist".


You have to explicitely enumerate all packages. See the last paragraph
here:
http://docs.python.org/distutils/set...whole-packages

"Keep in mind that although package_dir applies recursively, you must
explicitly list all packages in packages: the Distutils will not
recursively scan your source tree looking for any directory with an
__init__.py file."

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NCQ (Native Command Queuing) and TCQ (Tagged Command Queuing) Explained Silverstrand Front Page News 0 04-17-2006 05:49 PM
Need simple command for validating xml files at the command line Bernd Oninger XML 1 07-07-2004 06:20 PM
RUN/execute a Command-Line command from an ASP page. Lucas Cowald ASP .Net 4 10-23-2003 11:09 AM
distutil: how do a post-install command like create a soft link? ..or where add command to setup.py?? Christian Seberino Python 0 10-21-2003 10:29 PM
copying value of DDL in a Datagrid "pre-edit command" to value in "post edit command" San Diego Guy ASP .Net 0 08-07-2003 08:59 PM



Advertisments