Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tests directory from wheel package #120

Closed
dcolmenares-r7 opened this issue Feb 17, 2022 · 1 comment · Fixed by #121
Closed

Remove tests directory from wheel package #120

dcolmenares-r7 opened this issue Feb 17, 2022 · 1 comment · Fixed by #121
Assignees
Labels
api: orgpolicy Issues related to the googleapis/python-org-policy API. type: cleanup An internal cleanup or hygiene concern.

Comments

@dcolmenares-r7
Copy link

Environment details

  • OS type and version: MacOS v11.6.1
  • Python version: python --version - Python 3.8.12
  • pip version: pip --version - pip 21.3.1
  • google-cloud-org-policy version: pip show google-cloud-org-policy
Name: google-cloud-org-policy
Version: 1.2.1
Summary: UNKNOWN
Home-page: https://github.com/googleapis/python-org-policy
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Requires: google-api-core, proto-plus
Required-by: divvycloud, google-cloud-asset

Steps to reproduce

Building this library using the standard build steps:

python -m pip install --upgrade setuptools wheel
python setup.py sdist bdist_wheel

This builds the wheel package in the dist/ folder. Unzipping that we see multiple unit tests.

unzip -l google_cloud_org_policy-1.2.1-py2.py3-none-any.whl | grep 'tests'

Code example

N/A

Stack trace

% unzip -l google_cloud_org_policy-1.2.1-py2.py3-none-any.whl | grep 'tests'
      600  02-17-2022 20:21   tests/__init__.py
      600  02-17-2022 20:21   tests/unit/__init__.py
      600  02-17-2022 20:21   tests/unit/gapic/__init__.py
      600  02-17-2022 20:21   tests/unit/gapic/orgpolicy_v2/__init__.py
   112030  02-17-2022 20:21   tests/unit/gapic/orgpolicy_v2/test_org_policy.py

I would be happy to submit a PR with the proposed change. Adding

packages=setuptools.PEP420PackageFinder.find(exclude=['tests*'])

to setup.py - https://github.com/googleapis/python-org-policy/blob/main/setup.py#L39, looks like it fixes it but whatever works for you all. The reason for requesting this change is anyone using a tests folder as part of their package structure will be affected by this, as site-packages takes precedence in many setups.

Thanks

@product-auto-label product-auto-label bot added the api: orgpolicy Issues related to the googleapis/python-org-policy API. label Feb 17, 2022
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Feb 18, 2022
busunkim96 added a commit that referenced this issue Feb 18, 2022
@busunkim96
Copy link
Contributor

Hi @dcolmenares-r7,

That sounds reasonable, I've opened #121.

@busunkim96 busunkim96 self-assigned this Feb 18, 2022
@busunkim96 busunkim96 added type: cleanup An internal cleanup or hygiene concern. and removed triage me I really want to be triaged. labels Feb 18, 2022
parthea pushed a commit that referenced this issue Feb 18, 2022
* fix: remove tests directory from wheel

Fixes #120

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: orgpolicy Issues related to the googleapis/python-org-policy API. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants