[Distutils] setuptools for people behind a firewall

Phillip J. Eby pje at telecommunity.com
Tue Jul 12 05:04:03 CEST 2005


At 04:58 PM 7/11/2005 +0100, Paul Moore wrote:
>I've just had a look at the new documentation for setuptools. I've not
>read it all in detail yet, but one thing struck me regarding the
>"automatically download dependencies" feature.
>
>It isn't going to work for people (like me) stuck behind a firewall
>that Python doesn't support (Windows NTLM based firewall). Obviously,
>setuptools is never going to be able to resolve a situation like this,
>nor would I expect it to.

Have you tried APS?  (i.e., http://ntlmaps.sf.net/ )  Its pages seem to 
suggest it can authenticate to NTLM proxy servers like the one you're 
dealing with, and it sounds like a general-purpose solution to the proxying 
problem.  The only issue is that you'd need to configure your system such 
that urllib considers the APS address to be the proxy to use, but then 
*all* Python apps (or any app that reads the same proxy configuration) will 
be able to get out past the firewall.


>But can I suggest two possible changes to
>make it easier for people with limited internet access?
>
>1. A "manual download" mode, where setuptools lists the files which it
>wants you to obtain, and then leaves it to you how you get them. I'm
>not sure how plausible this would be, given the necessarily iterative
>process involved in resolving dependencies, but even a little help
>would be useful (a report of unresolved dependencies when run with a
>--no-download flag would be the most basic help).

EasyInstall can't *find* the files without HTTP, since that's what it uses 
to talk to PyPI.  So "manual download" mode would mean you'd effectively 
need to find all the files yourself!  I'm not sure how much help 
EasyInstall could actually be in such a process.


>2. A way of specifying an external command to use to download files
>over HTTP. This would (for example) allow me to use curl, which does
>support HTLM proxies, rather than relying on Python's built-in HTTP
>support, which doesn't.

This is potentially possible, but EasyInstall's PyPI searches and 
SourceForge download support need to be able to detect the MIME type of an 
HTTP response in order to decide whether it has an HTML page or not.  If 
APS doesn't work for you, this might be an option, it's just a tricky one 
to implement in ez_setup.py, which wants to be small and simple and do no 
command-line parsing of its own, because it's also a module that gets 
imported by setup scripts.  OTOH, perhaps an environment variable would be 
the way to go there, if we have to.



More information about the Distutils-SIG mailing list