No description
  • Python 98.7%
  • Dockerfile 1.3%
Find a file
Alberto Garcia Hierro 05366a1d43
fix: use python 3.11-slim as base
3.12 doesn't have setuptools by default. Using the slim image reduces
the download size.
2024-09-11 17:37:53 +01:00
.github/workflows Try uploading attestations 2024-09-11 10:36:38 -04:00
simplepypi/bin Use 'normalize' instead of 'canonicalize' 2021-12-13 08:58:05 -05:00
.dockerignore Add Dockerfile and update README 2018-05-14 11:37:39 -04:00
Dockerfile fix: use python 3.11-slim as base 2024-09-11 17:37:53 +01:00
LICENSE adding explicit license file 2016-01-29 15:19:20 -05:00
README.md Add docs about setuptools 2020-12-18 17:09:08 -05:00
setup.py Try uploading attestations 2024-09-11 10:36:38 -04:00

This is a really, really, simple HTTP PyPI-like server.

It is intended to be used for companies or organizations that need a private PyPi.

It literally supports four functions:

- Allows uploading of packages
- Downloading by package (or package and version)
- A / page that is navigatable with a web browser
- /pypi/ listing

It does not support:

- Stopping you from overwriting a package with the same name / version
- Registering packages
- Any sort of ACLs

To use it run "simplepypi". You can upload packages by:

Install twine if you haven't already:

pip install twine

Build your package if you haven't already:

python setup.py sdist

Upload your package using twine:

$ twine upload --repository-url http://127.0.0.1:8000/ dist/*
Uploading distributions to http://127.0.0.1:8000/
Enter your username: <whatever>
Enter your password: <doesn't matter, see above>

Then, when you want to install packages from it you do:

pip install -i http://127.0.0.1:8000/pypi <your favorite package>

Or, if you're stuck in the stone ages with setuptools/easy_install:

from setuptools import setup

setup(
    ...
    install_requires=['<package>'],
    dependency_links=['http://127.0.0.1:8000/packages/<package>'],
)

python setup.py install

To use the docker image, build and run:

docker build -t simplepypi .
docker run -it -p 8000:8000 simplepypi

Not using twine yet? Here is the legacy way of uploading Python packages (not recommended):

Modify your ~/.pypirc so it looks like:

[distutils]
index-servers =
    pypi
    local

[local]
username: <whatever>
password: <doesn't matter, see above>
repository: http://127.0.0.1:8000

[pypi]
...

Run this on the setup.py of your favorite package:

$ python setup.py sdist upload -r local

And that's it!