[Distutils] stdeb-0.3 error

Andrew Straw strawman at astraw.com
Fri Sep 18 07:08:30 CEST 2009


Gerry Reno wrote:
> sudo easy_install stdeb  # brought in stdeb 0.3
>
> $ cd myappdir # where my setup.py is located
>
> $# following http://github.com/astraw/stdeb/  quickstart 1
>
> $ python -c "import stdeb; execfile('setup.py')" sdist_dsc && \
> >   cd `find deb_dist -mindepth 1 -maxdepth 1 -type d` && \
> >   dpkg-buildpackage -rfakeroot -uc -us && \
> >   cd ../.. &&
> >   echo ".deb created successfully in deb_dist/"
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
>  File "setup.py", line 41, in <module>
>   
> sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),
> "bin"))
> NameError: name '__file__' is not defined

You can use something more elaborate like

python -c "import
stdeb,sys;f='setup.py';sys.argv[0]=f;execfile(f,{'__file__':f,'__name__':'__main__'})"
sdist_dsc

for the first line.



More information about the Distutils-SIG mailing list