Hello,<br><br>Working with several PyPI servers is making the command lines quite long and hard to keep up.<br><br>For instance, If I want to upload an egg on two servers I have to do this:<br><br>$ python setup.py register sdist bdist_egg upload -r <a href="http://my.cool.server/">http://my.cool.server/</a><br>
$ python setup.py register sdist bdist_egg upload -r <a href="http://pypi.python.org/pypi">http://pypi.python.org/pypi</a><br><br>Brrrr.... :)<br><br>The setuptools `alias` command make things easier, but we still need to add in setup.cfg these<br>
alias, and have to call several commands to commit just one egg to several places.<br><br>I would like to propose a new command in distutils to make things easier.<br>This proposal is based on the `.pypirc` syntax of my previous proposal <br>
(<a href="http://wiki.python.org/moin/EnhancedPyPI">http://wiki.python.org/moin/EnhancedPyPI</a>) <br><br>1. Defining releasing strategies for each repository<br><br>For each repository, we could add `release` value<br>to tell distutils the sequence to be run when `release` is called::<br>
<br>&nbsp; [distutils]<br>&nbsp; index-servers =<br>&nbsp;&nbsp;&nbsp; pypi<br>&nbsp;&nbsp;&nbsp; my-other-server<br>&nbsp;&nbsp;&nbsp; my-other-server-with-its-own-realm<br><br>&nbsp; [pypi]<br>&nbsp; repository:<a href="http://pypi.python.org/pypi/">http://pypi.python.org/pypi/</a><br>
<br>&nbsp; username:tarek2<br>&nbsp; password:secret<br>&nbsp; release:register sdist build_mo bdist_egg upload<br>&nbsp; release-strategy : *<br><br>&nbsp; [my-other-server]<br>&nbsp; username:tarek2<br>&nbsp; password:secret<br>&nbsp; repository:<a href="http://example.com/repository">http://example.com/repository</a><br>
&nbsp; release:register sdist build_mo bdist_egg upload<br>&nbsp; release-strategy:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acme.*<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specific.package<br><br>&nbsp; [my-other-server-with-its-own-realm]<br>&nbsp; username:tarek3<br>&nbsp; password:secret3<br>&nbsp; repository:<a href="http://example2.com/repository">http://example2.com/repository</a><br>
&nbsp; realm:acme<br>&nbsp; release:register sdist build_mo bdist_egg upload<br>&nbsp; release-strategy:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acme.*<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acme2.*<br><br>The `release-strategy` value would be a set of glob-like expressions<br>that will be used to match the package being released, in order<br>
to qualify it for the given repository.<br><br>- when `release` is not provided, the repository is ommited by the release command<br>- when `release` is provided, but not `release-strategy`, the default value <br>&nbsp; for `release-strategy` would be *<br>
<br>Of course these are just optional shorcuts<br><br>2. Making a release<br><br>This call:<br><br>&nbsp; $ cd acme.package<br>&nbsp; $ python setup.py release<br><br>Would then look in .pypirc where &quot;acme.package&quot; (defined in the package<br>
meta-data name) needs to be released, and will do this equivalent sequence:<br><br>&nbsp; $ python setup.py register sdist build_mo bdist_egg upload -r pypi<br>&nbsp; $ python setup.py register sdist build_mo bdist_egg upload -r my-other-server-with-its-own-realm<br>
<br>The interesting thing about glob expressions is that it allows setting a release strategy<br>upon the namespaces. For example, it makes it possible to upload the eggs of a given<br>company to a dedicated server, and defines specific eggs to be released at pypi.<br>
<br><br>Tarek<br><br>