diff --git a/.flake8 b/.flake8
index 0d0a51ef6..52b065f41 100644
--- a/.flake8
+++ b/.flake8
@@ -6,7 +6,7 @@ max_line_length = 88
# E722 is a duplicate of B001.
# P207 is a duplicate of B003.
# W503 is against PEP8
-ignore = E203, E704, E722, P207, W503
+ignore = E203, E501, E704, E722, P207, W503
max-complexity = 20
exclude =
build,
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index f1ac2337a..129bed578 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -10,13 +10,13 @@ repos:
exclude: ^docs/conf.py$
- repo: https://github.com/psf/black
- rev: 24.1.1
+ rev: 24.2.0
hooks:
- id: black
args: [--target-version, py38, --preview]
- repo: https://github.com/asottile/pyupgrade
- rev: v3.15.0
+ rev: v3.15.1
hooks:
- id: pyupgrade
args: [--py310-plus]
diff --git a/docs/conf.py b/docs/conf.py
index 17998752b..541006d0e 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -214,13 +214,15 @@ class DocStub:
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
-latex_documents = [(
- "index",
- doc_module.__name__ + ".tex",
- doc_module.__name__ + " Documentation",
- "PyPA",
- "manual",
-)]
+latex_documents = [
+ (
+ "index",
+ doc_module.__name__ + ".tex",
+ doc_module.__name__ + " Documentation",
+ "PyPA",
+ "manual",
+ )
+]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
@@ -260,15 +262,17 @@ class DocStub:
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
-texinfo_documents = [(
- "index",
- doc_module.__name__,
- doc_module.__name__ + " Documentation",
- "",
- doc_module.__name__,
- doc_module.__name__ + " Documentation",
- "Miscellaneous",
-)]
+texinfo_documents = [
+ (
+ "index",
+ doc_module.__name__,
+ doc_module.__name__ + " Documentation",
+ "",
+ doc_module.__name__,
+ doc_module.__name__ + " Documentation",
+ "Miscellaneous",
+ )
+]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
diff --git a/src/bandersnatch/mirror.py b/src/bandersnatch/mirror.py
index 85776f3d6..d4eb83bf1 100644
--- a/src/bandersnatch/mirror.py
+++ b/src/bandersnatch/mirror.py
@@ -493,10 +493,12 @@ def _bootstrap(self, flock_timeout: float = 1.0) -> None:
]
if self.json_save:
logger.debug("Adding json directories to bootstrap")
- paths.extend([
- self.storage_backend.PATH_BACKEND("web/json"),
- self.storage_backend.PATH_BACKEND("web/pypi"),
- ])
+ paths.extend(
+ [
+ self.storage_backend.PATH_BACKEND("web/json"),
+ self.storage_backend.PATH_BACKEND("web/pypi"),
+ ]
+ )
for path in paths:
path = self.homedir / path
if not path.exists():
diff --git a/src/bandersnatch/simple.py b/src/bandersnatch/simple.py
index bdfd483e3..c657eedfb 100644
--- a/src/bandersnatch/simple.py
+++ b/src/bandersnatch/simple.py
@@ -115,9 +115,13 @@ def find_packages_in_dir(self, simple_dir: Path) -> list[str]:
"""Given a directory that contains simple packages indexes, return
a sorted list of normalized package names. This presumes every
directory within is a simple package index directory."""
- return sorted({
- str(x.name) for x in self.storage_backend.scandir(simple_dir) if x.is_dir()
- })
+ return sorted(
+ {
+ str(x.name)
+ for x in self.storage_backend.scandir(simple_dir)
+ if x.is_dir()
+ }
+ )
def gen_html_file_tags(self, release: dict) -> str:
file_tags = ""
@@ -183,16 +187,18 @@ def generate_html_simple_page(self, package: Package) -> str:
digest_name = self.digest_name
- simple_page_content += "\n".join([
- ' {}
'.format(
- self._file_url_to_local_url(r["url"]),
- digest_name,
- r["digests"][digest_name],
- self.gen_html_file_tags(r),
- r["filename"],
- )
- for r in release_files
- ])
+ simple_page_content += "\n".join(
+ [
+ ' {}
'.format(
+ self._file_url_to_local_url(r["url"]),
+ digest_name,
+ r["digests"][digest_name],
+ self.gen_html_file_tags(r),
+ r["filename"],
+ )
+ for r in release_files
+ ]
+ )
simple_page_content += (
f"\n