1
0
mirror of https://github.com/pypiserver/pypiserver synced 2025-02-16 23:09:34 +01:00

Merge branch 'master' into chore-adjust-contributors-entry-in-readme-rst

This commit is contained in:
Dmitrii Orlov 2022-02-21 09:21:01 +01:00 committed by GitHub
commit f2330fa95e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

@ -256,6 +256,7 @@ def handle_rpc():
def simpleindex():
links = sorted(config.backend.get_projects())
tmpl = """\
<!DOCTYPE html>
<html>
<head>
<title>Simple Index</title>
@ -299,6 +300,7 @@ def simple(project):
)
tmpl = """\
<!DOCTYPE html>
<html>
<head>
<title>Links for {{project}}</title>
@ -328,6 +330,7 @@ def list_packages():
)
tmpl = """\
<!DOCTYPE html>
<html>
<head>
<title>Index of packages</title>

@ -204,7 +204,7 @@ def write_file(fh: t.BinaryIO, destination: PathLike) -> None:
"""write a byte stream into a destination file. Writes are chunked to reduce
the memory footprint
"""
chunk_size = 2 ** 20 # 1 MB
chunk_size = 2**20 # 1 MB
offset = fh.tell()
try:
with open(destination, "wb") as dest:
@ -259,7 +259,7 @@ def digest_file(file_path: PathLike, hash_algo: str) -> str:
From http://stackoverflow.com/a/21565932/548792
"""
blocksize = 2 ** 16
blocksize = 2**16
digester = hashlib.new(hash_algo)
with open(file_path, "rb") as f:
for block in iter(lambda: f.read(blocksize), b""):

@ -57,7 +57,7 @@ def run_server(root, authed=False, other_cli=""):
f"run -vvv --overwrite -i 127.0.0.1 "
f"-p {port} {pswd_opts} {other_cli} {root}"
)
proc = Popen(cmd.split(), bufsize=2 ** 16)
proc = Popen(cmd.split(), bufsize=2**16)
srv = Srv(port, root)
try:
wait_until_ready(srv)