Skip to main content
https://secure.travis-ci.org/ignacysokolowski/pypi-uploader.png https://coveralls.io/repos/ignacysokolowski/pypi-uploader/badge.png https://pypip.in/v/pypi-uploader/badge.png https://pypip.in/d/pypi-uploader/badge.png

Upload source distributions of your requirements to your PyPI server.

The problem

If you are using a custom PyPI server as a proxy and want to upload some packages there, it’s not easy. For each package, you need to download its source and upload it using setup.py script:

# Uploading requests==2.0.0
$ git clone https://github.com/kennethreitz/requests
$ cd requests
$ git checkout v2.0.0
# Assuming you have 'internal' index-server configured in your '~/.pypirc'.
$ python setup.py sdist upload -r internal
# Uploading coverage==3.5
$ cd ..
$ git clone https://github.com/nedbat/coveragepy
$ cd coveragepy
$ git checkout coverage-3.5
$ python setup.py sdist upload -r internal

You could also download the packages directly into the PyPI’s index directory.

$ ssh pypi-mirror.yourdomain.com
$ pip install requests==2.0.0 coverage==3.5 -d ~/.packages

If there’s more than one package, you could use a requirements file.

$ scp requirements.txt pypi-mirror.yourdomain.com:.
$ ssh pypi-mirror.yourdomain.com
$ pip install -r requirements.txt -d ~/.packages

But it’s still too much. You should be able to do it with one command. And what if you don’t have SSH access to the PyPI server host?

The solution

One command for download and upload.

Upload packages by name

$ pypiupload packages mock==1.0.1 requests==2.2.1 -i internal

Upload packages from requirements file

$ pypiupload requirements requirements.txt -i internal

Upload source distribution files

$ pypiupload files packages/mock-1.0.1.tar.gz \
  packages/requests-2.2.1-py2.py3-none-any.whl -i internal

More options

$ pypiupload --help
$ pypiupload <command> --help

Supported PyPI servers

Tested only on pypiserver.

Installation

Install from PyPI:

$ pip install pypi-uploader

Or go to the root directory with setup.py script and install it:

$ python setup.py install

Documentation

Documentation is available at https://pypi-uploader.readthedocs.org

Source

Source is available at https://github.com/ignacysokolowski/pypi-uploader

License

PyPI Uploader is licensed under the MIT license.

Changelog

Version 1.1.0

  • Adapt to newer versions of pip: use pip download instead of pip install for downloading packages, and --no-binary :all: instead of --no-use-wheel to not use wheel archives.

Version 1.0.0

  • Added --no-use-wheel option

Version 0.1.0

First release

Issues and contributing

Please report any issues on GitHub at https://github.com/ignacysokolowski/pypi-uploader/issues

Or contribute by submitting a pull request with your changes following these rules:

  • Follow PEP 8 rules

  • Follow PEP 257 rules

  • Follow The Zen of Python

  • Test your commits

  • Write meaningful commit messages

  • Keep the documentation up-to-date

To run tests and build the docs, you have to install additional packages:

$ python setup.py develop
$ pip install -r requirements_dev.txt

Running tests:

$ tox

Building documentation:

$ cd docs
$ make html

Release files for pypi-uploader 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypi-uploader 1.1.0
File Size Uploaded
pypi-uploader-1.1.0.tar.gz 19.4 kB Details

Release files / pypi-uploader-1.1.0.tar.gz

Download URL pypi-uploader-1.1.0.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c011671afe815d1f9cf914ab498c005a143841b8adb6cbd8903896e1b4ef5a8c
BLAKE2b-256 checksum
How to use checksums
7097bb14d2b7f3dd11e863a3b82bcb2e6d64c90135b443373cc9a8f7e6abeef6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file

1.0.0

1 release file

0.1.0

1 release file

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page