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

Exclude tests in setuptools.find_packages #1

Open
31KM opened this issue Jan 11, 2022 · 1 comment
Open

Exclude tests in setuptools.find_packages #1

31KM opened this issue Jan 11, 2022 · 1 comment

Comments

@31KM
Copy link

31KM commented Jan 11, 2022

I'm currently packaging larynx + deps for Arch Linux and I encountered an issue with phonemes2ids: setuptools includes the tests in the package, which does not play well with Arch Linux packaging:

error: failed to commit transaction (conflicting files)
python-phonemes2ids: /usr/lib/python3.9/site-packages/tests/__init__.py exists in filesystem (owned by python-gruut-ipa)
python-phonemes2ids: /usr/lib/python3.9/site-packages/tests/__pycache__/__init__.cpython-39.opt-1.pyc exists in filesystem (owned by python-gruut-ipa)
python-phonemes2ids: /usr/lib/python3.9/site-packages/tests/__pycache__/__init__.cpython-39.pyc exists in filesystem (owned by python-gruut-ipa)
Errors occurred, no packages were upgraded.

(I packaged and installed gruut-ipa first - I will create the same issue for it as well)

I patched the setup.py file like this:

--- a/setup.py  2021-11-12 20:30:32.000000000 +0100                                                                                                                                                               
+++ b/setup.py  2022-01-11 00:59:29.372786663 +0100
@@ -28,7 +28,7 @@
     author="Michael Hansen",
     author_email="mike@rhasspy.org",
     url="https://github.com/rhasspy/phonemes2ids",
-    packages=setuptools.find_packages(),
+    packages=setuptools.find_packages(exclude=['tests']),
     package_data={"phonemes2ids": ["VERSION", "py.typed"]},
     entry_points={"console_scripts": ["phonemes2ids = phonemes2ids.__main__:main",]},
     classifiers=[

and now it is working.

@kevr
Copy link

kevr commented Jan 11, 2022

Just to shed some light on this: The tests package being installed is problematic in that, if other packages include their own tests package, these packages end up conflicting. This is the fault of both packages which conflict with each other, however, if all Arch packages followed this guideline of including their packages, and not blanket tests, the issue would not occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants