The bug tracker for setuptools 0.7 or higher is on BitBucket

 

Issue121

Title SVN credentials can't be provided to easy_install
Priority wish Status resolved
Superseder Nosy List pje, yegor256
Assigned To Keywords

Created on 2011-02-08.13:32:34 by yegor256, last changed 2011-03-23.20:42:50 by pje.

Messages
msg600 (view) Author: pje Date: 2011-03-23.20:42:50
Version with this fix is now available at http://peak.etelecommunity.com/snapshots/setuptools-0.6c12dev-r88793.tar.gz

Thanks.
msg593 (view) Author: yegor256 Date: 2011-02-17.07:10:36
yes, right
msg592 (view) Author: pje Date: 2011-02-16.20:46:18
So, you tried making that change and it actually works, then?
msg591 (view) Author: yegor256 Date: 2011-02-16.14:48:04
Yes, this is exactly what I was looking for!
msg590 (view) Author: pje Date: 2011-02-10.18:06:20
Try replacing the _download_svn routine in the setuptools.package_index module with this code, and let me know if it does what you want:

    def _download_svn(self, url, filename):
        url = url.split('#',1)[0]   # remove any fragment for svn's sake
        creds = ''
        if url.lower().startswith('svn:') and '@' in url:
            scheme, netloc, path, p, q, f = urlparse.urlparse(url)
            if not netloc and path.startswith('//') and '/' in path[2:]:
                netloc, path = path[2:].split('/',1)
                auth, host = urllib.splituser(netloc)
                if auth:
                    if ':' in auth:
                        user, pw = auth.split(':',1)
                        creds = " --username=%s --password=%s" % (user, pw)
                    else:
                        creds = " --username="+auth
                    netloc = host
                    url = urlparse.urlunparse((scheme, netloc, url, p, q, f))
        self.info("Doing subversion checkout from %s to %s", url, filename)
        os.system("svn checkout%s -q %s %s" % (creds, url, filename))
        return filename
msg589 (view) Author: yegor256 Date: 2011-02-10.17:16:59
Sure, sorry for miscommunication, my fault. The command line looks like this:

svn checkout svn://svn.example.com/repo/trunk/my-egg --username=user --password=secret
msg588 (view) Author: pje Date: 2011-02-09.22:53:37
I'm not clear on what you're saying.  The credentials are already in the URL, are they not?  So easy_install doesn't need any extra options.

The question I've been asking is, how do you pass these credentials to the "svn" command line?  Can you give me an example of an "svn checkout" command line that does what you want?
msg587 (view) Author: yegor256 Date: 2011-02-09.18:45:14
How about adding additional options for easy_install? Something like:

easy_install --svn-user=user --svn-password=secret svn://svn.example.com/repo/trunk/my-egg

Looks good for me, what do you think?
msg586 (view) Author: pje Date: 2011-02-09.17:46:15
That's what I'm asking you.  If "svn" does not handle passwords in an SVN URL, there is no way that easy_install can change that.  If you know a way to make svn handle it, then easy_install could perhaps be changed.

If there is no such way, however, then easy_install cannot do this, and you will have to enter the password when prompted.  (Another alternative is to serve your Subversion repository using HTTP or SSH instead of the svn:// protocol.)
msg585 (view) Author: yegor256 Date: 2011-02-09.15:58:50
Can you please give an example? How should it work?
msg584 (view) Author: pje Date: 2011-02-09.14:30:01
If you want this to change, you'll need to supply a command line that you can type to make svn NOT prompt for the password.  Easy_install relies on the "svn" command to do the actual checkout.
msg583 (view) Author: yegor256 Date: 2011-02-08.18:30:13
It prompts for the password. Everything works fine when it is http:// protocol, instead of svn://

Subversion 1.6.
msg582 (view) Author: pje Date: 2011-02-08.18:26:18
If you do "svn co 
svn://user:secret@svn.example.com/repo/trunk/my-egg", does that work, 
or does it prompt you for the password?

My guess is that svn itself is the problem here, because easy_install 
does not remove password information from the URL, it just passes the 
URL as-is to the "svn" command.
msg581 (view) Author: yegor256 Date: 2011-02-08.13:32:34
I'm trying to install Python EGG with `easy_install`, providing a URL of Subversion repository, where sources are hosted:

    $ easy_install svn://user:secret@svn.example.com/repo/trunk/my-egg
    Authentication realm: <svn://svn.example.com:3690> repo
    Password for 'me':
    
The problem is that the repository is password protected. How can I provide the desired username/password to `easy_install`?

Everything works fine when I'm using `http://` protocol instead of `svn://`
History
Date User Action Args
2011-03-23 20:42:50pjesetstatus: chatting -> resolved
messages: + msg600
2011-02-17 07:10:36yegor256setmessages: + msg593
2011-02-16 20:46:18pjesetmessages: + msg592
2011-02-16 14:48:04yegor256setmessages: + msg591
2011-02-10 18:06:20pjesetmessages: + msg590
2011-02-10 17:16:59yegor256setmessages: + msg589
2011-02-09 22:53:37pjesetmessages: + msg588
2011-02-09 18:45:14yegor256setstatus: resolved -> chatting
messages: + msg587
2011-02-09 17:46:15pjesetpriority: critical -> wish
status: chatting -> resolved
messages: + msg586
2011-02-09 15:58:50yegor256setmessages: + msg585
2011-02-09 14:30:01pjesetmessages: + msg584
2011-02-08 18:30:13yegor256setmessages: + msg583
2011-02-08 18:26:18pjesetstatus: unread -> chatting
nosy: + pje
messages: + msg582
2011-02-08 13:32:34yegor256create