distutils setup ignoring scripts

Raseliarison nirinA nirina at mail.blueline.mg
Tue Mar 15 11:33:13 EST 2005


"Jack Orenstein" wrote:

> I'm using Python 2.2 on RH9. I have a set of Python modules
> organized
> into a root package and one other package named foobar. setup.py
> looks
> like this:
>
>      from distutils.core import setup
>
>      setup(
>          name = 'foobar',
>          version = '0.3',
>          description = 'Foo Bar',
>          author = 'Jack Orenstein',
>          author_email = 'jao at geophile.com',
>          packages = ['', 'xyz'],
>          scripts = ['bin/foobar']
>          )
>
> The resulting package has everything in the specified directories,
> but
> does not include the script. I've tried making the path bin/foobar
> absolute, but that doesn't help. I've googled for known bugs of this
> sort but have come up emtpy. (The first line of bin/foobar is
> #!/usr/bin/python.)
>
> I've also tried using DISTUTIL_DEBUG, which has been uninformative,
> (e.g. no mention of bin/foobar at all).
>
> Can anyone see what I'm doing wrong?

i think there's nothing wrong.
the script (i guess you mean the setup.py file) is not included
into the package because you haven't specified it to be so.
add:
  setup(
        ...
        py_modules=["setup"],
        ...
    )
inside your script to perform inclusion.

another way to include other files not specified by the setup script
is to write a MANIFEST where you indicate those files. then build the
package with the sdist command:

$ cat > MANIFEST
bin/foobar
bin/anotherfoobar
anotherbin/barfoo
setup.py
MANIFEST

ctrl-D
$ python setup.py sdist

>
> Jack Orenstein
>

hope this helps.

--
nirinA















More information about the Python-list mailing list