Skip to content

Commit 58247df

Browse files
yoshi-automationtseaver
authored andcommitted
Blacken noxfile.py, setup.py (via synth). (googleapis#8124)
1 parent a7932de commit 58247df

File tree

3 files changed

+53
-56
lines changed

3 files changed

+53
-56
lines changed

iam/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
)

iam/setup.py

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,62 +19,61 @@
1919

2020
import setuptools
2121

22-
name = 'google-cloud-iam'
23-
description = 'IAM Service Account Credentials API client library'
24-
version = '0.1.0'
22+
name = "google-cloud-iam"
23+
description = "IAM Service Account Credentials API client library"
24+
version = "0.1.0"
2525
# Should be one of:
2626
# 'Development Status :: 3 - Alpha'
2727
# 'Development Status :: 4 - Beta'
2828
# 'Development Status :: 5 - Production/Stable'
29-
release_status = 'Development Status :: 3 - Alpha'
29+
release_status = "Development Status :: 3 - Alpha"
3030
dependencies = [
31-
'google-api-core[grpc] >= 1.6.0, < 2.0.0dev',
31+
"google-api-core[grpc] >= 1.6.0, < 2.0.0dev",
3232
'enum34; python_version < "3.4"',
3333
]
3434

3535
package_root = os.path.abspath(os.path.dirname(__file__))
3636

37-
readme_filename = os.path.join(package_root, 'README.rst')
38-
with io.open(readme_filename, encoding='utf-8') as readme_file:
37+
readme_filename = os.path.join(package_root, "README.rst")
38+
with io.open(readme_filename, encoding="utf-8") as readme_file:
3939
readme = readme_file.read()
4040

4141
packages = [
42-
package for package in setuptools.find_packages()
43-
if package.startswith('google')
42+
package for package in setuptools.find_packages() if package.startswith("google")
4443
]
4544

46-
namespaces = ['google']
47-
if 'google.cloud' in packages:
48-
namespaces.append('google.cloud')
45+
namespaces = ["google"]
46+
if "google.cloud" in packages:
47+
namespaces.append("google.cloud")
4948

5049
setuptools.setup(
5150
name=name,
5251
version=version,
5352
description=description,
5453
long_description=readme,
55-
author='Google LLC',
56-
author_email='googleapis-packages@google.com',
57-
license='Apache 2.0',
58-
url='https://github.com/GoogleCloudPlatform/google-cloud-python',
54+
author="Google LLC",
55+
author_email="googleapis-packages@google.com",
56+
license="Apache 2.0",
57+
url="https://github.com/GoogleCloudPlatform/google-cloud-python",
5958
classifiers=[
6059
release_status,
61-
'Intended Audience :: Developers',
62-
'License :: OSI Approved :: Apache Software License',
63-
'Programming Language :: Python',
64-
'Programming Language :: Python :: 2',
65-
'Programming Language :: Python :: 2.7',
66-
'Programming Language :: Python :: 3',
67-
'Programming Language :: Python :: 3.5',
68-
'Programming Language :: Python :: 3.6',
69-
'Programming Language :: Python :: 3.7',
70-
'Operating System :: OS Independent',
71-
'Topic :: Internet',
60+
"Intended Audience :: Developers",
61+
"License :: OSI Approved :: Apache Software License",
62+
"Programming Language :: Python",
63+
"Programming Language :: Python :: 2",
64+
"Programming Language :: Python :: 2.7",
65+
"Programming Language :: Python :: 3",
66+
"Programming Language :: Python :: 3.5",
67+
"Programming Language :: Python :: 3.6",
68+
"Programming Language :: Python :: 3.7",
69+
"Operating System :: OS Independent",
70+
"Topic :: Internet",
7271
],
73-
platforms='Posix; MacOS X; Windows',
72+
platforms="Posix; MacOS X; Windows",
7473
packages=packages,
7574
namespace_packages=namespaces,
7675
install_requires=dependencies,
77-
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
76+
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
7877
include_package_data=True,
7978
zip_safe=False,
8079
)

iam/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-21T12:21:22.773525Z",
2+
"updateTime": "2019-05-24T12:21:09.875964Z",
33
"sources": [
44
{
55
"generator": {
@@ -12,8 +12,8 @@
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160",
16-
"internalRef": "249058354"
15+
"sha": "0537189470f04f24836d6959821c24197a0ed120",
16+
"internalRef": "249742806"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)