Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit ff68d16

Browse files
authored
fix: exclude docs and tests from package (#63)
Currently, packages `tests` and `docs` are installed (because they are discovered as valid packages by `PEP420PackageFinder`), which can break user's code if they also use `test` as a location for their tests, due to package name conflict. To reproduce - install this package from pypi, see that `tests` package is present in your venv's site-packages. This change pretty much follows what other Google packages do, eg [here](https://github.com/googleapis/python-api-core/blob/master/setup.py#L66)
1 parent cbd94ac commit ff68d16

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setup.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
with io.open(readme_filename, encoding="utf-8") as readme_file:
2828
readme = readme_file.read()
2929

30+
packages = [
31+
package
32+
for package in setuptools.PEP420PackageFinder.find()
33+
if package.startswith("google")
34+
]
35+
3036
setuptools.setup(
3137
name="google-cloud-workflows",
3238
version=version,
@@ -35,7 +41,7 @@
3541
author_email="googleapis-packages@google.com",
3642
license="Apache 2.0",
3743
url="https://github.com/googleapis/python-workflows",
38-
packages=setuptools.PEP420PackageFinder.find(),
44+
packages=packages,
3945
namespace_packages=("google", "google.cloud"),
4046
platforms="Posix; MacOS X; Windows",
4147
include_package_data=True,

0 commit comments

Comments
 (0)