https://github.com/dee-me-tree-or-love/pypiserver-local-docker-upload-example
A small example of uploading packages to `pypiserver` in a local docker container
https://github.com/dee-me-tree-or-love/pypiserver-local-docker-upload-example
docker examples pypiserver twine
Last synced: 2 months ago
JSON representation
A small example of uploading packages to `pypiserver` in a local docker container
- Host: GitHub
- URL: https://github.com/dee-me-tree-or-love/pypiserver-local-docker-upload-example
- Owner: dee-me-tree-or-love
- Created: 2022-12-05T12:15:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-05T12:17:26.000Z (over 2 years ago)
- Last Synced: 2025-02-01T07:28:04.507Z (4 months ago)
- Topics: docker, examples, pypiserver, twine
- Language: Python
- Homepage: https://github.com/pypiserver/pypiserver
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://github.com/pypiserver/pypiserver#apache-like-authentication-htpasswd).2. Next, run the pypiserver in docker
> Note that `-vvv` parameter sets the verbose output
```bash
# 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 .`
```bash
# 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
```bash
# 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
```bash
$ ls ../data/packages | grep "hello_world"
hello_world-... # should show all the uploaded hello_world distributions
```