- This fork modifies the tools in the following way:
- removes the credentials from .pypirc file so they are set via .aws/credentials in line with other tools
- takes AWS region as a config parameter (required) to allow for connection to GovCloud
Tools to bypass a PyPICloud installation and communicate directly with S3
Uploads file(s) to the PyPICloud S3 bucket directly and performs an admin API call to rebuild the PyPICloud index after.
Example:
$ upload dist/*
Uploading example-project/example-project-0.0.1.tar.gz ..... done!
Uploading example-project/example_project-0.0.1-py2-none-any.whl ..... done!
Uploading example-project/example_project-0.0.1-py2.7.egg ...... done!
PyPICloud server at http://your.pypicloud.server/pypi updated
It's fine if the file names use altering hypens/underscores per release type
like you see above, they only need to match the initial part of the key before
the /
to be considered the same package.
Downloads the latest or a specific version directly from S3. Does not talk to PyPICloud and does not install the downloaded package. You can use pip to do either/both of those things.
Also possible with the download command is the --url
flag to only
print a download URL (usable for 5 minutes).
By default, if there are multiple releases of the same package+release,
download will prefer wheels, then eggs, then source distributions. You
can override that behavior with the --egg
and --src
flags.
Examples:
$ download example_project==0.0.1
example_project-0.0.1-py2-none-any.whl
$ download example-project --egg
example_project-0.0.1-py2.7.egg
Pipes and redirects work like you'd expect:
$ download example_project --src | tar -xzf -
Lists a package's releases, or releases of a package at a specific version. Again, talks straight to S3 and bypasses the PyPICloud installation.
Example:
$ list example_project
example-project==0.0.1 : example-project-0.0.1.tar.gz
example-project==0.0.1 : example_project-0.0.1-py2.7.egg
example-project==0.0.1 : example_project-0.0.1-py2-none-any.whl
Listing multiple packages or packages with a version specifier is also supported.
When called without any arguments, list
will display all known
packages.
Rehosts an upstream package from PyPI into the pypicloud installation. This can be handy if you have pypicloud clients which only have access to it and s3 but not the rest of the internet.
Example:
$ rehost requests==1.0.0
Collecting requests==1.0.0
Downloading requests-1.0.0.tar.gz (335kB)
100% |████████████████████████████████| 335kB 929kB/s
Saved /var/folders/53/kl4v4_9509ng148kp_pwmc5h0000gn/T/tmpuj5JUJ/requests-1.0.0.tar.gz
Successfully downloaded requests
Uploading requests/requests-1.0.0.tar.gz ............ done!
PyPICloud server at http://your_pypicloud_server/pypi updated
If a specific version is not provided, the latest will be used. Multiple packages can be used in the same command.
$ pip install pypicloud-tools
$ git clone https://github.com/ccpgames/pypicloud-tools.git
$ cd pypicloud-tools
$ python setup.py install
Configuration for pypicloud-tools piggybacks on your ~/.pypirc
file.
You can specify an alternate config file with the --config
flag, but
it must be in the same syntax. That syntax is:
[pypicloud]
repository:http://your.pypicloud.server/pypi
username:admin
password:hunter7
bucket:your_bucket
region: aws_region
acl:optional_acl
The key must be pypicloud
, it is the only key pypicloud-tools
will look at. The username/password combination should have admin
credentials on the PyPICloud installation as it needs to call
/admin/rebuild
after a succesful upload.
pypicloud-tools was written by Adam Talsma
Copyright (c) 2015 CCP hf.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.