bisos.pypiserver: A Private Python Package Index (pypiserver + pypi-browser) via BISOS Capability Bundles
Overview
bisos.pypiserver is a BISOS package for running a private Python package index on a BISOS host: pypiserver, the index pip installs from and twine uploads to, and pypi-browser, a web UI for browsing the packages in it (and the files inside them). It is a BISOS Capability Bundle (CBS/CBM) of systemd-planted Command Services.
A planted pointer leaf (cbmProc.spcs, at sys/cbm/collective/hereWeb/pypiserver/) subprocess-invokes a Capability Bundle Specification (pypiserver-cbs.pcs). The CBS declares package installation (sboms), the two systemd units (pypiserver and pypi-browser), and the assembly step that makes both reachable on one name, http://pypiserver.here: pypi-browser at /, the index at /simple/.
Debian packages neither. Both are Python programs, installed at exact pins: pypiserver into BISOS’s shared venv of adopted software components (/bisos/venv/asc), and pypi-browser into an isolated venv of its own, because it does not work with the Starlette version already in asc (see below).
Package Documentation At Github
The information below is a subset of the full of documentation for this bisos-pip package. More complete documentation is available at: https://github.com/bisos-pip/pypiserver-cs
Table of Contents TOC
WSGI, ASGI and Their Servers: Why There Are Two Processes Behind nginx
-
Day-to-Day Admin: ``pypiserverAdmin.cs` <#day-to-day-admin-pypiserveradmincs>`__
Direct Command Cheat Sheet: ``quickPypiserver.cs` <#direct-command-cheat-sheet-quickpypiservercs>`__
-
Move pypi-browser back into ``asc` once a release works with Starlette 1.x (upstream PR #15) <#move-pypi-browser-back-into-asc-once-a-release-works-with-starlette-1x-upstream-pr-15>`__
Architectures other than amd64 for the isolated venv’s hashed set
Plant the CBM leaf in brorawBisos (``sys/cbm/collective/hereWeb/pypiserver/`) <#plant-the-cbm-leaf-in-bro_rawbisos-syscbmcollectiveherewebpypiserver>`__
The BISOS pypiserver Model
bisos.pypiserver (/bisos/git/bxRepos/bisos-pip/pypiserver) packages pypiserver 2.4.2 and pypi-browser-webapp 0.0.12 as a hereWeb CBS/CBM, on the pattern of bisos.kafka, bisos.prometheus and bisos.grafana (the cbm-package-authorship skill): one module of facts (pypiserverInfo.py), exact pins, config written only when absent, a read-only driftCheck, a service sbom and a usage sbom joined only by the CBS. It is the first of these packages whose programs are Python, so it is also where the pattern’s Python rules were set: the shared asc venv, its exceptions under /bisos/venv/isolated/, and how pins are applied.
It is for the rawBisos layer: convenient and insecure by design. Securing it is a separate layer.
As of 2026-10-16 it is materialized on one host (Debian 13): both units active, a package uploaded with twine, installed back with pip and browsed in pypi-browser through http://pypiserver.here, driftCheck agrees.
WSGI, ASGI and Their Servers: Why There Are Two Processes Behind nginx
A Python web application does not open a network socket itself. It is a function that a separate server process calls for each request; the contract between the two is a standard interface:
WSGI — the older, synchronous one (a request per thread). pypiserver is a WSGI app (bottle). Its server here is waitress, a production WSGI server.
ASGI — the asynchronous successor. pypi-browser is an ASGI app (Starlette). Its server here is uvicorn, the common ASGI server.
nginx cannot run Python; it is the reverse proxy in front of both, as it is for every .here service:
browser / pip / twine --> nginx :80 (pypiserver.here) --+--> waitress 127.0.0.1:24013 pypiserver (/simple, /packages, POST /)
+--> uvicorn 127.0.0.1:24014 pypi-browser (everything else)
One Name, Two Programs: the Routing
pip reads /simple/ and /packages/ (pypiserver). twine uploads by POST / (pypiserver). Everything else, including GET /, is pypi-browser. Because / is both the upload endpoint and the browser’s home page, the vhost routes it by request method, with an nginx map rather than nginx’s fragile if. The vhost also raises client_max_body_size to 200m: nginx’s default of 1m would refuse most uploads.
Where the Python Goes: asc and isolated
``/bisos/venv/asc`` — the shared venv of BISOS’s adopted software components, where Python programs go by default (bisos.airflow’s are there). pypiserver, waitress and passlib are installed there at exact pins. Because the venv is shared, the install first does a dry run and refuses if it would change the version of any package these pins do not own (e.g. Airflow’s Starlette). Hashes cannot be required in a shared venv.
``/bisos/venv/isolated/<program>/`` — the exceptions: a venv of its own for a program that has been shown not to work in asc, named by the program. Each records why, and moves back to asc when the reason is gone. Being private, its whole resolved set is pinned with hashes (pip --require-hashes).
pypi-browser is such an exception (isolated/pypiBrowser): pypi-browser-webapp 0.0.12, its latest release (2024-06), uses Starlette’s pre-1.0 TemplateResponse and fails on Starlette 1.x — and asc has Starlette 1.6.0 (Airflow’s). pypi-browser does not constrain Starlette, so pip installs it without complaint and every page is a 500. Its venv pins Starlette 0.52.1. The upstream fix is chriskuehl/pypi-browser PR #15, unmerged.
twine (the usage side) is a CLI, so it is installed through pipx (/bisos/pipx), itself one venv per CLI.
The Login: rawBisos Convenience, Insecure by Design
Downloading and listing need no login. Uploading needs admin / pypiserver: the rawBisos convention, user admin, password the service’s name. It is in /etc/pypiserver/htpasswd (written only when absent, hashed with aprmd5crypt). pypi-browser has no login. A “secure it” layer, on top, is where a real password, HTTPS and listening beyond loopback belong.
What Gets Installed, and Where
Every fact below lives in one place, py3/bisos/pypiserver/pypiserverInfo.py.
What |
Where |
Owner |
|---|---|---|
The pypiserver account |
uid/gid 506, from bisos.banna sysAccts |
— |
pypiserver 2.4.2, waitress 3.0.2, passlib 1.7.4 |
/bisos/venv/asc (shared) |
the venv’s owner |
pypi-browser-webapp 0.0.12 + 21 deps (Starlette 0.52.1, uvicorn 0.54.0) |
/bisos/venv/is olated/pypiBrowser |
the venv’s owner |
twine 7.0.0 (usage side) |
/bisos /pipx/venvs/twine, /bi sos/pipx/bin/twine |
pipx |
Upload login |
/etc/p ypiserver/htpasswd |
root:pypiserver 640 |
Index flags |
/etc/ default/pypiserver (ARGS=) |
root:pypiserver 640 |
Browser settings |
/etc/de fault/pypi-browser (PYPI_BROWSER_*) |
root:pypiserver 640 |
The index (uploaded distributions) |
/var/lib/p ypiserver/packages |
pypiserver |
pypi-browser’s cache |
/var/lib/pypise rver/browser-cache |
pypiserver |
No fallback: a package that is not in this index is not redirected to pypi.org (--disable-fallback); use --extra-index-url to combine it with PyPI. pypiserverAdmin.cs -i driftCheck reports the config files, the units, and every pinned package of both venvs against its pin. The isolated venv’s hashed set covers amd64 with Python 3.13 (two of its wheels are binary); the sbom refuses another architecture.
The 3 sboms: Server, Usage, and the CBS’s
sbom |
Installs |
Pulls in |
|---|---|---|
pypiserver-sbom.pcs |
the account, pypiserver in asc, pypi-browser isolated, config |
nothing |
pyp iserverUsage-sbom.pcs |
twine, through pipx |
nothing |
p ypiserverCbs-sbom.pcs |
nothing of its own |
the two above |
The Python packages are installed by func-bearing pseudo-packages, not through bisos.sbom’s pipPkgsList / pipxPkgsList: those ignore versions and skip anything already installed, so a pin would never be applied or bumped (recorded in AI-Outputs.org).
The 2 systemd Units
Unit |
Runs |
Ordering |
|---|---|---|
p ypiserver-sysd.pcs |
asc/bin /pypi-server $ARGS (waitress, chosen by auto) |
Af ter=network.target |
pyp i-browser-sysd.pcs |
` isolated/pypiBrowse r/bin/uvicorn … py pi_browser.app:app` |
After=p ypiserver.service, Wants= pypiserver.service |
Both run as User=pypiserver. Logs go to journald.
Listeners and Ports
Ports are assigned in bisos.banna (tcpPorts.py), never hardcoded. Both bind loopback only.
Listener |
Address |
banna name |
|---|---|---|
pypiserver (waitress) |
127.0.0.1:24013 |
pypiserver |
pypi-browser (uvicorn) |
127.0.0.1:24014 |
pypiBrowser |
Both, via nginx |
http://pypiserver.here |
— (127.0.22.116) |
Installation
You can install bisos.pypiserver with pip or pipx.
Installation With pip
If you need access to bisos.pypiserver as a python module, install it with pip:
pip install bisos.pypiserver
Installation With pipx
If you only need access to bisos.pypiserver on the command line, install it with pipx:
pipx install bisos.pypiserver
The following commands are made available:
pypiserverAdmin.cs — day-to-day admin CS for this host’s pypiserver.here installation.
quickPypiserver.cs — direct-command cheat sheet: pip, twine, curl, the two units.
pypiserver-assemble.cs — assembly step: pypiserver.here dns entry and nginx vhost.
cbmProc-pypiserver.spcs — planted CBM pointer that materializes the CBS at this host.
The planted .pcs files (pypiserver-cbs.pcs, the three sboms, the two -sysd.pcs, pypiserver-here-dns.pcs, pypiserver-wvd.pcs) are invoked directly from py3/bin/.
Usage
Materialization
pypiserver-sbom.pcs -i sbom_fullUpdate # install the server only
pypiserverUsage-sbom.pcs -i sbom_fullUpdate # install the usage side only (twine)
pypiserver-cbs.pcs -i cbs_materialize # both sboms + units + assemble
cbmProc-pypiserver.spcs -i cbm_enable # at the planted CBM leaf, then:
cbmProc-pypiserver.spcs -i cbm_materialize
The asc venv must exist first (pyVenv-asc-sbom.pcs -i sbom_fullUpdate); the sbom says so if it does not.
Using the Index: pip and twine
pip ignores an index on plain HTTP, other than localhost, unless it is named with --trusted-host (PIP_TRUSTED_HOST): every .here is HTTP.
pip install --extra-index-url http://pypiserver.here/simple/ --trusted-host pypiserver.here <package> # with PyPI
pip install --index-url http://pypiserver.here/simple/ --trusted-host pypiserver.here <package> # this index only
/bisos/pipx/bin/twine upload --repository-url http://pypiserver.here/ -u admin -p pypiserver dist/*
Browse the index at http://pypiserver.here/; a package’s page lists its files, and opening one shows what is inside it.
Day-to-Day Admin: pypiserverAdmin.cs
pypiserverAdmin.cs -i hostInfo # fqdn, listeners, login, venvs, config/data paths
pypiserverAdmin.cs -i servicesInfo # links for operating the 2 systemd units
pypiserverAdmin.cs -i indexInfo # pip, twine and curl against the index
pypiserverAdmin.cs -i driftCheck # read-only: config, units and both venvs' pins vs pypiserverInfo
pypiserverAdmin.cs -i fullUpdate # the three info Cmnds together
Direct Command Cheat Sheet: quickPypiserver.cs
quickPypiserver.cs
Key Files
py3/bisos/pypiserver/pypiserverInfo.py — the single source of facts: the venvs and pins (the isolated venv’s hashed set and why it is isolated), paths, ports, the login, the generators of the two EnvironmentFiles and the units’ identity lines, the install scripts (the asc guard, the isolated venv, twine, htpasswd), and the drift helpers.
py3/bin/pypiserver-cbs.pcs — CBS declaring the bundle (sbom + 2 sysd units + assemble).
py3/bin/cbmProc-pypiserver.spcs — planted CBM pointer leaf that materializes the CBS.
py3/bin/pypiserver-sbom.pcs, pypiserverUsage-sbom.pcs, pypiserverCbs-sbom.pcs — the server, usage and CBS sboms via bisos.sbom.
py3/bin/pypiserver-sysd.pcs, py3/bin/pypi-browser-sysd.pcs — the two units.
py3/bin/pypiserver-assemble.cs — assembly step (dns + vhost).
py3/bin/pypiserver-here-dns.pcs — .here fake-domain DNS registration for pypiserver.here.
py3/bin/pypiserver-wvd.pcs — nginx vhost for pypiserver.here: the routing between the two programs.
py3/bin/pypiserverAdmin.cs, py3/bin/quickPypiserver.cs — admin CS and cheat sheet.
py3/tests/verify.sh — smoke test of every command and of pypiserverInfo’s invariants.
py3/setup.py, py3/pypiProc.sh — PyPI packaging (setup.py is dblock-driven; do not hand-edit).
Part of BISOS — ByStar Internet Services Operating System
Layered on top of Debian, BISOS (By* Internet Services Operating System) is a unified and universal framework for developing both internet services and software-service continuums that use internet services. See Bootstrapping ByStar, BISOS and Blee for information about getting started with BISOS.
BISOS is a foundation for The Libre-Halaal ByStar Digital Ecosystem which is described as a cure for losses of autonomy and privacy in a book titled: Nature of Polyexistentials
bisos.pypiserver is part of BISOS. It is a standalone package that can be used independently of the full BISOS environment.
Documentation and Blee-Panels
bisos.pypiserver is part of the ByStar Digital Ecosystem http://www.by-star.net.
This module’s primary documentation is in the form of Blee-Panels. Blee-Panels are in the ./panels directory. From within Blee and BISOS these panels are accessible under the Blee “Panels” menu.
See file:./panels/bisos.pypiserver/_nodeBase_/fullUsagePanel-en.org for a starting point.
bisos.pypiserver is best developed with Blee, the By* BISOS Libre-Halaal Emacs Environment — a layer on top of Emacs and BISOS which creates a comprehensive integrated usage and development environment.
Support
Planned Improvements
TODO The “secure it” layer: a real upload password, HTTPS (which also removes the need for –trusted-host), listening beyond loopback
TODO Move pypi-browser back into asc once a release works with Starlette 1.x (upstream PR #15)
TODO Architectures other than amd64 for the isolated venv’s hashed set
TODO Plant the CBM leaf in brorawBisos (sys/cbm/collective/hereWeb/pypiserver/)
Metadata
Release files for bisos.pypiserver 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bisos_pypiserver-0.1.tar.gz | 56.7 kB | Without provenance | Details for bisos_pypiserver-0.1.tar.gz |
Release files / bisos_pypiserver-0.1.tar.gz
| Download URL | bisos_pypiserver-0.1.tar.gz |
|---|---|
| Size | 56.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc21c911e4340729fb242350ec66919f58c3a96ef4bf0adc641ce07ebfcb8938
|
|
BLAKE2b-256 checksum How to use checksums |
a3fd06ea2399800f7c9a8082460fd7591c5bb651a6f73b2052a2c64a5ad8e6d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.2
|
Security for bisos.pypiserver 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.