Bug 2278863

Summary: python-devicely fails to build with pytest 8: TypeError: read_csv() got an unexpected keyword argument 'squeeze'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-devicelyAssignee: Sandro <gui1ty>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gui1ty, iztok, mhroncok, neuro-sig, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-devicely-1.1.1-15.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-05-12 12:16:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2256331    

Description Tomáš Hrnčiar 2024-05-03 11:52:27 UTC
python-devicely fails to build with pytest 8.

This seems like an error with Pandas 2 where squeeze argument was removed from read_csv(). I am not sure why the package builds in rawhide, but not with pytest 8.

==================================== ERRORS ====================================
___________________ ERROR collecting tests/test_empatica.py ____________________
tests/test_empatica.py:18: in __init__
    self.reader = devicely.EmpaticaReader(self.READ_PATH)
../../BUILDROOT/python-devicely-1.1.1-10.fc41.x86_64/usr/lib/python3.12/site-packages/devicely/empatica.py:90: in __init__
    self.tags = self._read_tags(os.path.join(path, 'tags.csv'))
../../BUILDROOT/python-devicely-1.1.1-10.fc41.x86_64/usr/lib/python3.12/site-packages/devicely/empatica.py:191: in _read_tags
    return pd.read_csv(path, header=None,
E   TypeError: read_csv() got an unexpected keyword argument 'squeeze'
=========================== short test summary info ============================
ERROR tests/test_empatica.py::EmpaticaTestCase - TypeError: read_csv() got an...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
================= 8 deselected, 123 warnings, 1 error in 0.61s =================

https://docs.pytest.org/en/stable/changelog.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07401119-python-devicely/

For all our attempts to build python-devicely with pytest 8, see:
https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/package/python-devicely/

Let us know here if you have any questions.

Pytest 8 is planned to be included in Fedora 41. And this bugzilla is a
heads up before we merge new pytest into rawhide. For more info see a Fedora Change
proposal https://fedoraproject.org/wiki/Changes/Pytest_8

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Sandro 2024-05-03 19:50:09 UTC
Well, there was an issue with running `empatica` tests[1], hence its exclusion from the tests: `pytest -k 'not Faros and not Empatica'`. It seems the updated `pytest` behaves differently, since the error occurs during collection, not when the tests are run. I've got an idea for a workaround...

[1] https://github.com/hpi-dhc/devicely/issues/61

Comment 2 Sandro 2024-05-03 20:03:47 UTC
PR with fix submitted.

Comment 3 Fedora Update System 2024-05-12 12:12:45 UTC
FEDORA-2024-cb89117451 (python-devicely-1.1.1-15.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-cb89117451

Comment 4 Fedora Update System 2024-05-12 12:16:10 UTC
FEDORA-2024-cb89117451 (python-devicely-1.1.1-15.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.