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> [distutils]<br> index-servers =<br> pypi<br> my-other-server<br> my-other-server-with-its-own-realm<br><br> [pypi]<br> repository:<a href="http://pypi.python.org/pypi/">http://pypi.python.org/pypi/</a><br>
<br> username:tarek2<br> password:secret<br> release:register sdist build_mo bdist_egg upload<br> release-strategy : *<br><br> [my-other-server]<br> username:tarek2<br> password:secret<br> repository:<a href="http://example.com/repository">http://example.com/repository</a><br>
release:register sdist build_mo bdist_egg upload<br> release-strategy:<br> acme.*<br> specific.package<br><br> [my-other-server-with-its-own-realm]<br> username:tarek3<br> password:secret3<br> repository:<a href="http://example2.com/repository">http://example2.com/repository</a><br>
realm:acme<br> release:register sdist build_mo bdist_egg upload<br> release-strategy:<br> acme.*<br> 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> 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> $ cd acme.package<br> $ python setup.py release<br><br>Would then look in .pypirc where "acme.package" (defined in the package<br>
meta-data name) needs to be released, and will do this equivalent sequence:<br><br> $ python setup.py register sdist build_mo bdist_egg upload -r pypi<br> $ 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>