[Distutils] docs on using setuptools in a release cycle with RPMS

Noah Gift noah.gift at gmail.com
Thu Jan 17 21:04:04 CET 2008


>>>
>> In order to create an egg, to my knowledge, you create a build/lib  
>> directory and place your scripts or library inside, then run  
>> setup.py bdist_egg.
>
> Where did you get that knowledge?  We should correct whatever source  
> you got that from, because that is absolutely *not* the way to do  
> it, and is in fact a good way to lose your work.  (E.g. "setup.py  
> clean" will delete it.)

I may have just assumed this, by looking at examples and reading  
output from stdout.  This may have been a trial and error solution, so  
I am glad I asked and found out this was incorrect.  Of course, I come  
from a R/D and Systems Administration background so I am pretty used  
to doing really, really bad things I am not supposed to do :)
>
>> That is correct.  I am able to create eggs with entry points that  
>> work just fine without specifying my module, but are you saying  
>> that in order to use the bdist_rpm command that I also need to  
>> include:
>>
>> py_modules=['liten']
>
> No, what I'm saying is that you should have that line in your  
> setup.py, period, and you should not mess with the contents of build/ 
> lib or really *anything* under build.  The build/ directory is used  
> by the distutils to build things.  Your source code goes directly  
> alongside setup.py, generally speaking.

Ok, this is good to know.  That is much more intuitive.  I may have  
run into some issue that made me think creating a build/lib directory  
would help.


> You may want to review the "Distributing Python Modules"  
> documentation at:
>
>  http://docs.python.org/dist/
>
> As you'll find there, there is no mention of putting things into  
> build/ - you put things in the directory where your setup.py is, and  
> the distutils (or setuptools) are responsible for copying them into  
> build/ and other places.  There are absolutely no user-serviceable  
> parts in build/.
>
> What you've been doing is a bit like taking a power drill and then  
> turning it by the handle instead of plugging it in and pulling the  
> trigger.  In some cases it may seem to be work, but mostly you are  
> just making things harder than they need to be.  :)
>
Believe it or not, I am writing a chapter on Eggs, Buildout, and  
Virtualenv for our O'Reilly book.  I hope to do a good job of  
explaining how to use eggs/buildout/virtualenv and build RPM's and  
other packages such as AIX/HP-UX, Debian/Ubuntu.  I might be asking a  
few more dumb questions, so I will try to read as much as I can to  
limit the total number.  I think a large source of confusion for me,  
was thinking that distutils was somehow deprecated, and that I don't  
even need to read the docs.  I have heard so many horror stories about  
distutils, that I have mistakenly thought they are somehow broken  
badly, and it is not worth reading, and that they are replaced by  
setuptools.  I suppose there is going to be some confusion for me in  
trying to understand the intersection between disutils and setuptools,  
as I am not sure what I am expected to know from distutils and what  
setuptools replaces.  I was operating under, obviously a false  
assumption, that setuptools was the was forward and was completely  
ignoring distutils.

ok, off to read the distutils docs....










More information about the Distutils-SIG mailing list