From 1c59629136d3e7fb5600ae25ddec348da68a4936 Mon Sep 17 00:00:00 2001 From: OscarL Date: Sat, 1 Apr 2023 05:11:14 -0300 Subject: [PATCH] jsonrpcclient: drop Python 3.7 support, add it for 3.9/3.10. (#8209) * jsonrpcclient: drop Python 3.7 support, add it for 3.9/3.10. Also: Fixed REQUIRES. jsonrpclient still won't run as the version of the `click` package in the repos (8.1.3) is too new for this version of `jsonrpclient` (requires click < 7.x). Updating to 4.0.3 will require either switching to install from the wheel (.whl) file provided by the project over PyPi, or having a working Poetry package in Haiku. Packaging Poetry and its nearly 30 dependencies is still an on-going quest, so in the meantime we might want to use that .whl after all. * jsonrpcclient: update to version 4.0.3. Had to use the .whl file provided on PyPi, as the tarball depends on Poetry (and we don't have it on repos). Tested "ping" example script via aiohttp, against jsonrpcserver. Got a "pong" as response, so it seems to be working :-) --- .../jsonrpcclient/jsonrpcclient-3.3.5.recipe | 67 ------------------ .../jsonrpcclient/jsonrpcclient-4.0.3.recipe | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 67 deletions(-) delete mode 100644 dev-python/jsonrpcclient/jsonrpcclient-3.3.5.recipe create mode 100644 dev-python/jsonrpcclient/jsonrpcclient-4.0.3.recipe diff --git a/dev-python/jsonrpcclient/jsonrpcclient-3.3.5.recipe b/dev-python/jsonrpcclient/jsonrpcclient-3.3.5.recipe deleted file mode 100644 index 351bf54a3..000000000 --- a/dev-python/jsonrpcclient/jsonrpcclient-3.3.5.recipe +++ /dev/null @@ -1,67 +0,0 @@ -SUMMARY="Send JSON-RPC requests in Python" -DESCRIPTION="This library allows you to call remote procedures using the \ -JSON-RPC message format." -HOMEPAGE="https://pypi.org/project/jsonrpcclient/ - https://github.com/bcb/jsonrpcclient" -COPYRIGHT="2015 Beau Barker" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="https://files.pythonhosted.org/packages/be/6a/0e756584a9550ff7d5f5a13a4cf325feeb5036e5ec8958617dd26321b7b6/jsonrpcclient-3.3.5.tar.gz" -CHECKSUM_SHA256="a17d02a53061748384b15b4e9812e866d5f69771656ccf7031d6dc64d0c38099" - -ARCHITECTURES="any" - -PROVIDES=" - $portName = $portVersion - " -REQUIRES=" - haiku - " - -BUILD_REQUIRES=" - haiku_devel - " - -PYTHON_PACKAGES=(python3) -PYTHON_VERSIONS=(3.7) -for i in "${!PYTHON_PACKAGES[@]}"; do -pythonPackage=${PYTHON_PACKAGES[i]} -pythonVersion=${PYTHON_VERSIONS[$i]} -eval "PROVIDES_${pythonPackage}=\"\ - ${portName}_$pythonPackage = $portVersion\ - \"; \ -REQUIRES_$pythonPackage=\"\ - haiku\n\ - cmd:python$pythonVersion\ - \"" -BUILD_REQUIRES="$BUILD_REQUIRES - setuptools_$pythonPackage" -BUILD_PREREQUIRES="$BUILD_PREREQUIRES - cmd:python$pythonVersion" -done - -PROVIDES_python3="$PROVIDES_python3 - cmd:jsonrpc3.7 - " - -INSTALL() -{ - for i in "${!PYTHON_PACKAGES[@]}"; do - pythonPackage=${PYTHON_PACKAGES[i]} - pythonVersion=${PYTHON_VERSIONS[$i]} - - python=python$pythonVersion - installLocation=$prefix/lib/$python/vendor-packages/ - export PYTHONPATH=$installLocation:$PYTHONPATH - mkdir -p $installLocation - rm -rf build - $python setup.py build install \ - --root=/ --prefix=$prefix - if [ $pythonPackage != python ]; then - mv $binDir/jsonrpc $binDir/jsonrpc$pythonVersion - fi - packageEntries $pythonPackage \ - $prefix/lib/python* \ - $binDir - done -} diff --git a/dev-python/jsonrpcclient/jsonrpcclient-4.0.3.recipe b/dev-python/jsonrpcclient/jsonrpcclient-4.0.3.recipe new file mode 100644 index 000000000..205fa603c --- /dev/null +++ b/dev-python/jsonrpcclient/jsonrpcclient-4.0.3.recipe @@ -0,0 +1,68 @@ +SUMMARY="Send JSON-RPC requests in Python" +DESCRIPTION="This library allows you to call remote procedures using the \ +JSON-RPC message format." +HOMEPAGE="https://pypi.org/project/jsonrpcclient/ + https://github.com/explodinglabs/jsonrpcclient" +COPYRIGHT="2015 Beau Barker" +LICENSE="MIT" +REVISION="1" +pypiVersion="00/4b/ba54814656b155f14ae73092ae194dd04eaf7e8e9a3da4f2ee7ffc9fe98f" +SOURCE_URI="https://files.pythonhosted.org/packages/$pypiVersion/jsonrpcclient-$portVersion-py3-none-any.whl#noarchive" +CHECKSUM_SHA256="3cbb9e27e1be29821becf135ea183144a836215422727e1ffe5056a49a670f0d" + +ARCHITECTURES="any" + +PROVIDES=" + $portName = $portVersion + " +REQUIRES=" + haiku + " + +BUILD_REQUIRES=" + haiku_devel + " + +PYTHON_PACKAGES=(python39 python310) +PYTHON_VERSIONS=(3.9 3.10) +defaultVersion=3.9 +for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + + eval "PROVIDES_${pythonPackage}=\" + ${portName}_$pythonPackage = $portVersion + \"" + + eval "REQUIRES_$pythonPackage=\" + haiku + cmd:python$pythonVersion + \"" + + BUILD_REQUIRES+=" + installer_$pythonPackage + " + BUILD_PREREQUIRES+=" + cmd:python$pythonVersion + " +done + + +INSTALL() +{ + for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + + python=python$pythonVersion + installLocation=$prefix/lib/$python/vendor-packages/ + export PYTHONPATH=$installLocation:$PYTHONPATH + + mkdir -p $installLocation + + $python -m installer -p $prefix $portName-$portVersion-py3-none-any.whl + + packageEntries $pythonPackage \ + $prefix/lib/python* + done +}