FS#68380 - [python-milc] tests installed to system directory conflicting with other (misconfigured) packages

Attached to Project: Community Packages
Opened by Sol Bekic (s-ol) - Thursday, 22 October 2020, 11:44 GMT
Last edited by Morten Linderud (Foxboron) - Thursday, 22 October 2020, 18:01 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Morten Linderud (Foxboron)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The python-milc package installs its tests as a python package called just 'tests':

$ pacman -Ql python-milc
...
python-milc /usr/lib/python3.8/site-packages/tests/
python-milc /usr/lib/python3.8/site-packages/tests/__init__.py
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/__init__.cpython-38.opt-1.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/__init__.cpython-38.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test___init__.cpython-38.opt-1.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test___init__.cpython-38.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_ansi.cpython-38.opt-1.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_ansi.cpython-38.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_attrdict.cpython-38.opt-1.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_attrdict.cpython-38.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_configuration_Configuration.cpython-38.opt-1.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_configuration_Configuration.cpython-38.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_questions.cpython-38.opt-1.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_questions.cpython-38.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_script_hello.cpython-38.opt-1.pyc
python-milc /usr/lib/python3.8/site-packages/tests/__pycache__/test_script_hello.cpython-38.pyc
python-milc /usr/lib/python3.8/site-packages/tests/test___init__.py
python-milc /usr/lib/python3.8/site-packages/tests/test_ansi.py
python-milc /usr/lib/python3.8/site-packages/tests/test_attrdict.py
python-milc /usr/lib/python3.8/site-packages/tests/test_configuration_Configuration.py
python-milc /usr/lib/python3.8/site-packages/tests/test_questions.py
python-milc /usr/lib/python3.8/site-packages/tests/test_script_hello.py
...

Other packages that also make this mistake (e.g. the AUR package python-cadquery) then conflicts on these files.
The python packaging guidelines explicitly warn against this: https://wiki.archlinux.org/index.php/Python_package_guidelines#Test_directory_in_site-package

Additional info:
* current package version is 1.0.8-1

Steps to reproduce:
* build the package and inspect it
This task depends upon

Closed by  Morten Linderud (Foxboron)
Thursday, 22 October 2020, 18:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  1.0.9-1
Comment by Sol Bekic (s-ol) - Thursday, 22 October 2020, 12:00 GMT
This is actually easier to fix upstream, my bad jumping the gun by opening a task here. An upstream issue/pull-request has been filed at https://github.com/clueboard/milc/pull/20.
Comment by Morten Linderud (Foxboron) - Thursday, 22 October 2020, 12:07 GMT
Yes it should be patched upstream, but since it blocks package installation it's fine submitting the bugeport. However this isn't the only package with this problem.

λ ~ » pacman -F /usr/lib/python3.8/site-packages/tests/
usr/lib/python3.8/site-packages/tests/ is owned by community/python-django-sekizai 2.0.0-2
usr/lib/python3.8/site-packages/tests/ is owned by community/python-milc 1.0.8-1
usr/lib/python3.8/site-packages/tests/ is owned by community/python-pook 1.0.1-1
usr/lib/python3.8/site-packages/tests/ is owned by community/python-softlayer 5.9.1-1
usr/lib/python3.8/site-packages/tests/ is owned by community/python-threadloop 1.0.2-1
usr/lib/python3.8/site-packages/tests/ is owned by community/python-trio-asyncio 0.11.0-1
Comment by Sol Bekic (s-ol) - Thursday, 22 October 2020, 14:12 GMT
@Foxboron: good catch, I wasn't aware of -F.

In the meantime upstream has quickly fixed the issue and re-released version 1.0.9: https://github.com/clueboard/milc/compare/1.0.8...1.0.9
I flagged python-milc out-of-date, now it just needs a rebuild :)

What makes most sense to proceed, turn this into a group ticket for the others or create a task for each?
Comment by Morten Linderud (Foxboron) - Thursday, 22 October 2020, 14:13 GMT
Nah, I'll make a todo list with the packages. No need for bugreports.

https://www.archlinux.org/todo/

Loading...