Fetchez le Python

Technical blog on the Python programming language, in a pure Frenglish style

distutils: multiple servers in .pypirc

Since I am working on PloneSoftwareCenter to make it PyPI-compatible, I have worked on distutils side to make the register and upload command more friendly when an egg has to be registered to several servers.

The problem with the actual .pypirc file is that it won’t let you define many username/password for many servers: it is dedicated for one server. In the meantime, you can specify in a command line option which server you want to deal with:

$ python setup.py register -r http://my.server/pypi

But this will take the username/password in .pypirc. So if your username differs from one server to another, it won’t work.

I have worked on an enhanced version for this, described here: http://wiki.python.org/moin/EnhancedPyPI

The patch is ready, and comes with new unit tests register and upload commands didn’t have yet. The new .pypirc format was shaped with the help and feedback of catalog-sig people, thanks to Martin v. Loewis and Fred Drake and others. I am going to submit it for inclusion today. If it is accepted and integrated we will be able to deal with our eggs like this:

$ python setup.py register sdist upload    # goes to PyPI
$ python setup.py register sdist upload -r plone.org   # goes to plone.org ;) 

The next step is to provide a patch for a permissive trove classifier in PyPI. Then all PyPI-like servers will be able to provide the same service for egg developers, no matter how they deal with classifiers.

Filed under: plone, python, zope ,

3 Responses

  1. What would be great if you could specify the upload target in the project’s setup.py file. That’s one less command line switch that you can forget :-)

    Thanks a lot for the work, ease of uploading to plone.org is important.

  2. @Reinout: Thanks for the feedback and encouragements.

    For that case I think it would be better to work with aliases. For instance:

    python setup.py alias plone register sdist upload -r plone.org

    Will create an alias in you setup.cfg, so you can call:

    python setup.py plone

  3. Didn’t know about that alias command. Handy. I just added a ‘pypi’ alias somewhere so that I don’t forget to upload both a bdist_egg and an sdist :-)

    Thanks.

Leave a Reply