pip compatible server to serve Python packages out of GitHub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Brett Langdon 7cb0c32b4b
change docker image name
9 years ago
cmd/pypihub support non-published releases 9 years ago
vendor/github.com remove blang/semver 9 years ago
.gitignore ignore compiled binary 9 years ago
Dockerfile Setup docker and stuffs 9 years ago
Makefile change docker image name 9 years ago
README.md add requirements.txt example 9 years ago
asset.go support non-published releases 9 years ago
client.go remove asset logging 9 years ago
config.go Initial working prototype 9 years ago
docker-compose.yml Setup docker and stuffs 9 years ago
router.go add asset fetching logging 9 years ago
utils.go Initial working prototype 9 years ago

README.md

PyPIHub

PyPI server for serving Python packages out of GitHub.

Installing

go get github.com/brettlangdon/pypihub

Running

pypihub -h
usage: pypihub --username USERNAME --access-token ACCESS-TOKEN [--bind BIND] [REPONAMES [REPONAMES ...]]

positional arguments:
  reponames              list of '<username>/<repo>' repos to proxy for (env: PYPIHUB_REPOS)

options:
  --username USERNAME, -u USERNAME
                         Username of GitHub user to login as (env: PYPIHUB_USERNAME)
  --access-token ACCESS-TOKEN, -a ACCESS-TOKEN
                         GitHub personal access token to use for authenticating (env: PYPIHUB_ACCESS_TOKEN)
  --bind BIND, -b BIND   [<address>]:<port> to bind the server to (default: ':8287') (env: PYPIHUB_BIND) [default: :8287]
  --help, -h             display this help and exit

Example

pypihub -u "<username>" -a "<github-access-token>" "brettlangdon/flask-env" "brettlangdon/flask-defer" [... <owner>/<repo>]
export PYPIHUB_USERNAME="<username>"
export PYPIHUB_ACCESS_TOKEN="<github-access-token>""
export PYPIHUB_REPOS="brettlangdon/flask-env brettlangdon/flask-defer [... <owner>/<repo>]"
pypihub

Endpoints

  • / - Page containing all links for all projects/assets
    • This endpoint can be used with --find-links to make all projects accessible
    • e.g. pip install --find-links http://localhost:8287/
  • /<owner> - Page containing all links for a given GitHub repo owner
    • This endpoint can be used with --find-links to make all projects for a given GitHub owner accessible
    • e.g. pip install --find-links http://localhost:8287/brettlangdon
  • /<owner>/<repo> - Page containing all links for a specific GitHub repo
    • This endpoint can be used with --find-links to make all releases for a specific GitHub repo accessible
    • e.g. pip install --find-links http://localhost:8287/brettlangdon/flask-env
  • /simple - PyPI simple index page
    • This page lists all of the project names available
    • This endpoint can be used with --index-url or --extra-index-url
    • e.g. pip install --extra-index-url http://localhost:8287/simple
  • /simple/<repo> - PyPI simple index project links page
    • This page contains the links for the given project name
    • This endpoint can be used with --find-links, but is typically used by pip when using --extra-index-url
    • See /simple example above for usage

Usage with pip

Simple index

pip install --index-url http://localhost:8287/simple <project>
pip install --extra-index-url http://localhost:8287/simple <project>
pip install --find-links http://localhost:8287/ <project>
pip install --find-links http://localhost:8287/<owner> project
pip install --find-links http://localhost:8287/<owner>/<project> project

requirements.txt

--find-links http://localhost:8287/
<project>
pip install -r requirements.txt