Skip to content

Commit

Permalink
fix: use native namespace to avoid pkg_resources warnings (#1176)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
andrewsg and gcf-owl-bot[bot] authored Nov 9, 2023
1 parent 003d5c6 commit 2ed915e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 51 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
[run]
branch = True
omit =
.nox/*
google/__init__.py
google/cloud/__init__.py

Expand All @@ -32,6 +33,7 @@ exclude_lines =
# Ignore abstract methods
raise NotImplementedError
omit =
.nox/*
*/gapic/*.py
*/proto/*.py
*/core/*.py
Expand Down
22 changes: 0 additions & 22 deletions google/__init__.py

This file was deleted.

22 changes: 0 additions & 22 deletions google/cloud/__init__.py

This file was deleted.

6 changes: 6 additions & 0 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
export DUAL_REGION_LOC_1
export DUAL_REGION_LOC_2""")

s.replace(
".coveragerc",
"omit =",
"""omit =
.nox/*""")

python.py_samples(skip_readmes=True)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
10 changes: 3 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,11 @@
# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
package for package in setuptools.find_packages() if package.startswith("google")
package
for package in setuptools.find_namespace_packages()
if package.startswith("google")
]

# Determine which namespaces are needed.
namespaces = ["google"]
if "google.cloud" in packages:
namespaces.append("google.cloud")


setuptools.setup(
name=name,
Expand All @@ -88,7 +85,6 @@
],
platforms="Posix; MacOS X; Windows",
packages=packages,
namespace_packages=namespaces,
install_requires=dependencies,
extras_require=extras,
python_requires=">=3.7",
Expand Down

0 comments on commit 2ed915e

Please sign in to comment.