easy_install of django sdist tarball omits data files
Hi I've been trying to install a sdist tarball of a django svn snapshot using easy_install but some of the packages data files (the admin contrib app templates) aren't being installed. I've looked at the easy_install web page and can't see anything that may help me install these data files. I'm doing this as part of a deployment script that uses easy_install to install a web apps dependencies into a particular directory. Is this a misuse of easy install? django's setup.py doesn't use setuptools and so easy_install seems to be creating an sdist_egg on the fly. I'm working round this by just scripting untarring, & "setup.py install" etc. directly which is ok but it would be simpler if i could just call easy_install for all my apps dependencies. thanks, Graham
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Graham Carlyle wrote:
Hi
I've been trying to install a sdist tarball of a django svn snapshot using easy_install but some of the packages data files (the admin contrib app templates) aren't being installed. I've looked at the easy_install web page and can't see anything that may help me install these data files.
I'm doing this as part of a deployment script that uses easy_install to install a web apps dependencies into a particular directory.
Is this a misuse of easy install? django's setup.py doesn't use setuptools and so easy_install seems to be creating an sdist_egg on the fly. I'm working round this by just scripting untarring, & "setup.py install" etc. directly which is ok but it would be simpler if i could just call easy_install for all my apps dependencies.
I just hit the same problem myself. The Django folks decided to quit using setuptools (for reasons which seem incomprehensible to me), and in the process also borked the ability to use easy_install on their now-non-setuptools-basd sdist. The dodgy bit doesn't seem to be their hand-rolled alternative to 'pkg_resources.find_packages'; even run under easy_install, it appears to popluate the 'data_files' structure correctly. Howeveer, when easy_install runs the 'setup()' function (from distutils), it appears that the 'data_files' structure is not being interpreted correctly. This *may* be a setuptools / easy_install bug; I'm not sure. I did find one recent argument for revisiting that decision, which also provides an alternate easy_install-compatible setup.py: http://jannisleidel.com/2007/11/using-django-with-setuptools/ Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHa/lq+gerLs4ltQ4RAs19AKC3XNU7JsPG0icl7VtHnCGzhr1gngCgxm9H XH7pmLvJWDCijTKhX4QmWrs= =QGk1 -----END PGP SIGNATURE-----
I did find one recent argument for revisiting that decision, which also provides an alternate easy_install-compatible setup.py:
http://jannisleidel.com/2007/11/using-django-with-setuptools/
Tres.
I also like Ian's suggestion: With a little hack you can use setuptools with distutils setup.py's. Setuptools monkeypatches distutils.core.setup(), so anything run after you import setuptools gets all the setuptools features. To make use of this you can do: python -c "import setuptools, os; __file__=os.path.abspath('setup.py'); execfile('setup.py')" develop Or whatever command you want to run. Comment by Ian Bicking <http://blog.ianbicking.org/> — November 26, 2007 @ 10:09 pm<http://jannisleidel.com/2007/11/using-django-with-setuptools/#comment-29> It would be interesting to have a monkeypatch toolkit you could use on any badly written setup.py and force it to work the "correct" way. Perhaps a GHOP project? Monkeypatch to egg....?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Noah Gift wrote:
I did find one recent argument for revisiting that decision, which also provides an alternate easy_install-compatible setup.py:
http://jannisleidel.com/2007/11/using-django-with-setuptools/
Tres.
I also like Ian's suggestion:
With a little hack you can use setuptools with distutils setup.py's. Setuptools monkeypatches distutils.core.setup(), so anything run after you import setuptools gets all the setuptools features. To make use of this you can do:
python -c "import setuptools, os; __file__=os.path.abspath('setup.py'); execfile('setup.py')" develop
Or whatever command you want to run. Comment by Ian Bicking <http://blog.ianbicking.org/> — November 26, 2007 @ 10:09 pm<http://jannisleidel.com/2007/11/using-django-with-setuptools/#comment-29>
That didn't resolve the problem, but it did mvoe it around: I can get to the 'admin' application at that point, but the "root" page is busted, with the following error: Page not found (404) Request Method: GET Request URL: http://localhost:8000/ Using the URLconf defined in rztest.urls, Django tried these URL patterns, in this order: 1. ^admin/ The current URL, /, didn't match any of these. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHbB0Z+gerLs4ltQ4RAjaeAJ9Hsb5aMVqsruMrJQmnE29T5mpDMwCeMlNm KTzooJ2k/R9lGMUEJdIlDGQ= =KcBx -----END PGP SIGNATURE-----
On Dec 21, 2007, at 9:35 AM, Tres Seaver wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Graham Carlyle wrote:
Hi
I've been trying to install a sdist tarball of a django svn snapshot using easy_install but some of the packages data files (the admin contrib app templates) aren't being installed. I've looked at the easy_install web page and can't see anything that may help me install these data files.
I'm doing this as part of a deployment script that uses easy_install to install a web apps dependencies into a particular directory.
Is this a misuse of easy install? django's setup.py doesn't use setuptools and so easy_install seems to be creating an sdist_egg on the fly. I'm working round this by just scripting untarring, & "setup.py install" etc. directly which is ok but it would be simpler if i could just call easy_install for all my apps dependencies.
I just hit the same problem myself. The Django folks decided to quit using setuptools (for reasons which seem incomprehensible to me), and in the process also borked the ability to use easy_install on their now-non-setuptools-basd sdist.
Sigh. From what I read of their complaints they could have all been fixed with a 2-line diff to remove ez_setup from setup.py. I don't see anywhere they had a problem with setuptools itself, just with the bootstrapping provided by ez_setup. I tried replying to Adrian's post about this, but I think my connection dropped so it may not have gone through. If you care about Django setuptools support you should follow up to make sure they realize that they can use setuptools without requiring an internet connection. -- Matt
On Dec 23, 2007, at 10:27 PM, Matt Good wrote:
Sigh. From what I read of their complaints they could have all been fixed with a 2-line diff to remove ez_setup from setup.py. ... If you care about Django setuptools support you should follow up to make sure they realize that they can use setuptools without requiring an internet connection.
For what it is worth the allmydata.org tahoe project also requires to be able to install without requiring an internet connection (we call this "The Desert Island Scenario"). This feature was recently broken in tahoe, and with PJE's help I recently fixed it [1]. Other people are, of course, welcome to copy our technique, in which we bundle the setuptools egg itself with our own package. By the way, we actually do this with other 3rd-party libraries upon which we depend, too, which results in a large downloadable (on the order of 5 MB), and which is currently somewhat controversial on our mailing list [2]. Regards, Zooko [1] http://allmydata.org/trac/tahoe/ticket/229 [2] http://allmydata.org/pipermail/tahoe-dev/2007-December/000290.html
participants (5)
-
Graham Carlyle -
Matt Good -
Noah Gift -
Tres Seaver -
zooko