openembedded / meta-openembedded

MIT License
400 stars 696 forks source link

meta-python - Pymodbus Package #474

Open wes8ty opened 2 years ago

wes8ty commented 2 years ago

I am trying to add the pymodbus pacakge to the meta-python layer. I am not a Yocto expert but I am stumped on this error although I added the ${PYTHON_PN}-six package. I would appreciate any help.

ERROR: python3-pymodbus-2.5.3-r0 do_compile: 'python3 setup.py build ' execution failed.
ERROR: python3-pymodbus-2.5.3-r0 do_compile: Execution of '/home/wes8ty/Repos/cns-fslc-yocto/build_xwayland_dev/tmp/work/aarch64-fslc-linux/python3-pymodbus/2.5.3-r0/temp/run.do_compile.32709' failed with exit code 1:
Traceback (most recent call last):
  File "setup.py", line 28, in <module>
    from pymodbus.utilities import IS_PYTHON3
  File "/home/wes8ty/Repos/cns-fslc-yocto/build_xwayland_dev/tmp/work/aarch64-fslc-linux/python3-pymodbus/2.5.3-r0/pymodbus-2.5.3/pymodbus/utilities.py", line 8, in <module>
    from pymodbus.compat import int2byte, byte2int, IS_PYTHON3
  File "/home/wes8ty/Repos/cns-fslc-yocto/build_xwayland_dev/tmp/work/aarch64-fslc-linux/python3-pymodbus/2.5.3-r0/pymodbus-2.5.3/pymodbus/compat.py", line 15, in <module>
    import six
ModuleNotFoundError: No module named 'six'
WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in: /home/wes8ty/Repos/cns-fslc-yocto/build_xwayland_dev/tmp/work/aarch64-fslc-linux/python3-pymodbus/2.5.3-r0/temp/log.do_compile.32709

meta-openembedded/meta-python/recipes-devtools/python/python3-pymodbus_2.5.3.bb

DESCRIPTION = "Pymodbus is a full Modbus protocol implementation using twisted/torndo/asyncio for its asynchronous communications core."
SUMMARY = "A fully featured modbus protocol stack in python"
HOMEPAGE = "http://python-requests.org"

LICENSE = "Unknown & GPLv2 & BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2c2223d66c7e674b40527b5a4c35bd76"

#SRC_URI = "https://github.com/riptideio/pymodbus/archive/refs/tags/v${PV}.tar.gz"
#SRC_URI[md5sum] = "99a55a9f7e28c6242daaaebb4e442d2e"
SRC_URI[sha256sum] = "5ef68c1a109bdb467c830ef003ef2db6494349a5248e4af946fe21c9eefe7e74"

inherit pypi setuptools3

RDEPENDS_${PN} += " \
    ${PYTHON_PN}-six \
    ${PYTHON_PN}-crypt \
    ${PYTHON_PN}-json \
    ${PYTHON_PN}-netserver \
    ${PYTHON_PN}-netclient \
    ${PYTHON_PN}-asyncio \
    ${PYTHON_PN}-io \
"
wes8ty commented 2 years ago

I found the solution. For those who might come across this,


SUMMARY = "A fully featured modbus protocol stack in python"
HOMEPAGE = "https://github.com/riptideio/pymodbus/"
AUTHOR = "Galen Collins <bashwork@gmail.com>"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2c2223d66c7e674b40527b5a4c35bd76"

SRC_URI = "https://files.pythonhosted.org/packages/fe/a9/f98aadfcb8d0a34326be68a06a72cc60e04139e8f4fd17633972f8af3b4c/pymodbus-2.5.3.tar.gz"
SRC_URI[md5sum] = "28e8ac7f84adace83319d3733e00dee8"
SRC_URI[sha256sum] = "5ef68c1a109bdb467c830ef003ef2db6494349a5248e4af946fe21c9eefe7e74"

S = "${WORKDIR}/pymodbus-2.5.3"

DEPENDS += "${PYTHON_PN}-six-native"

RDEPENDS_${PN} = "python3-six python3-pyserial"

inherit setuptools3