From cdd7a5ec140d9e4f77fa7201d9d6dd289f82dabf Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 20 Jul 2023 16:57:44 -0400 Subject: [PATCH] feat: Introduce compatibility with native namespace packages (#385) * feat: Introduce compatibility with native namespace packages * mypy * formatting * exclude docs* --- google/__init__.py | 22 ---------------------- noxfile.py | 2 +- setup.py | 5 +++-- 3 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 google/__init__.py diff --git a/google/__init__.py b/google/__init__.py deleted file mode 100644 index 690df335..00000000 --- a/google/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2017 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) # type: ignore diff --git a/noxfile.py b/noxfile.py index ac6e9e79..23805d53 100644 --- a/noxfile.py +++ b/noxfile.py @@ -198,7 +198,7 @@ def mypy(session): "types-requests", "types-mock", ) - session.run("mypy", "google/", "tests/", "tests_async/") + session.run("mypy", "-p", "google", "-p", "tests", "-p", "tests_async") @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) diff --git a/setup.py b/setup.py index 9ce75eed..338a6d95 100644 --- a/setup.py +++ b/setup.py @@ -40,10 +40,11 @@ author='Google Cloud Platform', author_email='googleapis-publisher@google.com', long_description=README, - namespace_packages=['google'], scripts=[], url='https://github.com/googleapis/google-resumable-media-python', - packages=setuptools.find_packages(exclude=('tests*',)), + packages=setuptools.find_namespace_packages( + exclude=("tests*", "docs*") + ), license='Apache 2.0', platforms='Posix; MacOS X; Windows', include_package_data=True,