Skip to content

Commit ff348f5

Browse files
committed
Format code with black
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 6a3c5b0 commit ff348f5

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

docs/source/conf.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
3030
extensions = [
31-
'sphinx.ext.intersphinx',
31+
"sphinx.ext.intersphinx",
3232
]
3333

3434
# This points to aboutcode.readthedocs.io
3535
# In case of "undefined label" ERRORS check docs on intersphinx to troubleshoot
3636
# Link was created at commit - https://github.com/nexB/aboutcode/commit/faea9fcf3248f8f198844fe34d43833224ac4a83
3737

3838
intersphinx_mapping = {
39-
'aboutcode': ('https://aboutcode.readthedocs.io/en/latest/', None),
40-
'scancode-workbench': ('https://scancode-workbench.readthedocs.io/en/develop/', None),
39+
"aboutcode": ("https://aboutcode.readthedocs.io/en/latest/", None),
40+
"scancode-workbench": ("https://scancode-workbench.readthedocs.io/en/develop/", None),
4141
}
4242

4343

@@ -62,7 +62,7 @@
6262
# so a file named "default.css" will overwrite the builtin "default.css".
6363
html_static_path = ["_static"]
6464

65-
master_doc = 'index'
65+
master_doc = "index"
6666

6767
html_context = {
6868
"display_github": True,
@@ -72,9 +72,7 @@
7272
"conf_py_path": "/docs/source/", # path in the checkout to the docs root
7373
}
7474

75-
html_css_files = [
76-
'_static/theme_overrides.css'
77-
]
75+
html_css_files = ["_static/theme_overrides.css"]
7876

7977

8078
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.

etc/scripts/fetch_thirdparty.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
is_flag=True,
111111
help="Use on disk cached PyPI indexes list of packages and versions and do not refetch if present.",
112112
)
113-
114113
@click.help_option("-h", "--help")
115114
def fetch_thirdparty(
116115
requirements_files,

etc/scripts/utils_thirdparty.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ def download_sdist(name, version, dest_dir=THIRDPARTY_DIR, repos=tuple()):
311311

312312
return fetched_sdist_filename
313313

314+
314315
################################################################################
315316
#
316317
# Core models
@@ -1064,16 +1065,16 @@ def get_sdist_name_ver_ext(filename):
10641065
if version.isalpha():
10651066
return False
10661067

1067-
# non-pep 440 version
1068+
# non-pep 440 version
10681069
if "-" in version:
10691070
return False
10701071

1071-
# single version
1072+
# single version
10721073
if version.isdigit() and len(version) == 1:
10731074
return False
10741075

1075-
# r1 version
1076-
if len(version) == 2 and version[0]=="r" and version[1].isdigit():
1076+
# r1 version
1077+
if len(version) == 2 and version[0] == "r" and version[1].isdigit():
10771078
return False
10781079

10791080
# dotless version (but calver is OK)
@@ -1588,6 +1589,7 @@ def tags(self):
15881589
)
15891590
)
15901591

1592+
15911593
################################################################################
15921594
#
15931595
# PyPI repo and link index for package wheels and sources
@@ -1629,7 +1631,9 @@ class PypiSimpleRepository:
16291631
use_cached_index = attr.ib(
16301632
type=bool,
16311633
default=False,
1632-
metadata=dict(help="If True, use any existing on-disk cached PyPI index files. Otherwise, fetch and cache."),
1634+
metadata=dict(
1635+
help="If True, use any existing on-disk cached PyPI index files. Otherwise, fetch and cache."
1636+
),
16331637
)
16341638

16351639
def _get_package_versions_map(self, name):
@@ -1724,7 +1728,9 @@ class LinksRepository:
17241728
use_cached_index = attr.ib(
17251729
type=bool,
17261730
default=False,
1727-
metadata=dict(help="If True, use any existing on-disk cached index files. Otherwise, fetch and cache."),
1731+
metadata=dict(
1732+
help="If True, use any existing on-disk cached index files. Otherwise, fetch and cache."
1733+
),
17281734
)
17291735

17301736
def __attrs_post_init__(self):
@@ -1790,6 +1796,7 @@ def from_url(cls, url=ABOUT_BASE_URL, _LINKS_REPO={}, use_cached_index=False):
17901796
_LINKS_REPO[url] = cls(url=url, use_cached_index=use_cached_index)
17911797
return _LINKS_REPO[url]
17921798

1799+
17931800
################################################################################
17941801
# Globals for remote repos to be lazily created and cached on first use for the
17951802
# life of the session together with some convenience functions.
@@ -1803,6 +1810,7 @@ def get_local_packages(directory=THIRDPARTY_DIR):
18031810
"""
18041811
return list(PypiPackage.packages_from_dir(directory=directory))
18051812

1813+
18061814
################################################################################
18071815
#
18081816
# Basic file and URL-based operations using a persistent file-based Cache
@@ -1953,6 +1961,7 @@ def fetch_and_save(
19531961
fo.write(content)
19541962
return content
19551963

1964+
19561965
################################################################################
19571966
#
19581967
# Functions to update or fetch ABOUT and license files
@@ -2051,7 +2060,9 @@ def get_other_dists(_package, _dist):
20512060
# if has key data we may look to improve later, but we can move on
20522061
if local_dist.has_key_metadata():
20532062
local_dist.save_about_and_notice_files(dest_dir=dest_dir)
2054-
local_dist.fetch_license_files(dest_dir=dest_dir, use_cached_index=use_cached_index)
2063+
local_dist.fetch_license_files(
2064+
dest_dir=dest_dir, use_cached_index=use_cached_index
2065+
)
20552066
continue
20562067

20572068
# lets try to fetch remotely
@@ -2089,7 +2100,9 @@ def get_other_dists(_package, _dist):
20892100
# if has key data we may look to improve later, but we can move on
20902101
if local_dist.has_key_metadata():
20912102
local_dist.save_about_and_notice_files(dest_dir=dest_dir)
2092-
local_dist.fetch_license_files(dest_dir=dest_dir, use_cached_index=use_cached_index)
2103+
local_dist.fetch_license_files(
2104+
dest_dir=dest_dir, use_cached_index=use_cached_index
2105+
)
20932106
continue
20942107

20952108
# try to get data from pkginfo (no license though)
@@ -2107,6 +2120,7 @@ def get_other_dists(_package, _dist):
21072120
lic_errs = "\n".join(lic_errs)
21082121
print(f"Failed to fetch some licenses:: {lic_errs}")
21092122

2123+
21102124
################################################################################
21112125
#
21122126
# Functions to build new Python wheels including native on multiple OSes
@@ -2210,6 +2224,7 @@ def download_wheels_with_pip(
22102224
downloaded = existing ^ set(os.listdir(dest_dir))
22112225
return sorted(downloaded), error
22122226

2227+
22132228
################################################################################
22142229
#
22152230
# Functions to check for problems

0 commit comments

Comments
 (0)