From 1792f14755ab571bc5cfd7c182b54ccf65cef8b8 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 17 Jul 2023 17:23:41 +0000 Subject: [PATCH 1/4] feat: Introduce compatibility with native namespace packages --- google/__init__.py | 22 ---------------------- setup.py | 5 +++-- 2 files changed, 3 insertions(+), 24 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/setup.py b/setup.py index 9ce75eed..ecd50b43 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*") + ), license='Apache 2.0', platforms='Posix; MacOS X; Windows', include_package_data=True, From 492adda901b3e48b5425db6cb8e5c4097b58c340 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 17 Jul 2023 18:52:22 +0000 Subject: [PATCH 2/4] mypy --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index ac6e9e79..af00928c 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) From 97aa5a6663d4cfc86eb33d3f30d04dfa626637d5 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 17 Jul 2023 19:01:21 +0000 Subject: [PATCH 3/4] formatting --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index af00928c..23805d53 100644 --- a/noxfile.py +++ b/noxfile.py @@ -198,7 +198,7 @@ def mypy(session): "types-requests", "types-mock", ) - session.run("mypy", "-p", "google/", "-p", "tests/", "-p", "tests_async/") + session.run("mypy", "-p", "google", "-p", "tests", "-p", "tests_async") @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) From c5c70a8619879685eb202cea5e60596836db4f17 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 17 Jul 2023 21:11:44 -0400 Subject: [PATCH 4/4] exclude docs* --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ecd50b43..338a6d95 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ scripts=[], url='https://github.com/googleapis/google-resumable-media-python', packages=setuptools.find_namespace_packages( - exclude=("tests*") + exclude=("tests*", "docs*") ), license='Apache 2.0', platforms='Posix; MacOS X; Windows',