Skip to content

Commit 47be6dd

Browse files
author
Emmanuel Rondan
committed
running pre-commit on all the code
1 parent 5390b23 commit 47be6dd

File tree

10 files changed

+112
-103
lines changed

10 files changed

+112
-103
lines changed

docs/conf.py

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -9,87 +9,88 @@
99
# All configuration values have a default; values that are commented out
1010
# serve to show the default.
1111

12-
import sys, os
12+
import os
13+
import sys
1314

1415
# If extensions (or modules to document with autodoc) are in another directory,
1516
# add these directories to sys.path here. If the directory is relative to the
1617
# documentation root, use os.path.abspath to make it absolute, like shown here.
17-
sys.path.insert(0, os.path.abspath('..'))
18+
sys.path.insert(0, os.path.abspath(".."))
1819

1920
# -- General configuration -----------------------------------------------------
2021

2122
# If your documentation needs a minimal Sphinx version, state it here.
22-
#needs_sphinx = '1.0'
23+
# needs_sphinx = '1.0'
2324

2425
# Add any Sphinx extension module names here, as strings. They can be extensions
2526
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
2627
extensions = [
27-
'hoverxref.extension',
28-
'notfound.extension',
29-
'sphinx.ext.autodoc',
30-
'sphinx.ext.doctest',
31-
'sphinx.ext.intersphinx',
32-
'sphinx.ext.viewcode',
28+
"hoverxref.extension",
29+
"notfound.extension",
30+
"sphinx.ext.autodoc",
31+
"sphinx.ext.doctest",
32+
"sphinx.ext.intersphinx",
33+
"sphinx.ext.viewcode",
3334
]
3435

3536
# Add any paths that contain templates here, relative to this directory.
36-
templates_path = ['_templates']
37+
templates_path = ["_templates"]
3738

3839
# The suffix of source filenames.
39-
source_suffix = '.rst'
40+
source_suffix = ".rst"
4041

4142
# The encoding of source files.
42-
#source_encoding = 'utf-8-sig'
43+
# source_encoding = 'utf-8-sig'
4344

4445
# The master toctree document.
45-
master_doc = 'index'
46+
master_doc = "index"
4647

4748
# General information about the project.
48-
project = 'w3lib'
49-
copyright = '2014, w3lib developers'
49+
project = "w3lib"
50+
copyright = "2014, w3lib developers"
5051

5152
# The version info for the project you're documenting, acts as replacement for
5253
# |version| and |release|, also used in various other places throughout the
5354
# built documents.
5455
#
5556
# The full version, including alpha/beta/rc tags.
56-
release = '2.1.2'
57+
release = "2.1.2"
5758
# The short X.Y version.
58-
version = '.'.join(release.split('.')[:2])
59+
version = ".".join(release.split(".")[:2])
5960

6061
# The language for content autogenerated by Sphinx. Refer to documentation
6162
# for a list of supported languages.
62-
#language = None
63+
# language = None
6364

6465
# There are two options for replacing |today|: either, you set today to some
6566
# non-false value, then it is used:
66-
#today = ''
67+
# today = ''
6768
# Else, today_fmt is used as the format for a strftime call.
68-
#today_fmt = '%B %d, %Y'
69+
# today_fmt = '%B %d, %Y'
6970

7071
# List of patterns, relative to source directory, that match files and
7172
# directories to ignore when looking for source files.
72-
exclude_patterns = ['_build']
73+
exclude_patterns = ["_build"]
7374

7475
# The reST default role (used for this markup: `text`) to use for all documents.
75-
#default_role = None
76+
# default_role = None
7677

7778
# If true, '()' will be appended to :func: etc. cross-reference text.
78-
#add_function_parentheses = True
79+
# add_function_parentheses = True
7980

8081
# If true, the current module name will be prepended to all description
8182
# unit titles (such as .. function::).
82-
#add_module_names = True
83+
# add_module_names = True
8384

8485
# If true, sectionauthor and moduleauthor directives will be shown in the
8586
# output. They are ignored by default.
86-
#show_authors = False
87+
# show_authors = False
8788

8889
# The name of the Pygments (syntax highlighting) style to use.
89-
pygments_style = 'sphinx'
90+
pygments_style = "sphinx"
9091

9192
# A list of ignored prefixes for module index sorting.
92-
#modindex_common_prefix = []
93+
# modindex_common_prefix = []
9394

9495

9596
# -- Options for HTML output ---------------------------------------------------
@@ -101,26 +102,26 @@
101102
# Theme options are theme-specific and customize the look and feel of a theme
102103
# further. For a list of options available for each theme, see the
103104
# documentation.
104-
#html_theme_options = {}
105+
# html_theme_options = {}
105106

106107
# Add any paths that contain custom themes here, relative to this directory.
107-
#html_theme_path = []
108+
# html_theme_path = []
108109

109110
# The name for this set of Sphinx documents. If None, it defaults to
110111
# "<project> v<release> documentation".
111-
#html_title = None
112+
# html_title = None
112113

113114
# A shorter title for the navigation bar. Default is the same as html_title.
114-
#html_short_title = None
115+
# html_short_title = None
115116

116117
# The name of an image file (relative to this directory) to place at the top
117118
# of the sidebar.
118-
#html_logo = None
119+
# html_logo = None
119120

120121
# The name of an image file (within the static path) to use as favicon of the
121122
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
122123
# pixels large.
123-
#html_favicon = None
124+
# html_favicon = None
124125

125126
# Add any paths that contain custom static files (such as style sheets) here,
126127
# relative to this directory. They are copied after the builtin static files,
@@ -129,101 +130,95 @@
129130

130131
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
131132
# using the given strftime format.
132-
#html_last_updated_fmt = '%b %d, %Y'
133+
# html_last_updated_fmt = '%b %d, %Y'
133134

134135
# If true, SmartyPants will be used to convert quotes and dashes to
135136
# typographically correct entities.
136-
#html_use_smartypants = True
137+
# html_use_smartypants = True
137138

138139
# Custom sidebar templates, maps document names to template names.
139-
#html_sidebars = {}
140+
# html_sidebars = {}
140141

141142
# Additional templates that should be rendered to pages, maps page names to
142143
# template names.
143-
#html_additional_pages = {}
144+
# html_additional_pages = {}
144145

145146
# If false, no module index is generated.
146-
#html_domain_indices = True
147+
# html_domain_indices = True
147148

148149
# If false, no index is generated.
149-
#html_use_index = True
150+
# html_use_index = True
150151

151152
# If true, the index is split into individual pages for each letter.
152-
#html_split_index = False
153+
# html_split_index = False
153154

154155
# If true, links to the reST sources are added to the pages.
155-
#html_show_sourcelink = True
156+
# html_show_sourcelink = True
156157

157158
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
158-
#html_show_sphinx = True
159+
# html_show_sphinx = True
159160

160161
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
161-
#html_show_copyright = True
162+
# html_show_copyright = True
162163

163164
# If true, an OpenSearch description file will be output, and all pages will
164165
# contain a <link> tag referring to it. The value of this option must be the
165166
# base URL from which the finished HTML is served.
166-
#html_use_opensearch = ''
167+
# html_use_opensearch = ''
167168

168169
# This is the file name suffix for HTML files (e.g. ".xhtml").
169-
#html_file_suffix = None
170+
# html_file_suffix = None
170171

171172
# Output file base name for HTML help builder.
172-
htmlhelp_basename = 'w3libdoc'
173+
htmlhelp_basename = "w3libdoc"
173174

174175

175176
# -- Options for LaTeX output --------------------------------------------------
176177

177178
latex_elements = {
178-
# The paper size ('letterpaper' or 'a4paper').
179-
#'papersize': 'letterpaper',
180-
181-
# The font size ('10pt', '11pt' or '12pt').
182-
#'pointsize': '10pt',
183-
184-
# Additional stuff for the LaTeX preamble.
185-
#'preamble': '',
179+
# The paper size ('letterpaper' or 'a4paper').
180+
# 'papersize': 'letterpaper',
181+
# The font size ('10pt', '11pt' or '12pt').
182+
# 'pointsize': '10pt',
183+
# Additional stuff for the LaTeX preamble.
184+
# 'preamble': '',
186185
}
187186

188187
# Grouping the document tree into LaTeX files. List of tuples
189188
# (source start file, target name, title, author, documentclass [howto/manual]).
190189
latex_documents = [
191-
('index', 'w3lib.tex', 'w3lib Documentation',
192-
'w3lib developers', 'manual'),
190+
("index", "w3lib.tex", "w3lib Documentation", "w3lib developers", "manual"),
193191
]
194192

195193
# The name of an image file (relative to this directory) to place at the top of
196194
# the title page.
197-
#latex_logo = None
195+
# latex_logo = None
198196

199197
# For "manual" documents, if this is true, then toplevel headings are parts,
200198
# not chapters.
201-
#latex_use_parts = False
199+
# latex_use_parts = False
202200

203201
# If true, show page references after internal links.
204-
#latex_show_pagerefs = False
202+
# latex_show_pagerefs = False
205203

206204
# If true, show URL addresses after external links.
207-
#latex_show_urls = False
205+
# latex_show_urls = False
208206

209207
# Documents to append as an appendix to all manuals.
210-
#latex_appendices = []
208+
# latex_appendices = []
211209

212210
# If false, no module index is generated.
213-
#latex_domain_indices = True
211+
# latex_domain_indices = True
214212

215213

216214
# -- Options for manual page output --------------------------------------------
217215

218216
# One entry per manual page. List of tuples
219217
# (source start file, name, description, authors, manual section).
220-
man_pages = [
221-
('index', 'w3lib', 'w3lib Documentation',
222-
['w3lib developers'], 1)
223-
]
218+
man_pages = [("index", "w3lib", "w3lib Documentation", ["w3lib developers"], 1)]
224219

225220
# If true, show URL addresses after external links.
226-
#man_show_urls = False
221+
# man_show_urls = False
227222

228223

229224
# -- Options for Texinfo output ------------------------------------------------
@@ -232,27 +227,33 @@
232227
# (source start file, target name, title, author,
233228
# dir menu entry, description, category)
234229
texinfo_documents = [
235-
('index', 'w3lib', 'w3lib Documentation',
236-
'w3lib developers', 'w3lib', 'One line description of project.',
237-
'Miscellaneous'),
230+
(
231+
"index",
232+
"w3lib",
233+
"w3lib Documentation",
234+
"w3lib developers",
235+
"w3lib",
236+
"One line description of project.",
237+
"Miscellaneous",
238+
),
238239
]
239240

240241
# Documents to append as an appendix to all manuals.
241-
#texinfo_appendices = []
242+
# texinfo_appendices = []
242243

243244
# If false, no module index is generated.
244-
#texinfo_domain_indices = True
245+
# texinfo_domain_indices = True
245246

246247
# How to display URL addresses: 'footnote', 'no', or 'inline'.
247-
#texinfo_show_urls = 'footnote'
248+
# texinfo_show_urls = 'footnote'
248249

249250

250251
# Example configuration for intersphinx: refer to the Python standard library.
251252
intersphinx_mapping = {
252-
'pytest': ('https://docs.pytest.org/en/latest', None),
253-
'python': ('https://docs.python.org/3', None),
254-
'scrapy': ('https://scrapy.readthedocs.io/en/latest', None),
255-
'tox': ('https://tox.readthedocs.io/en/latest', None),
253+
"pytest": ("https://docs.pytest.org/en/latest", None),
254+
"python": ("https://docs.python.org/3", None),
255+
"scrapy": ("https://scrapy.readthedocs.io/en/latest", None),
256+
"tox": ("https://tox.readthedocs.io/en/latest", None),
256257
}
257258

258259

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from setuptools import setup, find_packages
2-
1+
from setuptools import find_packages, setup
32

43
setup(
54
name="w3lib",

tests/test_encoding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import codecs
22
import unittest
3-
from typing import Optional, Union, List, Any
3+
from typing import Any, List, Optional, Union
44

55
from w3lib.encoding import (
66
html_body_declared_encoding,
7-
http_content_type_encoding,
87
html_to_unicode,
8+
http_content_type_encoding,
99
read_bom,
1010
resolve_encoding,
1111
to_unicode,

tests/test_http.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import unittest
22
from collections import OrderedDict
3+
34
from w3lib.http import (
45
HeadersDictInput,
56
basic_auth_header,

0 commit comments

Comments
 (0)