Skip to content

Commit 0a9e82e

Browse files
authored
Merge pull request #54 from adafruit/pylint-update
Ran black, updated to pylint 2.x
2 parents 7fe022d + fb45955 commit 0a9e82e

File tree

7 files changed

+111
-95
lines changed

7 files changed

+111
-95
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
source actions-ci/install.sh
4141
- name: Pip install pylint, black, & Sphinx
4242
run: |
43-
pip install --force-reinstall pylint==1.9.2 black==19.10b0 Sphinx sphinx-rtd-theme
43+
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
4444
- name: Library version
4545
run: git describe --dirty --always --tags
4646
- name: PyLint

.pylintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ spelling-store-unknown-words=no
119119
[MISCELLANEOUS]
120120

121121
# List of note tags to take in consideration, separated by a comma.
122-
notes=FIXME,XXX,TODO
122+
# notes=FIXME,XXX,TODO
123+
notes=FIXME,XXX
123124

124125

125126
[TYPECHECK]

docs/conf.py

+64-46
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,48 @@
22

33
import os
44
import sys
5-
sys.path.insert(0, os.path.abspath('..'))
5+
6+
sys.path.insert(0, os.path.abspath(".."))
67

78
# -- General configuration ------------------------------------------------
89

910
# Add any Sphinx extension module names here, as strings. They can be
1011
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
1112
# ones.
1213
extensions = [
13-
'sphinx.ext.autodoc',
14-
'sphinx.ext.intersphinx',
15-
'sphinx.ext.viewcode',
14+
"sphinx.ext.autodoc",
15+
"sphinx.ext.intersphinx",
16+
"sphinx.ext.viewcode",
1617
]
1718

1819
autodoc_mock_imports = ["pulseio"]
1920

20-
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
21+
intersphinx_mapping = {
22+
"python": ("https://docs.python.org/3.4", None),
23+
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
24+
}
2125

2226
# Add any paths that contain templates here, relative to this directory.
23-
templates_path = ['_templates']
27+
templates_path = ["_templates"]
2428

25-
source_suffix = '.rst'
29+
source_suffix = ".rst"
2630

2731
# The master toctree document.
28-
master_doc = 'index'
32+
master_doc = "index"
2933

3034
# General information about the project.
31-
project = u'Adafruit CircuitPython SimpleIO Library'
32-
copyright = u'2017 Scott Shawcroft'
33-
author = u'Scott Shawcroft'
35+
project = u"Adafruit CircuitPython SimpleIO Library"
36+
copyright = u"2017 Scott Shawcroft"
37+
author = u"Scott Shawcroft"
3438

3539
# The version info for the project you're documenting, acts as replacement for
3640
# |version| and |release|, also used in various other places throughout the
3741
# built documents.
3842
#
3943
# The short X.Y version.
40-
version = u'1.0'
44+
version = u"1.0"
4145
# The full version, including alpha/beta/rc tags.
42-
release = u'1.0'
46+
release = u"1.0"
4347

4448
# The language for content autogenerated by Sphinx. Refer to documentation
4549
# for a list of supported languages.
@@ -51,7 +55,7 @@
5155
# List of patterns, relative to source directory, that match files and
5256
# directories to ignore when looking for source files.
5357
# This patterns also effect to html_static_path and html_extra_path
54-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
58+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
5559

5660
# The reST default role (used for this markup: `text`) to use for all
5761
# documents.
@@ -63,7 +67,7 @@
6367
add_function_parentheses = True
6468

6569
# The name of the Pygments (syntax highlighting) style to use.
66-
pygments_style = 'sphinx'
70+
pygments_style = "sphinx"
6771

6872
# If true, `todo` and `todoList` produce output, else they produce nothing.
6973
todo_include_todos = False
@@ -77,68 +81,76 @@
7781
# The theme to use for HTML and HTML Help pages. See the documentation for
7882
# a list of builtin themes.
7983
#
80-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
84+
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
8185

8286
if not on_rtd: # only import and set the theme if we're building docs locally
8387
try:
8488
import sphinx_rtd_theme
85-
html_theme = 'sphinx_rtd_theme'
86-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
89+
90+
html_theme = "sphinx_rtd_theme"
91+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
8792
except:
88-
html_theme = 'default'
89-
html_theme_path = ['.']
93+
html_theme = "default"
94+
html_theme_path = ["."]
9095
else:
91-
html_theme_path = ['.']
96+
html_theme_path = ["."]
9297

9398
# Add any paths that contain custom static files (such as style sheets) here,
9499
# relative to this directory. They are copied after the builtin static files,
95100
# so a file named "default.css" will overwrite the builtin "default.css".
96-
html_static_path = ['_static']
101+
html_static_path = ["_static"]
97102

98103
# The name of an image file (relative to this directory) to use as a favicon of
99104
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
100105
# pixels large.
101106
#
102-
html_favicon = '_static/favicon.ico'
107+
html_favicon = "_static/favicon.ico"
103108

104109
# Output file base name for HTML help builder.
105-
htmlhelp_basename = 'AdafruitSimpleIOLibrarydoc'
110+
htmlhelp_basename = "AdafruitSimpleIOLibrarydoc"
106111

107112
# -- Options for LaTeX output ---------------------------------------------
108113

109114
latex_elements = {
110-
# The paper size ('letterpaper' or 'a4paper').
111-
#
112-
# 'papersize': 'letterpaper',
113-
114-
# The font size ('10pt', '11pt' or '12pt').
115-
#
116-
# 'pointsize': '10pt',
117-
118-
# Additional stuff for the LaTeX preamble.
119-
#
120-
# 'preamble': '',
121-
122-
# Latex figure (float) alignment
123-
#
124-
# 'figure_align': 'htbp',
115+
# The paper size ('letterpaper' or 'a4paper').
116+
#
117+
# 'papersize': 'letterpaper',
118+
# The font size ('10pt', '11pt' or '12pt').
119+
#
120+
# 'pointsize': '10pt',
121+
# Additional stuff for the LaTeX preamble.
122+
#
123+
# 'preamble': '',
124+
# Latex figure (float) alignment
125+
#
126+
# 'figure_align': 'htbp',
125127
}
126128

127129
# Grouping the document tree into LaTeX files. List of tuples
128130
# (source start file, target name, title,
129131
# author, documentclass [howto, manual, or own class]).
130132
latex_documents = [
131-
(master_doc, 'AdafruitSimpleIOLibrary.tex', u'Adafruit SimpleIO Library Documentation',
132-
u'Scott Shawcroft', 'manual'),
133+
(
134+
master_doc,
135+
"AdafruitSimpleIOLibrary.tex",
136+
u"Adafruit SimpleIO Library Documentation",
137+
u"Scott Shawcroft",
138+
"manual",
139+
),
133140
]
134141

135142
# -- Options for manual page output ---------------------------------------
136143

137144
# One entry per manual page. List of tuples
138145
# (source start file, name, description, authors, manual section).
139146
man_pages = [
140-
(master_doc, 'adafruitSimpleIOlibrary', u'Adafruit SimpleIO Library Documentation',
141-
[author], 1)
147+
(
148+
master_doc,
149+
"adafruitSimpleIOlibrary",
150+
u"Adafruit SimpleIO Library Documentation",
151+
[author],
152+
1,
153+
)
142154
]
143155

144156
# -- Options for Texinfo output -------------------------------------------
@@ -147,7 +159,13 @@
147159
# (source start file, target name, title, author,
148160
# dir menu entry, description, category)
149161
texinfo_documents = [
150-
(master_doc, 'AdafruitSimpleIOLibrary', u'Adafruit SimpleIO Library Documentation',
151-
author, 'AdafruitSimpleIOLibrary', 'One line description of project.',
152-
'Miscellaneous'),
162+
(
163+
master_doc,
164+
"AdafruitSimpleIOLibrary",
165+
u"Adafruit SimpleIO Library Documentation",
166+
author,
167+
"AdafruitSimpleIOLibrary",
168+
"One line description of project.",
169+
"Miscellaneous",
170+
),
153171
]

examples/simpleio_map_range_simpletest.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
sensor_value = 150
1212

1313
# Map the sensor's range from 0<=sensor_value<=255 to 0<=sensor_value<=1023
14-
print('original sensor value: ', sensor_value)
14+
print("original sensor value: ", sensor_value)
1515
mapped_value = simpleio.map_range(sensor_value, 0, 255, 0, 1023)
16-
print('mapped sensor value: ', mapped_value)
16+
print("mapped sensor value: ", mapped_value)
1717
time.sleep(2)
1818

1919
# Map the new sensor value back to the old range
2020
sensor_value = simpleio.map_range(mapped_value, 0, 1023, 0, 255)
21-
print('original value returned: ', sensor_value)
21+
print("original value returned: ", sensor_value)
2222
time.sleep(2)

examples/simpleio_shift_in_out_demo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
# shifting 256 bits out of data pin
2323
latch.value = False
2424
data.direction = digitalio.Direction.OUTPUT
25-
print('shifting out...')
25+
print("shifting out...")
2626
simpleio.shift_out(data, clk, data_to_send, msb_first=False)
2727
latch.value = True
2828
time.sleep(3)
2929

3030
# shifting 256 bits into the data pin
3131
latch.value = False
3232
data.direction = digitalio.Direction.INPUT
33-
print('shifting in...')
33+
print("shifting in...")
3434
simpleio.shift_in(data, clk)
3535
time.sleep(3)

setup.py

+21-29
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,46 @@
77

88
# Always prefer setuptools over distutils
99
from setuptools import setup, find_packages
10+
1011
# To use a consistent encoding
1112
from codecs import open
1213
from os import path
1314

1415
here = path.abspath(path.dirname(__file__))
1516

1617
# Get the long description from the README file
17-
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
18+
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
1819
long_description = f.read()
1920

2021
setup(
21-
name='adafruit-circuitpython-simpleio',
22-
22+
name="adafruit-circuitpython-simpleio",
2323
use_scm_version=True,
24-
setup_requires=['setuptools_scm'],
25-
26-
description='CircuitPython helper library to simplify hardware interactions.',
24+
setup_requires=["setuptools_scm"],
25+
description="CircuitPython helper library to simplify hardware interactions.",
2726
long_description=long_description,
28-
long_description_content_type='text/x-rst',
29-
27+
long_description_content_type="text/x-rst",
3028
# The project's main homepage.
31-
url='https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO',
32-
29+
url="https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO",
3330
# Author details
34-
author='Adafruit Industries',
35-
author_email='[email protected]',
36-
37-
install_requires=['Adafruit-Blinka'],
38-
31+
author="Adafruit Industries",
32+
author_email="[email protected]",
33+
install_requires=["Adafruit-Blinka"],
3934
# Choose your license
40-
license='MIT',
41-
35+
license="MIT",
4236
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
4337
classifiers=[
44-
'Development Status :: 3 - Alpha',
45-
'Intended Audience :: Developers',
46-
'Topic :: Software Development :: Libraries',
47-
'Topic :: System :: Hardware',
48-
'License :: OSI Approved :: MIT License',
49-
'Programming Language :: Python :: 3',
50-
'Programming Language :: Python :: 3.4',
51-
'Programming Language :: Python :: 3.5',
38+
"Development Status :: 3 - Alpha",
39+
"Intended Audience :: Developers",
40+
"Topic :: Software Development :: Libraries",
41+
"Topic :: System :: Hardware",
42+
"License :: OSI Approved :: MIT License",
43+
"Programming Language :: Python :: 3",
44+
"Programming Language :: Python :: 3.4",
45+
"Programming Language :: Python :: 3.5",
5246
],
53-
5447
# What does your project relate to?
55-
keywords='adafruit simpleio servo map range bitwrite hardware micropython circuitpython',
56-
48+
keywords="adafruit simpleio servo map range bitwrite hardware micropython circuitpython",
5749
# You can just specify the packages manually here if your project is
5850
# simple. Or you can use find_packages().
59-
py_modules=['simpleio'],
51+
py_modules=["simpleio"],
6052
)

0 commit comments

Comments
 (0)