Skip to content

Commit 2ed915e

Browse files
fix: use native namespace to avoid pkg_resources warnings (#1176)
* fix: use native namespace to avoid pkg_resources warnings * remove comment header of empty files * bring in line with auth library changes * lint * fix coverage * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add tests and remove namespace_packages in setup.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * mark this as a system test * remove test for now * remove obsolete namespace list --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 003d5c6 commit 2ed915e

File tree

5 files changed

+11
-51
lines changed

5 files changed

+11
-51
lines changed

.coveragerc

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
[run]
1919
branch = True
2020
omit =
21+
.nox/*
2122
google/__init__.py
2223
google/cloud/__init__.py
2324

@@ -32,6 +33,7 @@ exclude_lines =
3233
# Ignore abstract methods
3334
raise NotImplementedError
3435
omit =
36+
.nox/*
3537
*/gapic/*.py
3638
*/proto/*.py
3739
*/core/*.py

google/__init__.py

-22
This file was deleted.

google/cloud/__init__.py

-22
This file was deleted.

owlbot.py

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@
6767
export DUAL_REGION_LOC_1
6868
export DUAL_REGION_LOC_2""")
6969

70+
s.replace(
71+
".coveragerc",
72+
"omit =",
73+
"""omit =
74+
.nox/*""")
75+
7076
python.py_samples(skip_readmes=True)
7177

7278
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

setup.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,11 @@
5454
# Only include packages under the 'google' namespace. Do not include tests,
5555
# benchmarks, etc.
5656
packages = [
57-
package for package in setuptools.find_packages() if package.startswith("google")
57+
package
58+
for package in setuptools.find_namespace_packages()
59+
if package.startswith("google")
5860
]
5961

60-
# Determine which namespaces are needed.
61-
namespaces = ["google"]
62-
if "google.cloud" in packages:
63-
namespaces.append("google.cloud")
64-
6562

6663
setuptools.setup(
6764
name=name,
@@ -88,7 +85,6 @@
8885
],
8986
platforms="Posix; MacOS X; Windows",
9087
packages=packages,
91-
namespace_packages=namespaces,
9288
install_requires=dependencies,
9389
extras_require=extras,
9490
python_requires=">=3.7",

0 commit comments

Comments
 (0)