[Distutils] More control over uploading an sdist and egg to PyPI.

Kannan Goundan kannan at cakoose.com
Sat Dec 7 02:50:49 CET 2013


We use setuptools for our library.  I'm trying to figure out a way to upload
an sdist and an egg to PyPI without having to put my PyPI credentials in a
file.  Please let me know if this is not the right mailing list for this
question.

Our setup is that the entire team has access to the source code repository,
but only the release managers have access to the credentials needed to make
releases to PyPI (they're in a "fake" home directory).  To do a release, you
run:

   cd project-dir
   HOME="/release-manager-secrets/fake-pypi-home-dir" \
      python setup.py bdist_egg sdist upload

This works ok, but we would prefer to not have our PyPI credentials on the
filesystem (unencrypted) at all.  I'd like to run "setup.py bdist_egg sdist"
first and then run a separate command that uploaded the egg and sdist.  This
command would ask for my credentials on stdin.

How can I write such a program?  Is there a PyPI HTTP API I can use?  Does
setuptools have a public interface that I can call?

Thanks!
- Kannan



More information about the Distutils-SIG mailing list