First create and activate a virtualenv to contain the installation:
$ virtualenv mypypi New python executable in mypypi/bin/python Installing setuptools.............done. Installing pip...............done. $ source mypypi/bin/activate (mypypi)$
Now install pypicloud and waitress. To get started, we’re using waitress as the WSGI server because it’s easy to set up.
(mypypi)$ pip install pypicloud[server]
If you have not already, create an access key and secret by following the AWS guide
The default configuration should work, but if you get permission errors or 403’s, you will need to set a policy on your bucket.
Generate a default server configuration
(mypypi)$ ppc-make-config -t server.ini
Note that this configuration should only be used for testing. If you want to set up your server for production, read the section on deploying.
Now you can run the server using pserve
(mypypi)$ pserve server.ini
The server is now running on port 6543. You can view the web interface at http://localhost:6543/
After you have the webserver started, you can install packages using:
pip install -i http://localhost:6543/pypi/ PACKAGE1 [PACKAGE2 ...]
If you want to configure pip to always use PyPI Cloud, you can put your
preferences into the
[global] index-url = http://localhost:6543/pypi/
To upload packages, you will need to add your server as an index server inside
[distutils] index-servers = pypicloud [pypicloud] repository: http://localhost:6543/pypi/ username: <<username>> password: <<password>>
Now to upload a package you should run:
python setup.py sdist upload -r pypicloud