Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions google/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@

"""Google namespace package."""

try:
import pkg_resources
import pkgutil

pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil

__path__ = pkgutil.extend_path(__path__, __name__) # type: ignore
__path__ = pkgutil.extend_path(__path__, __name__) # type: ignore
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
long_description=long_description,
url="https://github.com/googleapis/google-auth-library-python",
packages=find_packages(exclude=("tests*", "system_tests*")),
namespace_packages=("google",),
install_requires=DEPENDENCIES,
extras_require=extras,
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*",
Expand Down
30 changes: 30 additions & 0 deletions tests/test_packaging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2022 Google LLC
#
# 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.

import os
import subprocess
import sys


def test_namespace_package_compat(tmp_path):
"""
The ``google`` namespace package should not be masked
by the presence of ``google-auth``.
"""
google = tmp_path / 'google'
google.mkdir()
google.joinpath('othermod.py').write_text('')
env = dict(os.environ, PYTHONPATH=str(tmp_path))
cmd = [sys.executable, '-m', 'google.othermod']
subprocess.check_call(cmd, env=env)