GithubHelp home page GithubHelp logo

foxel / s3pypi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gorilla-co/s3pypi

0.0 2.0 0.0 49 KB

CLI tool for creating a Python Package Repository in an S3 bucket.

Home Page: https://novemberfive.co/blog/opensource-pypi-package-repository-tutorial/

License: MIT License

Python 72.98% HTML 2.63% Roff 24.39%

s3pypi's Introduction

S3PyPI

S3PyPI is a CLI tool for creating a Python Package Repository in an S3 bucket.

An extended tutorial on using this tool can be found here.

Installation

Install the latest version:

pip install --upgrade s3pypi

Install the development version:

git clone -b develop [email protected]:novemberfiveco/s3pypi.git
cd s3pypi/ && sudo pip install -e .

Setting up S3 and CloudFront

Before you can start using s3pypi, you must set up an S3 bucket for your Python Package Repository, with static website hosting enabled. Additionally, you need a CloudFront distribution for serving the packages in your S3 bucket to pip over HTTPS. Both of these resources can be created using the CloudFormation templates provided in the cloudformation/ directory:

aws cloudformation create-stack --stack-name STACK_NAME \
    --template-body file://cloudformation/s3-pypi.json \
    --parameters ParameterKey=AcmCertificateArn,ParameterValue=ACM_CERT_ARN \
                 ParameterKey=DomainName,ParameterValue=DOMAIN_NAME

Managing Your Server Certificates

Distributing packages

You can now use s3pypi to create Python packages and upload them to your S3 bucket. To hide packages from the public, you can use the --private option to prevent the packages from being accessible directly via the S3 bucket (they will only be accessible via Cloudfront and you can use WAF rules to protect them), or alternatively you can specify a secret subdirectory using the --secret option:

cd /path/to/your/awesome-project/
s3pypi --bucket mybucket [--private] [--secret SECRET]

Installing packages

Install your packages using pip by pointing the --extra-index-url to your CloudFront distribution (optionally followed by a secret subdirectory):

pip install --upgrade awesome-project --extra-index-url https://pypi.example.com/SECRET/

Alternatively, you can configure the index URL in ~/.pip/pip.conf:

[global]
extra-index-url = https://pypi.example.com/SECRET/

s3pypi's People

Contributors

brandond avatar chrisrut avatar holinnn avatar james-emerton avatar jamiecressey avatar kimvais avatar mdwint avatar nikos avatar oliverhofkens avatar rubenvdb avatar scotta avatar shikow avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.