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

Define package dir in setup.py #28

Merged
merged 2 commits into from
Oct 29, 2023
Merged

Define package dir in setup.py #28

merged 2 commits into from
Oct 29, 2023

Conversation

onkelbeh
Copy link
Contributor

otherwise:

 * python3_11: running distutils-r1_run_phase distutils-r1_python_install
 * The following unexpected files/directories were found top-level
 * in the site-packages directory:
 *
 *   /usr/lib/python3.11/site-packages/tests
 *
 * This is most likely a bug in the build system.  More information
 * can be found in the Python Guide:
 * https://projects.gentoo.org/python/guide/qawarn.html#stray-top-level-files-in-site-packages
 * ERROR: dev-python/aiopegelonline-0.0.6::HomeAssistantRepository failed (install phase):
 *   Failing install because of stray top-level files in site-packages

otherwise:

```
 * python3_11: running distutils-r1_run_phase distutils-r1_python_install
 * The following unexpected files/directories were found top-level
 * in the site-packages directory:
 *
 *   /usr/lib/python3.11/site-packages/tests
 *
 * This is most likely a bug in the build system.  More information
 * can be found in the Python Guide:
 * https://projects.gentoo.org/python/guide/qawarn.html#stray-top-level-files-in-site-packages
 * ERROR: dev-python/aiopegelonline-0.0.6::HomeAssistantRepository failed (install phase):
 *   Failing install because of stray top-level files in site-packages
```
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (708bd39) 100.00% compared to head (8ac793a) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #28   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          102       102           
=========================================
  Hits           102       102           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mib1185
Copy link
Owner

mib1185 commented Oct 19, 2023

HI @onkelbeh
thanks for bring this up. Could you please provide a bit more how to reproduce this?

@onkelbeh
Copy link
Contributor Author

first, I hope you don't mind I included your component for Home Assistant Gentoo Overlay. But, during compilation test, the installation test script throws an error, because setup.py tries to install a package called tests at top level (and is forbidden for e.g. "test", "tests", "examples", "docs", etc.). find_packages will install everything that looks like a Python package from the source tree.

I had to add a patch to the build script: https://github.com/onkelbeh/HomeAssistantRepository/blob/master/dev-python/aiopegelonline/aiopegelonline-0.0.6.ebuild to get it compiled.

The Patch I suggested here only makes sure that 'tests' will not be installed after compilation, this is a generic (and very common) exclusion to find_packages().

@mib1185
Copy link
Owner

mib1185 commented Oct 29, 2023

i think in this small lib, we don't need to use the find_packages() at all, but just define the "one and only" package dir 🙈

first, I hope you don't mind I included your component for Home Assistant Gentoo Overlay

feel free to use it, that is what open source is for 😉

@mib1185 mib1185 merged commit 02369d8 into mib1185:main Oct 29, 2023
4 checks passed
@mib1185 mib1185 added the bug Something isn't working label Oct 29, 2023
@mib1185 mib1185 changed the title Update setup.py, exclude tests from installing Define package dir in setup.py Oct 29, 2023
@onkelbeh onkelbeh deleted the patch-1 branch November 14, 2023 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants