Skip to content

Commit dbae3cb

Browse files
yoshi-automationtseaver
authored andcommitted
Blacken noxfile.py, setup.py (via synth). (#8131)
1 parent 31b5c2d commit dbae3cb

3 files changed

Lines changed: 56 additions & 59 deletions

File tree

noxfile.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323

2424
LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core"))
2525

26+
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
27+
28+
if os.path.exists("samples"):
29+
BLACK_PATHS.append("samples")
30+
31+
2632
@nox.session(python="3.7")
2733
def lint(session):
2834
"""Run linters.
@@ -31,13 +37,7 @@ def lint(session):
3137
serious code quality issues.
3238
"""
3339
session.install("flake8", "black", *LOCAL_DEPS)
34-
session.run(
35-
"black",
36-
"--check",
37-
"google",
38-
"tests",
39-
"docs",
40-
)
40+
session.run("black", "--check", *BLACK_PATHS)
4141
session.run("flake8", "google", "tests")
4242

4343

@@ -52,12 +52,7 @@ def blacken(session):
5252
check the state of the `gcp_ubuntu_config` we use for that Kokoro run.
5353
"""
5454
session.install("black")
55-
session.run(
56-
"black",
57-
"google",
58-
"tests",
59-
"docs",
60-
)
55+
session.run("black", *BLACK_PATHS)
6156

6257

6358
@nox.session(python="3.7")
@@ -140,21 +135,24 @@ def cover(session):
140135

141136
session.run("coverage", "erase")
142137

138+
143139
@nox.session(python="3.7")
144140
def docs(session):
145141
"""Build the docs for this library."""
146142

147-
session.install('-e', '.')
148-
session.install('sphinx', 'alabaster', 'recommonmark')
143+
session.install("-e", ".")
144+
session.install("sphinx", "alabaster", "recommonmark")
149145

150-
shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
146+
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
151147
session.run(
152-
'sphinx-build',
153-
'-W', # warnings as errors
154-
'-T', # show full traceback on exception
155-
'-N', # no colors
156-
'-b', 'html',
157-
'-d', os.path.join('docs', '_build', 'doctrees', ''),
158-
os.path.join('docs', ''),
159-
os.path.join('docs', '_build', 'html', ''),
148+
"sphinx-build",
149+
"-W", # warnings as errors
150+
"-T", # show full traceback on exception
151+
"-N", # no colors
152+
"-b",
153+
"html",
154+
"-d",
155+
os.path.join("docs", "_build", "doctrees", ""),
156+
os.path.join("docs", ""),
157+
os.path.join("docs", "_build", "html", ""),
160158
)

setup.py

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,72 +20,71 @@
2020

2121
# Package metadata.
2222

23-
name = 'google-cloud-spanner'
24-
description = 'Cloud Spanner API client library'
25-
version = '1.9.0'
23+
name = "google-cloud-spanner"
24+
description = "Cloud Spanner API client library"
25+
version = "1.9.0"
2626
# Should be one of:
2727
# 'Development Status :: 3 - Alpha'
2828
# 'Development Status :: 4 - Beta'
2929
# 'Development Status :: 5 - Production/Stable'
30-
release_status = 'Development Status :: 5 - Production/Stable'
30+
release_status = "Development Status :: 5 - Production/Stable"
3131
dependencies = [
32-
'google-api-core[grpc, grpcgcp] >= 1.4.1, < 2.0.0dev',
32+
"google-api-core[grpc, grpcgcp] >= 1.4.1, < 2.0.0dev",
3333
"google-cloud-core >= 1.0.0, < 2.0dev",
34-
'grpc-google-iam-v1 >= 0.11.4, < 0.12dev',
34+
"grpc-google-iam-v1 >= 0.11.4, < 0.12dev",
3535
]
36-
extras = {
37-
}
36+
extras = {}
3837

3938

4039
# Setup boilerplate below this line.
4140

4241
package_root = os.path.abspath(os.path.dirname(__file__))
4342

44-
readme_filename = os.path.join(package_root, 'README.rst')
45-
with io.open(readme_filename, encoding='utf-8') as readme_file:
43+
readme_filename = os.path.join(package_root, "README.rst")
44+
with io.open(readme_filename, encoding="utf-8") as readme_file:
4645
readme = readme_file.read()
4746

4847
# Only include packages under the 'google' namespace. Do not include tests,
4948
# benchmarks, etc.
5049
packages = [
51-
package for package in setuptools.find_packages()
52-
if package.startswith('google')]
50+
package for package in setuptools.find_packages() if package.startswith("google")
51+
]
5352

5453
# Determine which namespaces are needed.
55-
namespaces = ['google']
56-
if 'google.cloud' in packages:
57-
namespaces.append('google.cloud')
54+
namespaces = ["google"]
55+
if "google.cloud" in packages:
56+
namespaces.append("google.cloud")
5857

5958

6059
setuptools.setup(
6160
name=name,
6261
version=version,
6362
description=description,
6463
long_description=readme,
65-
author='Google LLC',
66-
author_email='googleapis-packages@google.com',
67-
license='Apache 2.0',
68-
url='https://github.com/GoogleCloudPlatform/google-cloud-python',
64+
author="Google LLC",
65+
author_email="googleapis-packages@google.com",
66+
license="Apache 2.0",
67+
url="https://github.com/GoogleCloudPlatform/google-cloud-python",
6968
classifiers=[
7069
release_status,
71-
'Intended Audience :: Developers',
72-
'License :: OSI Approved :: Apache Software License',
73-
'Programming Language :: Python',
74-
'Programming Language :: Python :: 2',
75-
'Programming Language :: Python :: 2.7',
76-
'Programming Language :: Python :: 3',
77-
'Programming Language :: Python :: 3.5',
78-
'Programming Language :: Python :: 3.6',
79-
'Programming Language :: Python :: 3.7',
80-
'Operating System :: OS Independent',
81-
'Topic :: Internet',
70+
"Intended Audience :: Developers",
71+
"License :: OSI Approved :: Apache Software License",
72+
"Programming Language :: Python",
73+
"Programming Language :: Python :: 2",
74+
"Programming Language :: Python :: 2.7",
75+
"Programming Language :: Python :: 3",
76+
"Programming Language :: Python :: 3.5",
77+
"Programming Language :: Python :: 3.6",
78+
"Programming Language :: Python :: 3.7",
79+
"Operating System :: OS Independent",
80+
"Topic :: Internet",
8281
],
83-
platforms='Posix; MacOS X; Windows',
82+
platforms="Posix; MacOS X; Windows",
8483
packages=packages,
8584
namespace_packages=namespaces,
8685
install_requires=dependencies,
8786
extras_require=extras,
88-
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
87+
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
8988
include_package_data=True,
9089
zip_safe=False,
9190
)

synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"updateTime": "2019-05-22T20:28:23.271192Z",
2+
"updateTime": "2019-05-24T12:29:24.291949Z",
33
"sources": [
44
{
55
"generator": {
@@ -12,8 +12,8 @@
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "9fd48dcb59a5fba8464e6dbe6f4c6ca90c7efbaf",
16-
"internalRef": "249470705"
15+
"sha": "0537189470f04f24836d6959821c24197a0ed120",
16+
"internalRef": "249742806"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)