diff --git a/google/__init__.py b/google/__init__.py index 12d7fc298542..b2b833373882 100644 --- a/google/__init__.py +++ b/google/__init__.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Base ``google`` namespace package.""" - try: import pkg_resources pkg_resources.declare_namespace(__name__) diff --git a/google/cloud/__init__.py b/google/cloud/__init__.py index dd95f5786ec0..8ac7b74af136 100644 --- a/google/cloud/__init__.py +++ b/google/cloud/__init__.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Google Cloud API access in idiomatic Python.""" - try: import pkg_resources pkg_resources.declare_namespace(__name__) diff --git a/scripts/run_pylint.py b/scripts/run_pylint.py index 844b9a89476e..7dbe24bf2dbe 100644 --- a/scripts/run_pylint.py +++ b/scripts/run_pylint.py @@ -33,10 +33,13 @@ IGNORED_DIRECTORIES = [ os.path.join('google', 'cloud', 'bigtable', '_generated'), os.path.join('google', 'cloud', 'datastore', '_generated'), - 'scripts/verify_included_modules.py', ] IGNORED_FILES = [ os.path.join('docs', 'conf.py'), +] +IGNORED_POSTFIXES = [ + os.path.join('google', '__init__.py'), + os.path.join('google', 'cloud', '__init__.py'), 'setup.py', ] SCRIPTS_DIR = os.path.abspath(os.path.dirname(__file__)) @@ -113,6 +116,9 @@ def make_test_rc(base_rc_filename, additions_dict, def valid_filename(filename): """Checks if a file is a Python file and is not ignored.""" + for postfix in IGNORED_POSTFIXES: + if filename.endswith(postfix): + return False for directory in IGNORED_DIRECTORIES: if filename.startswith(directory): return False diff --git a/scripts/verify_included_modules.py b/scripts/verify_included_modules.py index 644ed83a06a6..0f16e47265c2 100644 --- a/scripts/verify_included_modules.py +++ b/scripts/verify_included_modules.py @@ -57,6 +57,9 @@ 'google.cloud.vision.__init__', 'google.cloud.vision.fixtures', ]) +PACKAGES = ( + '', +) class SphinxApp(object): @@ -120,8 +123,8 @@ def get_public_modules(path, base_package=None): return result -def main(build_root='_build'): - """Main script to verify modules included. +def verify_modules(build_root='_build'): + """Verify modules included. :type build_root: str :param build_root: The root of the directory where docs are built into. @@ -134,10 +137,12 @@ def main(build_root='_build'): object_inventory_relpath) sphinx_mods = set(inventory['py:module'].keys()) - library_dir = os.path.join(BASE_DIR, 'google', 'cloud') - public_mods = get_public_modules(library_dir, - base_package='google.cloud') - public_mods = set(public_mods) + public_mods = set() + for package in PACKAGES: + library_dir = os.path.join(BASE_DIR, package, 'google', 'cloud') + package_mods = get_public_modules(library_dir, + base_package='google.cloud') + public_mods.update(package_mods) if not sphinx_mods <= public_mods: unexpected_mods = sphinx_mods - public_mods @@ -172,7 +177,12 @@ def get_parser(): return parser -if __name__ == '__main__': +def main(): + """Main script to verify modules included.""" parser = get_parser() args = parser.parse_args() - main(build_root=args.build_root) + verify_modules(build_root=args.build_root) + + +if __name__ == '__main__': + main()