liuyang1520 / django-command-extensions

Automatically exported from code.google.com/p/django-command-extensions
MIT License
0 stars 0 forks source link

Refactor setup.py for sanity and proper sdist behavior #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
"python setup.py sdist" does not properly catch the template files in
extensions.conf.*.  The setup.py script itself is pretty hairy and
unreadable, making use of features of the Django setup.py script that do
not apply (particularly a roundabout method of capturing data files that
apparently doesn't work).

The attached MANIFEST.in (which should be in the same directory as
setup.py) makes sure that the *.tmpl files in extensions.conf are packaged.

Strictly speaking, the MANIFEST.in is all you need to get proper sdist
behavior on python 2.5 (and probably 2.4, though I haven't checked). 
However...

The attached replacement setup.py is not backwards-compatible to 2.3 (it
requires 2.4), but it accomplishes the same thing as the original script
with more clarity: the old script required more lines of code to find paths
automatically than there were paths to be found.

I touched-up the internal distribution name (which is independent of the
package name) from extensions to django-command-extensions.  This causes
setup.py sdist to create django-command-extensions-0.4_pre.tar.gz instead
of extensions-0.4_pre.tar.gz, and it affects various bits of metadata that
no one probably cares about anyway.

I tested the setup.py script against 2.4 and 2.5.  The MANIFEST.in *might*
DTRT on 2.3, but I don't have the means to check handy.

Original issue reported on code.google.com by jbalo...@gmail.com on 23 Jul 2008 at 4:31

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by v.oostv...@gmail.com on 23 Jul 2008 at 7:36

GoogleCodeExporter commented 8 years ago
Would love to have easyinstall/setuptools support as well. Cause i like the
"./setup.py develop" command :)

I'll look into getting setup.py cleaned up and proper as soon as possible. 
Cause i
would like to have this done before we start renaming things.

Original comment by v.oostv...@gmail.com on 24 Jul 2008 at 6:20

GoogleCodeExporter commented 8 years ago
Good idea.  If you need some help let me know.  Although up to know my setup 
packages have consisted of 
copying and modifying from a project that works. 

Original comment by mtr...@gmail.com on 24 Jul 2008 at 6:28

GoogleCodeExporter commented 8 years ago
To shamefully admit, that's what i did ;) and that's probably why it's a little 
dirty. 

Further since i build the releases with a mercurial command instead of 
disttools i
never hit that sdist problem.

But I'll rectify this as soon as possible, at the moment we have a summer-school
class going here at the institute that i work for, so i'm not quite sure when 
i'll
find the time but it will get in very soon :)

Original comment by v.oostv...@gmail.com on 29 Jul 2008 at 6:40

GoogleCodeExporter commented 8 years ago
humn been playing around with this.
but your setup.py version is not working for me.

if i do "python setup.py install" it forgets to copy any of the extensions.conf
datafiles.

i've added the manifest and updated setup.py a little. now it seems to do 
everything
okey on my machine. please check and report back if it still broken on yours.

(btw i want to stick with the django-like version of the setup.py script, it 
might be
hairier but having to update lists of packages manually doesn't feel right to 
me and
where likely to forget that at some point. so some 'auto discovery' is better 
imo)  

Original comment by v.oostv...@gmail.com on 2 Aug 2008 at 3:08

GoogleCodeExporter commented 8 years ago
please feel free to reopen this or create a new ticket if it's still broken in 
some case.

Original comment by v.oostv...@gmail.com on 2 Aug 2008 at 3:10