Skip to content

Commit 9ed965f

Browse files
committed
Apply black linter to src/sasctl code
1 parent 99294a8 commit 9ed965f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1749
-1666
lines changed

doc/conf.py

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
#
1515
import os
1616
import sys
17-
sys.path.insert(0, os.path.abspath('../src'))
17+
18+
sys.path.insert(0, os.path.abspath("../src"))
1819

1920

2021
# -- Project information -----------------------------------------------------
2122
import sasctl
2223

23-
project = 'sasctl'
24+
project = "sasctl"
2425
copyright = sasctl.__copyright__
2526
author = sasctl.__author__
2627

@@ -40,38 +41,39 @@
4041
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4142
# ones.
4243
extensions = [
43-
'sphinx.ext.autodoc',
44-
'sphinx.ext.autosummary',
45-
'sphinx.ext.viewcode',
46-
'sphinx.ext.napoleon',
47-
'sphinx.ext.intersphinx',
48-
'sphinx.ext.todo'
44+
"sphinx.ext.autodoc",
45+
"sphinx.ext.autosummary",
46+
"sphinx.ext.viewcode",
47+
"sphinx.ext.napoleon",
48+
"sphinx.ext.intersphinx",
49+
"sphinx.ext.todo",
4950
]
5051

51-
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
52-
'swat': ('https://sassoftware.github.io/python-swat/', None),
53-
'pytest': ('https://docs.pytest.org/en/latest/', None),
54-
'betamax': ('https://betamax.readthedocs.io/en/latest/', None),
55-
'requests': (
56-
'https://2.python-requests.org/en/master/', None),
57-
'tox': ('https://tox.readthedocs.io/en/latest/', None),
58-
'flake8': ('http://flake8.pycqa.org/en/latest/', None)}
52+
intersphinx_mapping = {
53+
"python": ("https://docs.python.org/3", None),
54+
"swat": ("https://sassoftware.github.io/python-swat/", None),
55+
"pytest": ("https://docs.pytest.org/en/latest/", None),
56+
"betamax": ("https://betamax.readthedocs.io/en/latest/", None),
57+
"requests": ("https://2.python-requests.org/en/master/", None),
58+
"tox": ("https://tox.readthedocs.io/en/latest/", None),
59+
"flake8": ("http://flake8.pycqa.org/en/latest/", None),
60+
}
5961

6062
todo_include_todos = True
6163

6264
todo_emit_warnings = True
6365

6466
# Add any paths that contain templates here, relative to this directory.
65-
templates_path = ['_templates']
67+
templates_path = ["_templates"]
6668

6769
# The suffix(es) of source filenames.
6870
# You can specify multiple suffix as a list of string:
6971
#
7072
# source_suffix = ['.rst', '.md']
71-
source_suffix = '.rst'
73+
source_suffix = ".rst"
7274

7375
# The master toctree document.
74-
master_doc = 'index'
76+
master_doc = "index"
7577

7678
# The language for content autogenerated by Sphinx. Refer to documentation
7779
# for a list of supported languages.
@@ -83,33 +85,33 @@
8385
# List of patterns, relative to source directory, that match files and
8486
# directories to ignore when looking for source files.
8587
# This pattern also affects html_static_path and html_extra_path .
86-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
88+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
8789

8890
# The name of the Pygments (syntax highlighting) style to use.
89-
pygments_style = 'sphinx'
91+
pygments_style = "sphinx"
9092

9193

9294
# -- Options for HTML output -------------------------------------------------
9395

9496
# The theme to use for HTML and HTML Help pages. See the documentation for
9597
# a list of builtin themes.
9698
#
97-
html_theme = 'alabaster'
99+
html_theme = "alabaster"
98100
# html_theme = 'sphinx_rtd_theme'
99101

100102
# Theme options are theme-specific and customize the look and feel of a theme
101103
# further. For a list of options available for each theme, see the
102104
# documentation.
103105
#
104106
html_theme_options = {
105-
'description': 'Python package and CLI for user-friendly integration with SAS Viya',
106-
'fixed_sidebar': True
107+
"description": "Python package and CLI for user-friendly integration with SAS Viya",
108+
"fixed_sidebar": True,
107109
}
108110

109111
# Add any paths that contain custom static files (such as style sheets) here,
110112
# relative to this directory. They are copied after the builtin static files,
111113
# so a file named "default.css" will overwrite the builtin "default.css".
112-
html_static_path = ['_static']
114+
html_static_path = ["_static"]
113115

114116
# Custom sidebar templates, must be a dictionary that maps document names
115117
# to template names.
@@ -120,19 +122,13 @@
120122
# 'searchbox.html']``.
121123
#
122124
# html_sidebars = {}
123-
html_sidebars = {
124-
'**': [
125-
'about.html',
126-
'searchbox.html',
127-
'navigation.html'
128-
]
129-
}
125+
html_sidebars = {"**": ["about.html", "searchbox.html", "navigation.html"]}
130126

131127

132128
# -- Options for HTMLHelp output ---------------------------------------------
133129

134130
# Output file base name for HTML help builder.
135-
htmlhelp_basename = 'sasctldoc'
131+
htmlhelp_basename = "sasctldoc"
136132

137133

138134
# -- Options for LaTeX output ------------------------------------------------
@@ -141,15 +137,12 @@
141137
# The paper size ('letterpaper' or 'a4paper').
142138
#
143139
# 'papersize': 'letterpaper',
144-
145140
# The font size ('10pt', '11pt' or '12pt').
146141
#
147142
# 'pointsize': '10pt',
148-
149143
# Additional stuff for the LaTeX preamble.
150144
#
151145
# 'preamble': '',
152-
153146
# Latex figure (float) alignment
154147
#
155148
# 'figure_align': 'htbp',
@@ -159,19 +152,15 @@
159152
# (source start file, target name, title,
160153
# author, documentclass [howto, manual, or own class]).
161154
latex_documents = [
162-
(master_doc, 'sasctl.tex', 'sasctl Documentation',
163-
'SAS', 'manual'),
155+
(master_doc, "sasctl.tex", "sasctl Documentation", "SAS", "manual"),
164156
]
165157

166158

167159
# -- Options for manual page output ------------------------------------------
168160

169161
# One entry per manual page. List of tuples
170162
# (source start file, name, description, authors, manual section).
171-
man_pages = [
172-
(master_doc, 'sasctl', 'sasctl Documentation',
173-
[author], 1)
174-
]
163+
man_pages = [(master_doc, "sasctl", "sasctl Documentation", [author], 1)]
175164

176165

177166
# -- Options for Texinfo output ----------------------------------------------
@@ -180,10 +169,16 @@
180169
# (source start file, target name, title, author,
181170
# dir menu entry, description, category)
182171
texinfo_documents = [
183-
(master_doc, 'sasctl', 'sasctl Documentation',
184-
author, 'sasctl', 'One line description of project.',
185-
'Miscellaneous'),
172+
(
173+
master_doc,
174+
"sasctl",
175+
"sasctl Documentation",
176+
author,
177+
"sasctl",
178+
"One line description of project.",
179+
"Miscellaneous",
180+
),
186181
]
187182

188183

189-
# -- Extension configuration -------------------------------------------------
184+
# -- Extension configuration -------------------------------------------------

setup.py

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,67 +11,65 @@
1111

1212

1313
def read_dunder(name):
14-
with open(os.path.join('src', 'sasctl', '__init__.py')) as f:
14+
with open(os.path.join("src", "sasctl", "__init__.py")) as f:
1515
for line in f.readlines():
1616
match = re.search(r'(?<=^__{}__ = [\'"]).*\b'.format(name), line)
1717
if match:
1818
return match.group(0)
19-
raise RuntimeError('Unable to find __%s__ in __init__.py' % name)
19+
raise RuntimeError("Unable to find __%s__ in __init__.py" % name)
2020

2121

2222
def get_file(filename):
23-
with open(filename, 'r') as f:
23+
with open(filename, "r") as f:
2424
return f.read()
2525

2626

2727
setup(
28-
name='sasctl',
29-
description='SAS Viya Python Client',
30-
long_description=get_file('README.md'),
31-
long_description_content_type='text/markdown',
32-
version=read_dunder('version'),
33-
author=read_dunder('author'),
34-
license='Apache v2.0',
35-
url='https://github.com/sassoftware/python-sasctl/',
28+
name="sasctl",
29+
description="SAS Viya Python Client",
30+
long_description=get_file("README.md"),
31+
long_description_content_type="text/markdown",
32+
version=read_dunder("version"),
33+
author=read_dunder("author"),
34+
license="Apache v2.0",
35+
url="https://github.com/sassoftware/python-sasctl/",
3636
project_urls={
37-
'Bug Tracker': 'https://github.com/sassoftware/python-sasctl/issues',
38-
'Documentation': 'https://sassoftware.github.io/python-sasctl/',
39-
'Source Code': 'https://github.com/sassoftware/python-sasctl'
37+
"Bug Tracker": "https://github.com/sassoftware/python-sasctl/issues",
38+
"Documentation": "https://sassoftware.github.io/python-sasctl/",
39+
"Source Code": "https://github.com/sassoftware/python-sasctl",
4040
},
4141
include_package_data=True,
4242
packages=find_packages(where="src"),
4343
package_dir={"": "src"},
44-
python_requires='>=3.5',
45-
install_requires=[
46-
'pandas',
47-
'scikit-learn',
48-
'requests',
49-
'pyyaml',
50-
'packaging'
51-
],
44+
python_requires=">=3.5",
45+
install_requires=["pandas", "scikit-learn", "requests", "pyyaml", "packaging"],
5246
extras_require={
53-
'swat': ['swat'],
54-
'kerberos': ['kerberos ; platform_system != "Windows"',
55-
'winkerberos ; platform_system == "Windows"'],
56-
'all': ['swat',
57-
'kerberos ; platform_system != "Windows"',
58-
'winkerberos ; platform_system == "Windows"'],
47+
"swat": ["swat"],
48+
"kerberos": [
49+
'kerberos ; platform_system != "Windows"',
50+
'winkerberos ; platform_system == "Windows"',
51+
],
52+
"all": [
53+
"swat",
54+
'kerberos ; platform_system != "Windows"',
55+
'winkerberos ; platform_system == "Windows"',
56+
],
5957
},
60-
entry_points={'console_scripts': ['sasctl = sasctl.utils.cli:main']},
58+
entry_points={"console_scripts": ["sasctl = sasctl.utils.cli:main"]},
6159
classifiers=[
62-
'Development Status :: 5 - Production/Stable',
63-
'License :: OSI Approved :: Apache Software License',
64-
'Environment :: Console',
65-
'Intended Audience :: Science/Research',
66-
'Intended Audience :: Developers',
67-
'Programming Language :: Python',
68-
'Programming Language :: Python :: 3',
69-
'Programming Language :: Python :: 3.5',
70-
'Programming Language :: Python :: 3.6',
71-
'Programming Language :: Python :: 3.7',
72-
'Programming Language :: Python :: 3.8',
73-
'Topic :: Software Development',
74-
'Topic :: Scientific/Engineering',
75-
'Operating System :: OS Independent'
76-
]
60+
"Development Status :: 5 - Production/Stable",
61+
"License :: OSI Approved :: Apache Software License",
62+
"Environment :: Console",
63+
"Intended Audience :: Science/Research",
64+
"Intended Audience :: Developers",
65+
"Programming Language :: Python",
66+
"Programming Language :: Python :: 3",
67+
"Programming Language :: Python :: 3.5",
68+
"Programming Language :: Python :: 3.6",
69+
"Programming Language :: Python :: 3.7",
70+
"Programming Language :: Python :: 3.8",
71+
"Topic :: Software Development",
72+
"Topic :: Scientific/Engineering",
73+
"Operating System :: OS Independent",
74+
],
7775
)

src/sasctl/__init__.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
55
# SPDX-License-Identifier: Apache-2.0
66

7-
__version__ = '1.6.4'
8-
__author__ = 'SAS'
9-
__credits__ = ['Yi Jian Ching', 'Lucas De Paula', 'James Kochuba', 'Peter Tobac',
10-
'Chris Toth', 'Jon Walker', 'Scott Lindauer']
11-
__license__ = 'Apache 2.0'
12-
__copyright__ = 'Copyright © 2019, SAS Institute Inc., ' \
13-
'Cary, NC, USA. All Rights Reserved.'
7+
__version__ = "1.6.4"
8+
__author__ = "SAS"
9+
__credits__ = [
10+
"Yi Jian Ching",
11+
"Lucas De Paula",
12+
"James Kochuba",
13+
"Peter Tobac",
14+
"Chris Toth",
15+
"Jon Walker",
16+
"Scott Lindauer",
17+
]
18+
__license__ = "Apache 2.0"
19+
__copyright__ = (
20+
"Copyright © 2019, SAS Institute Inc., " "Cary, NC, USA. All Rights Reserved."
21+
)
1422

1523
import logging
1624
import warnings
@@ -34,7 +42,7 @@
3442
)
3543

3644
# Ensure deprecation warnings are shown to users.
37-
warnings.filterwarnings('always', category=DeprecationWarning, module=r'^sasctl\.')
45+
warnings.filterwarnings("always", category=DeprecationWarning, module=r"^sasctl\.")
3846

3947

4048
# Prevent package from emitting log records unless consuming

src/sasctl/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
55
# SPDX-License-Identifier: Apache-2.0
66

7-
if __name__ == '__main__':
7+
if __name__ == "__main__":
88
from sasctl.utils.cli import main
99

1010
main()
11-

0 commit comments

Comments
 (0)