Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a system test to ensure the "google" namespace isn't clobbered #1179

Open
andrewsg opened this issue Nov 8, 2023 · 1 comment
Open
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. type: cleanup An internal cleanup or hygiene concern.

Comments

@andrewsg
Copy link
Contributor

andrewsg commented Nov 8, 2023

Once google-api-core and googleapis-common-protos have adopted native namespace packaging and removed their __init__.py files in the google namespace, then we should add a test that validates that this package and all dependencies do not interfere with further use of the google namespace.

Test follows:

import os
import subprocess
import sys
import tempfile


def test_namespace_package_compat():
    """
    The ``google`` namespace package should not be masked
    by the presence of this package.
    """
    with tempfile.TemporaryDirectory() as tmp_path:
        google = tmp_path + "/google"
        os.mkdir(google)
        path = os.path.join(google, "othermod.py")
        with open(path, "w") as f:
            f.write("pass")
        env = dict(os.environ, PYTHONPATH=tmp_path)
        cmd = [sys.executable, "-m", "google.othermod"]
        subprocess.check_call(cmd, env=env)
@andrewsg andrewsg self-assigned this Nov 8, 2023
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Nov 8, 2023
@frankyn frankyn added the type: cleanup An internal cleanup or hygiene concern. label Feb 26, 2024
@frankyn
Copy link
Member

frankyn commented Feb 26, 2024

Hi @andrewsg Is this issue unblocked now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

No branches or pull requests

2 participants