Call for testing: New setup.py

36 views
Skip to first unread message

Adrian Holovaty

unread,
Oct 16, 2006, 6:03:33 PM10/16/06
to django-d...@googlegroups.com
Hi all,

I've refactored Django's setup.py so that it uses the plain Python
distutils installation method rather than ez_setup/setuptools. This
means it no longer requires an Internet connection to install Django.
Hooray!

But I have only tested this on Linux, so I'd appreciate it if folks
could test out the command "python setup.py install" on various
different platforms. Just grab the SVN version of Django and try
installing it using "python setup.py install".

For the record, we previously discussed this on django-developers here:

http://groups.google.com/group/django-developers/browse_thread/thread/af002765821b5e57/27a927caaee9ad78

The "straw that broke the camel's back," in this case, happened this
weekend when I was doing a Django tutorial in Boston and encountered
two people who'd had problems installing Django due to a setuptools
problem that was out of our control. (Namely, it was due to the fact
that Python 2.5's version of setuptools required a certain version of
ez_setup, or vice versa, or some other peculiar problem like that,
which was out of our control.)

There was something about seeing this problems in real life, with
face-to-face conversations with real Django users, that finally put me
over the edge.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com

Joseph Kocherhans

unread,
Oct 16, 2006, 6:23:56 PM10/16/06
to django-d...@googlegroups.com
On 10/16/06, Adrian Holovaty <holo...@gmail.com> wrote:
>
> But I have only tested this on Linux, so I'd appreciate it if folks
> could test out the command "python setup.py install" on various
> different platforms. Just grab the SVN version of Django and try
> installing it using "python setup.py install".

Works fine with OS X 10.4.8 (PPC) + python 2.4.3 via darwinports.

Joseph

Jay Parlar

unread,
Oct 16, 2006, 6:31:31 PM10/16/06
to django-d...@googlegroups.com
On 10/16/06, Adrian Holovaty <holo...@gmail.com> wrote:
> But I have only tested this on Linux, so I'd appreciate it if folks
> could test out the command "python setup.py install" on various
> different platforms. Just grab the SVN version of Django and try
> installing it using "python setup.py install".

Python 2.5 with OS X 10.4.8 (Intel) seems fine. I'll try Python 2.4
with OS X 10.3.9 when I get home.

Jay P.

flo...@gmail.com

unread,
Oct 16, 2006, 6:31:33 PM10/16/06
to Django developers
Didn't work for me on Windows XP with python 2.4.3...what I got is
this:

> C:\Documents and Settings\floguy\Desktop\newdjango>setup.py install
> running install
> > running build
> running build_py
> running build_scripts
> creating build
> creating build\scripts-2.4
> copying and adjusting django\bin\django-admin.py -> build\scripts-2.4
> running install_lib
> warning: install_lib: 'build\lib' does not exist -- no Python modules to install
>
> running install_scripts
> copying build\scripts-2.4\django-admin.py -> C:\Python24\Scripts
> running install_data

I checked, and django-admin.py did get moved into the scripts
directory, but I couldn't find any of the other files in any directory
in or under C:\Python24.

Joseph Heck

unread,
Oct 16, 2006, 6:39:12 PM10/16/06
to django-d...@googlegroups.com
WinXP, Python 2.43 - worked OK for me. Dropped all the goodies into c:\python24\lib\site-packages\django...

-joe

Jay Parlar

unread,
Oct 16, 2006, 7:20:14 PM10/16/06
to django-d...@googlegroups.com
OS X 10.3.9 with Python 2.4.3 seems fine.

Jay P.

Matthew Flanagan

unread,
Oct 16, 2006, 8:03:37 PM10/16/06
to django-d...@googlegroups.com
Hi Adrian,

On 17/10/06, Adrian Holovaty <holo...@gmail.com> wrote:
>
> Hi all,
>
> I've refactored Django's setup.py so that it uses the plain Python
> distutils installation method rather than ez_setup/setuptools. This
> means it no longer requires an Internet connection to install Django.
> Hooray!
>
> But I have only tested this on Linux, so I'd appreciate it if folks
> could test out the command "python setup.py install" on various
> different platforms. Just grab the SVN version of Django and try
> installing it using "python setup.py install".

In the buildbot slave I'm setting up for pybots.org I get a problem
with the old setuptools version of django-admin.py not being replaced
by the real one.

My setup has a temporary python2.5 build in
/tmp/python-buildbot/local/bin/python with django trunk r3905
(pre-setuptools removal) installed in
/tmp/python-buildbot/local/lib/python2.5/site-packages.

If I do a '/tmp/python-buildbot/local/bin/python setup.py install'
with the latest trunk it doesn't replace the
/tmp/python-buildbot/local/bin/django-admin.py script or remove the
old django egg. If I then go and remove the old egg from site-packages
django-admin.py breaks.

If I do a completely clean install without a previous setuptools
version of django present then it works fine. This is on a Solaris 10
system with python 2.5.

du...@habmalnefrage.de

unread,
Oct 17, 2006, 11:04:43 AM10/17/06
to django-d...@googlegroups.com
Hi,

one diff for MANIFEST.in. The docs/*.txt of bdist_rpm are missing!

Regards,
Dirk
--
GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl

MANIFEST.diff

James Crasta

unread,
Oct 17, 2006, 2:20:04 PM10/17/06
to django-d...@googlegroups.com
works here, python 2.5, linux x86_64 (gentoo)

DavidA

unread,
Oct 17, 2006, 3:12:38 PM10/17/06
to Django developers
Works on Windows 2003 Server SP1 + Python 2.4.2

DavidA

unread,
Oct 17, 2006, 4:00:36 PM10/17/06
to Django developers

DavidA wrote:
> Works on Windows 2003 Server SP1 + Python 2.4.2

I spoke too soon. I tried to run 'manage.py test' and it complained
about an invalid action so I poked around and the management.py in
C:\Python24\lib\site-packages\django\core was different than the one in
the SVN checkout directory (that I had just done an install from).

I figured it installed the old stuff in the build directory so I remove
the build directory and re-ran 'setup.py install' and now I get this
error:

C:\Django\trunk>setup.py install


running install
running build
running build_py
running build_scripts
creating build
creating build\scripts-2.4
copying and adjusting django\bin\django-admin.py -> build\scripts-2.4
running install_lib
warning: install_lib: 'build\lib' does not exist -- no Python modules
to install

running install_scripts
copying build\scripts-2.4\django-admin.py -> C:\Python24\Scripts
running install_data

C:\Django\trunk>

I tried manually creating 'build\lib' but that didn't help (it still
doesn't build or install). I also tried 'setup.py build' and it does
nothing. I then tried removing the django installation directory in
lib\site-packages and it still won't install anything.

Now I've sort of hosed myself - guess I'll downgrade...
-Dave

DavidA

unread,
Oct 17, 2006, 4:05:28 PM10/17/06
to Django developers

DavidA wrote:
> I spoke too soon.

I _really_ spoke too soon.

I tried again as 'python setup.py install' rather than 'setup.py
install' and it worked. For some reason my file type mapping on this
particular Win box was mucked up.

sbain

unread,
Oct 17, 2006, 8:57:49 PM10/17/06
to Django developers
I missed the previous discussion, but I'm not pleased with this change.

The developer version of Django is made available only via Subversion,
so the requirement for internet access at install is hardly a
disadvantage. Django is, after all, a web framework!

The best way to install development Django on a Windows system has been
to use the setuptools-provided command:

setup.py develop

With setuptools, this command copies nothing to site-packages except a
setuptools-based link to the Django checkout, and Django is easily kept
up to date with svn up. SInce Windows has no built-in linking, this
setuptools-based linking is quite useful, and especially for newbies!

This same installation approach has in my experience worked worked
equally well on linux. (That this approach has not been mentioned at
the front of the tutorial is an issue with the tutorial, not with
setuptools. I first discovered it in the comments section for tutorial
1.)

On Oct 16, 5:03 pm, "Adrian Holovaty" <holov...@gmail.com> wrote:
> Hi all,
>
> I've refactored Django's setup.py so that it uses the plain Python
> distutils installation method rather than ez_setup/setuptools. This
> means it no longer requires an Internet connection to install Django.
> Hooray!
>
> But I have only tested this on Linux, so I'd appreciate it if folks
> could test out the command "python setup.py install" on various
> different platforms. Just grab the SVN version of Django and try
> installing it using "python setup.py install".
>
> For the record, we previously discussed this on django-developers here:
>

> http://groups.google.com/group/django-developers/browse_thread/thread...

James Bennett

unread,
Oct 17, 2006, 9:53:58 PM10/17/06
to django-d...@googlegroups.com
On 10/17/06, sbain <gsb...@gmail.com> wrote:
> The developer version of Django is made available only via Subversion,
> so the requirement for internet access at install is hardly a
> disadvantage. Django is, after all, a web framework!

It is, but the setuptools requirement of an active internet connection
makes it *extremely* difficult to use setuptools for things like
automated installs on multiple machines -- it's not uncommon for
servers to be installed, or mostly installed, while totally offline or
when connected only to a private backplane. With setuptools that just
wasn't possible.

> With setuptools, this command copies nothing to site-packages except a
> setuptools-based link to the Django checkout, and Django is easily kept
> up to date with svn up. SInce Windows has no built-in linking, this
> setuptools-based linking is quite useful, and especially for newbies!

It's a tradeoff, though, because setuptools seems to be extremely
brittle -- even minor changes in the easy_install/setuptools chain can
apparently break the entire system, and that's much, much worse.

In the long run, I think this change is for the best; issues with easy
upgrades of SVN checkouts can be worked around, but not being
installable on disconnected machines, or not being installable at all
for a while whenever the easy_install stuff changes upstream, are much
more severe and much harder to work around.

--
"May the forces of evil become confused on the way to your house."
-- George Carlin

sbain

unread,
Oct 18, 2006, 2:48:25 AM10/18/06
to Django developers
Is there any reason to use either setuptools or distutils if one is
doing an automated install of Django? Isn't it just copy or link the
django directory to the Python path, copy django-admin.py to an
executable path, and you are pretty much done?

How would one now recommend that a new Windows developer install Django
in a such a way as to facilitate keeping his Django updated to the
trunk?

The easiest to explain approach that I know about would be to ignore
Django's setup.py. Instead install setuptools, manually create a
Django.eggs-link file in site-packages, and then copy django-admin.py
to the Python scripts directory. There are other ways - mostly
involving access to Windows' painful UI for creating persistent
environment variables - but they are not easier to explain or perform
than the technique I just described

Thus this change seems like a regression in the ease of a
best-practices installation for new developers on Windows.

And in defense of Phillip Eby's very laudable efforts, I suspect that
the vast majority of all issues with the setuptools install would have
been resolved by simply changing the instructions to:

1) First download and run the latest ez_setup.py
2 Checkout Django trunk
2) Then run python setup.py develop

And users on all platforms would have then had a Django that is easily
updated by svn up.

Will McCutchen

unread,
Oct 18, 2006, 11:18:12 AM10/18/06
to Django developers
sbain wrote:
> How would one now recommend that a new Windows developer install Django
> in a such a way as to facilitate keeping his Django updated to the
> trunk?

I only dabble with Django from time to time, but here is how I have it
set up (the following assumes C:\Python24\ as the root):

1. svn checkout into Lib/site-packages/django-src

2. Create Lib/site-packages/django.pth file with the following line as
its only content:
django-src

3. Create Scripts/django-admin.bat file with the following line as its
only content:
@python
C:\Python24\Lib\site-packages\django-src\django\bin\django-admin.py %*

4. Make sure C:\Python24\Scripts is on your PATH, and django-admin
works just like it does in the documentation.

5. Stay up to date with svn up Lib/site-packages/django-src

A slight pain to set it up this way, but once everything is in place it
is smooth sailing. I did all this specifically because I didn't want
to use setuptools/ez_install.

Hope this helps,


Will.

evariste

unread,
Oct 18, 2006, 3:34:36 PM10/18/06
to Django developers
Works fine for me on OS X 10.4.8, Python 2.4, Intel platform.

lbolo...@gmail.com

unread,
Oct 19, 2006, 1:01:55 PM10/19/06
to Django developers
Adrian Holovaty wrote:

> I've refactored Django's setup.py so that it uses the plain Python
> distutils installation method rather than ez_setup/setuptools. This
> means it no longer requires an Internet connection to install Django.
> Hooray!

Works for me: Python2.4 on Windows XP SP2

Lorenzo

AlexL

unread,
Oct 22, 2006, 4:08:49 AM10/22/06
to Django developers
Worked fine.
WinXP SP2, Python 2.4.2

Matt Good

unread,
Dec 24, 2007, 12:15:05 AM12/24/07
to Adrian Holovaty, django-d...@googlegroups.com
On Oct 16 2006, 2:03 pm, "Adrian Holovaty" <holov...@gmail.com> wrote:
> I've refactored Django's setup.py so that it uses the plain Python
> distutils installation method rather than ez_setup/setuptools. This
> means it no longer requires an Internet connection to install Django.
> Hooray!

From what I've seen your real complaints have all been with the
ez_setup behavior, and not setuptools itself. It's ez_setup that
requires an internet connection so that it can bootstrap setuptools if
it's not already installed. Setuptools only requires a connection if
you want to use the dependency feature. So, from what I can tell your
problems should have been fixed with a 2-line change to remove
ez_setup from setup.py. If you prefer to stick with distutils, that's
fine, but don't give up on setuptools just because of ez_setup.

-- Matt
Reply all
Reply to author
Forward
0 new messages