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

Commit

Permalink
fix: exclude docs and tests from package (#63)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
msdinit authored Jun 17, 2021
1 parent cbd94ac commit ff68d16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

packages = [
package
for package in setuptools.PEP420PackageFinder.find()
if package.startswith("google")
]

setuptools.setup(
name="google-cloud-workflows",
version=version,
Expand All @@ -35,7 +41,7 @@
author_email="googleapis-packages@google.com",
license="Apache 2.0",
url="https://github.com/googleapis/python-workflows",
packages=setuptools.PEP420PackageFinder.find(),
packages=packages,
namespace_packages=("google", "google.cloud"),
platforms="Posix; MacOS X; Windows",
include_package_data=True,
Expand Down

0 comments on commit ff68d16

Please sign in to comment.