Packages uploading.
Bases: object
Uploads source distributions to a PyPI server.
Example:
>>> uploader = PackageUploader('http://localhost:8000', 'user', 'pass')
>>> uploader.upload('amqp-1.4.4.tar.gz')
<Response [200]>
>>> uploader.upload('amqp-1.4.4.tar.gz')
Traceback (most recent call last):
...
PackageConflictError: Package amqp-1.4.4.tar.gz already uploaded.
| Parameters: |
|
|---|
Instantiate the uploader using configuration from .pypirc file.
Read the rc file using pypirc.RCParser.
Use the repository‘s authentication config from the rc file, if the file exists and the repository section is defined. The username and password defined in the file can be overriden by the given arguments.
If the rc file or the section for the repository doesn’t exist, use the repository argument as the server host.
Return a new instance of PackageUploader.
| Parameters: |
|
|---|
Instantiate the uploader using repository configuration dictionary.
Examples:
>>> repo_config = {
... 'repository': 'http://localhost:8000',
... 'username': 'foo',
... 'password': 'bar',
... }
>>> uploader = PackageUploader.from_repository_config(repo_config)
>>> uploader.host, uploader.username, uploader.password
'http://localhost:8000', 'foo', 'bar'
>>> uploader = PackageUploader.from_repository_config(
... repo_config, username='bar')
>>> uploader.host, uploader.username, uploader.password
'http://localhost:8000', 'bar', 'bar'
Return a new instance of PackageUploader.
| Parameters: |
|
|---|
Upload a package under the given path.
Return requests.Response from the PyPI server.
If the package is already uploaded, raise exceptions.PackageConflictError. On other errors raise requests.exceptions.HTTPError.
| Parameters: | filepath – A path to the package file you want to upload. |
|---|