Skip to content

dee-me-tree-or-love/pypiserver-local-docker-upload-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Basics

This is a small replication package for using pypiserver with local docker.

Clone the files in this repo to test it out.

Getting started

To start an authentication-protected pypiserver

  1. First create a htpasswd.txt file with authentication details as described here.

  2. Next, run the pypiserver in docker

    Note that -vvv parameter sets the verbose output

    # with auth
    docker run --rm -it -p 88:8080 -v $(pwd)/htpasswd.txt:/data/.htpasswd -v $(pwd)/data/packages:/data/packages --name pypiserver pypiserver/pypiserver:latest -vvv -P /data/.htpasswd

To start an authentication-free pypiserver

  1. Directly, run the pypiserver in docker, overriding the authentication parameters with -P . -a .

    # without auth
    docker run --rm -it -p 88:8080 -v $(pwd)/data/packages:/data/packages --name pypiserver pypiserver/pypiserver:latest -vvv -P . -a .

Uploading

  1. Build and upload the demo package

    # n.b: I am using `poetry` in this example to simplify the build steps
    #   see https://python-poetry.org/docs/cli/#build
    $ cd hello_world
    $ poetry build
    $ twine upload  --repository-url=http://localhost:88/  dist/* --verbose
    ...
    Response from http://localhost:88/:
    200 OK
  2. Check the upload results in the expected folder

    $ ls ../data/packages | grep "hello_world"
    hello_world-... # should show all the uploaded hello_world distributions

About

A small example of uploading packages to `pypiserver` in a local docker container

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages