Skip to content

Commit 78dccd6

Browse files
committed
Document hashes for manually hosted package indexes
1 parent cee95c2 commit 78dccd6

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

‎source/guides/hosting-your-own-index.rst‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ directory with autoindex enabled. For an example using the built in Web server
5252
in `Twisted`_, you would simply run ``twistd -n web --path .`` and then
5353
instruct users to add the URL to their installer's configuration.
5454

55+
An automatically generated directory listing usually doesn't include artifact
56+
hashes. Without hashes in the repository links, tools may be unable to record
57+
them in lock files. To include a SHA-256 hash, generate an ``index.html`` file
58+
in each project directory and append the hash to each artifact URL as described
59+
by the :ref:`Simple Repository API <simple-repository-html-project-detail>`:
60+
61+
.. code-block:: html
62+
63+
<!DOCTYPE html>
64+
<html lang="en">
65+
<head><title>Links for foo</title></head>
66+
<body>
67+
<h1>Links for foo</h1>
68+
<a href="Foo-1.0.tar.gz#sha256=3571b...">Foo-1.0.tar.gz</a>
69+
</body>
70+
</html>
71+
72+
Replace ``3571b...`` with the full SHA-256 digest of the artifact. You can use
73+
:ref:`dumb-pypi` to generate a static repository with hashes and other Simple
74+
Repository API metadata from a directory of package artifacts.
5575

5676
Existing projects
5777
=================
@@ -105,11 +125,6 @@ Existing projects
105125
-
106126
- also mirroring; manual synchronisation
107127

108-
* - :ref:`dumb-pypi`
109-
-
110-
-
111-
- not a server, but a static file site generator
112-
113128
* - :ref:`httpserver`
114129
-
115130
-

0 commit comments

Comments
 (0)