Ajstros / pyripherals

Python solution for communicating with peripheral ICs
GNU General Public License v3.0
2 stars 3 forks source link

[JOSS REVIEW] tests no_fpga failing #22

Closed askuric closed 2 years ago

askuric commented 2 years ago

Describe the bug I'm testing the installation of the pyripherals pip package. I've followed the instalation guidelines, and installed it from pip. However since I do not have FPGA to test it with and I'm working on linux, I cannot install the FronPannel API. So the first test of

from pyripherals.utils import create_yaml
create_yaml()

was successful.

However when I try to run the tests, the line python -m pytest -m no_fpgagives this error:

================================================================================== test session starts ==================================================================================
platform linux -- Python 3.10.4, pytest-7.1.3, pluggy-1.0.0
rootdir: ../joss/pyripherals, configfile: pyproject.toml
collected 1339 items / 1 error / 515 deselected / 824 selected                                                                                                                          

======================================================================================== ERRORS =========================================================================================
_________________________________________________________________ ERROR collecting python/tests/unit_tests/i2c_test.py __________________________________________________________________
python/tests/unit_tests/i2c_test.py:20: in <module>
    message_eps = Endpoint.get_chip_endpoints('I2CTEST')
../../python3.10/site-packages/pyripherals/core.py:335: in get_chip_endpoints
    Endpoint.update_endpoints_from_defines()
../../python3.10/site-packages/pyripherals/core.py:159: in update_endpoints_from_defines
    with open(ep_defines_path, 'r') as file:
E   TypeError: expected str, bytes or os.PathLike object, not NoneType
================================================================================ short test summary info ================================================================================
ERROR python/tests/unit_tests/i2c_test.py - TypeError: expected str, bytes or os.PathLike object, not NoneType
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================================================== 515 deselected, 1 error in 1.51s ============================================================================

I have cloned your repository and I have the same behavior for the master and v0.0.2 branch.

I am not sure if this is due to not having FronPannel API, or maybe Linux OS or something else.

lucask07 commented 2 years ago

Hi @askuric Could you post your YAML configuration file (described here)? The error output suggests that _ep_definespath is None.

You are correct that we have not been able to test with Linux OS. But we have verified with both Windows and MAC OS.

My MAC configuration file is at ~/.pyripherals/config.yaml

endpoint_max_width: 32 ep_defines_path: /Users/koer2434/Documents/covg_fpga/fpga_XEM7310/fpga_XEM7310.srcs/sources_1/ep_defines.v fpga_bitfile_path: /Users/koer2434/Documents/covg_fpga/fpga_XEM7310/fpga_XEM7310.runs/impl_1/top_level_module.bit frontpanel_path: /Users/koer2434/Documents/frontpanel_5p26 registers_path: /Users/koer2434/Documents/covg_fpga/python/Registers.xlsx

untzag commented 2 years ago

Hi @lucask07, I have the same issue as @askuric. My auto-generated YAML is as follows:

endpoint_max_width: 32
ep_defines_path: null
fpga_bitfile_path: null
frontpanel_path: C:/Program Files/Opal Kelly/FrontPanelUSB
registers_path: null
untzag commented 2 years ago

I guess we are in a somewhat strange place, we would like to know the minimal path to run tests without hardware