Skip to content

Commit

Permalink
fix: Use include rather than exclude to find_namespace_packages in se…
Browse files Browse the repository at this point in the history
…tup.py (#502)

https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
has a warning:

> Please have in mind that find_namespace: (setup.cfg),
> find_namespace_packages() (setup.py) and find (pyproject.toml)
> will scan all folders that you have in your project directory
> if you use a flat-layout.

That applies here.  Without this change, if you run:
'python3 setup.py bdist_wheel' then you may end up with
build/ in your wheel, and in some cases even
docs/ and testing/ .

The fix is to only include proto and proto.*.

Signed-off-by: Scott Moser <[email protected]>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
smoser and parthea authored Jan 22, 2025
1 parent c57ebd7 commit 77e252e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
author="Google LLC",
author_email="[email protected]",
url="https://github.com/googleapis/proto-plus-python.git",
packages=find_namespace_packages(exclude=["docs", "tests"]),
packages=find_namespace_packages(include=["proto", "proto.*"]),
description="Beautiful, Pythonic protocol buffers.",
long_description=README,
platforms="Posix; MacOS X",
Expand Down

0 comments on commit 77e252e

Please sign in to comment.