From aa861754c8581ec8963d155dd26c15bf48c00a8a Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Fri, 2 Jun 2023 12:47:49 +0200 Subject: [PATCH] pytest, bump version, add dependencies (#8774) --- .../exceptiongroup-1.1.1.recipe | 88 ++++++++++++++++++ dev-python/flit-scm/flit_scm-1.7.0.recipe | 67 ++++++++++++++ dev-python/pytest/pytest-7.1.3.recipe | 77 ---------------- dev-python/pytest/pytest-7.3.1.recipe | 90 +++++++++++++++++++ 4 files changed, 245 insertions(+), 77 deletions(-) create mode 100644 dev-python/exceptiongroup/exceptiongroup-1.1.1.recipe create mode 100644 dev-python/flit-scm/flit_scm-1.7.0.recipe delete mode 100644 dev-python/pytest/pytest-7.1.3.recipe create mode 100644 dev-python/pytest/pytest-7.3.1.recipe diff --git a/dev-python/exceptiongroup/exceptiongroup-1.1.1.recipe b/dev-python/exceptiongroup/exceptiongroup-1.1.1.recipe new file mode 100644 index 000000000..bee4de5db --- /dev/null +++ b/dev-python/exceptiongroup/exceptiongroup-1.1.1.recipe @@ -0,0 +1,88 @@ +SUMMARY="Backport of PEP 654 (exception groups)" +DESCRIPTION="This is a backport of the BaseExceptionGroup and ExceptionGroup classes from \ +Python 3.11. + +It contains the following: +- The exceptiongroup.BaseExceptionGroup and exceptiongroup.ExceptionGroup + classes +- A utility function (exceptiongroup.catch()) for catching exceptions possibly + nested in an exception group +- Patches to the TracebackException class that properly formats exception groups + (installed on import) +- An exception hook that handles formatting of exception groups through + TracebackException (installed on import) + +If this package is imported on Python 3.11 or later, the built-in implementations of the \ +exception group classes are used instead, TracebackException is not monkey patched and the \ +exception hook won't be installed." +HOMEPAGE="https://github.com/agronholm/exceptiongroup" +COPYRIGHT="2022 Alex Grönholm" +LICENSE="MIT" +REVISION="1" +SOURCE_URI="$HOMEPAGE/archive/refs/tags/$portVersion.tar.gz" +CHECKSUM_SHA256="abe42a62bac0948d95bba6a48f63d8ebb21a7420fd26039a4ec951873fafaee7" +SOURCE_FILENAME="exceptiongroup.tar.gz" + +ARCHITECTURES="any" + +PROVIDES=" + $portName = $portVersion + " +REQUIRES=" + haiku + " + +BUILD_REQUIRES=" + haiku_devel + " + +PYTHON_PACKAGES=(python39 python310) +PYTHON_VERSIONS=(3.9 3.10) +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+=" + build_$pythonPackage + flit_core_$pythonPackage + flit_scm_$pythonPackage + installer_$pythonPackage + setuptools_scm_$pythonPackage + " + BUILD_PREREQUIRES+=" + cmd:python$pythonVersion + " +done + +TEST_REQUIRES=" + cmd:pytest + " + +INSTALL() +{ + export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion + + for i in "${!PYTHON_PACKAGES[@]}"; do + pythonVersion=${PYTHON_VERSIONS[$i]} + + python=python$pythonVersion + + $python -m build --wheel --skip-dependency-check --no-isolation + $python -m installer -p $prefix dist/*.whl + + packageEntries ${PYTHON_PACKAGES[i]} \ + $prefix/lib/python* + done +} + +TEST() +{ + pytest -v +} diff --git a/dev-python/flit-scm/flit_scm-1.7.0.recipe b/dev-python/flit-scm/flit_scm-1.7.0.recipe new file mode 100644 index 000000000..d79b2db4c --- /dev/null +++ b/dev-python/flit-scm/flit_scm-1.7.0.recipe @@ -0,0 +1,67 @@ +SUMMARY="PEP 518 build backend combining flit with setuptools_scm" +DESCRIPTION="A PEP 518 build backend that uses setuptools_scm to generate a version file from \ +your version control system, then flit_core to build the package." +HOMEPAGE="https://gitlab.com/WillDaSilva/flit_scm" +COPYRIGHT="2021 Will Da Silva" +LICENSE="MIT" +REVISION="1" +SOURCE_URI="$HOMEPAGE/-/archive/$portVersion/flit_scm-$portVersion.tar.bz2" +CHECKSUM_SHA256="bb49e2da0da8628ed7892283d773c7f2cac46a0ee034a8e08aa557b58b222baa" + +ARCHITECTURES="any" + +PROVIDES=" + $portName = $portVersion + " +REQUIRES=" + haiku + " + +BUILD_REQUIRES=" + haiku_devel + " + +PYTHON_PACKAGES=(python39 python310) +PYTHON_VERSIONS=(3.9 3.10) +for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + + eval "PROVIDES_$pythonPackage=\" + ${portName}_$pythonPackage = $portVersion + \"" + eval "REQUIRES_$pythonPackage=\" + haiku + flit_core_$pythonPackage + setuptools_scm_$pythonPackage + tomli_$pythonPackage + cmd:python$pythonVersion + \"" + BUILD_REQUIRES+=" + flit_core_$pythonPackage + setuptools_scm_$pythonPackage + tomli_$pythonPackage + " + BUILD_PREREQUIRES+=" + build_$pythonPackage + installer_$pythonPackage + cmd:python$pythonVersion + " +done + +INSTALL() +{ + export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion + + for i in "${!PYTHON_PACKAGES[@]}"; do + pythonVersion=${PYTHON_VERSIONS[$i]} + + python=python$pythonVersion + + $python -m build --wheel --skip-dependency-check --no-isolation + $python -m installer -p $prefix dist/*.whl + + packageEntries ${PYTHON_PACKAGES[i]} \ + $prefix/lib/python* + done +} diff --git a/dev-python/pytest/pytest-7.1.3.recipe b/dev-python/pytest/pytest-7.1.3.recipe deleted file mode 100644 index 2b66ac3f1..000000000 --- a/dev-python/pytest/pytest-7.1.3.recipe +++ /dev/null @@ -1,77 +0,0 @@ -SUMMARY="A Python testing framework" -DESCRIPTION="The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries." -HOMEPAGE="https://pytest.org" -COPYRIGHT="2010-2020 Holger Krekel and others." -LICENSE="MIT" -REVISION="3" -SOURCE_URI="https://pypi.io/packages/source/p/pytest/pytest-$portVersion.tar.gz" -CHECKSUM_SHA256="4f365fec2dff9c1162f834d9f18af1ba13062db0c708bf7b946f8a5c76180c39" - -ARCHITECTURES="any" - -PROVIDES=" - pytest=$portVersion - " -REQUIRES=" - haiku - " - -BUILD_REQUIRES=" - haiku_devel - " - -PYTHON_PACKAGES=(python39 python310) -PYTHON_VERSIONS=(3.9 3.10) -for i in "${!PYTHON_PACKAGES[@]}"; do -pythonPackage=${PYTHON_PACKAGES[i]} -pythonVersion=${PYTHON_VERSIONS[$i]} -eval "PROVIDES_${pythonPackage}=\"\ - ${portName}_$pythonPackage = $portVersion\n\ - cmd:py.test$pythonVersion\n\ - cmd:pytest$pythonVersion\n\ - \"; \ -REQUIRES_$pythonPackage=\"\ - haiku\n\ - cmd:python$pythonVersion\n\ - attrs_$pythonPackage\n\ - importlib_metadata_$pythonPackage\n\ - iniconfig_$pythonPackage\n\ - packaging_$pythonPackage\n\ - pluggy_$pythonPackage\n\ - py_$pythonPackage\n\ - tomli_$pythonPackage\n\ - zipp_$pythonPackage\n\ - \"" -BUILD_REQUIRES="$BUILD_REQUIRES - setuptools_scm_$pythonPackage - " -BUILD_PREREQUIRES="$BUILD_PREREQUIRES - cmd:python$pythonVersion - pip_$pythonPackage - " -done - -INSTALL() -{ - export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion - - 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 - - mv $prefix/bin/pytest $prefix/bin/pytest$pythonVersion - mv $prefix/bin/py.test $prefix/bin/py.test$pythonVersion - - packageEntries $pythonPackage \ - $prefix/lib/python* \ - $prefix/bin - done -} diff --git a/dev-python/pytest/pytest-7.3.1.recipe b/dev-python/pytest/pytest-7.3.1.recipe new file mode 100644 index 000000000..0aa375a87 --- /dev/null +++ b/dev-python/pytest/pytest-7.3.1.recipe @@ -0,0 +1,90 @@ +SUMMARY="A Python testing framework" +DESCRIPTION="The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries." +HOMEPAGE="https://pytest.org" +COPYRIGHT="2004 Holger Krekel and others." +LICENSE="MIT" +REVISION="1" +SOURCE_URI="https://pypi.io/packages/source/p/pytest/pytest-$portVersion.tar.gz" +CHECKSUM_SHA256="434afafd78b1d78ed0addf160ad2b77a30d35d4bdf8af234fe621919d9ed15e3" + +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 + cmd:py.test_$pythonVersion.py = $portVersion + cmd:pytest_$pythonVersion.py = $portVersion + \"" + # Provide non-suffixed cmd only for the default Python version + if [ $pythonVersion = $defaultVersion ]; then + eval "PROVIDES_$pythonPackage+=\" + cmd:py.test = $portVersion + cmd:pytest = $portVersion + \"" + fi + eval "REQUIRES_$pythonPackage=\" + haiku + exceptiongroup_$pythonPackage + importlib_metadata_$pythonPackage + iniconfig_$pythonPackage + packaging_$pythonPackage + pluggy_$pythonPackage + tomli_$pythonPackage + cmd:python$pythonVersion + \"" + BUILD_REQUIRES+=" + setuptools_scm_$pythonPackage + " + BUILD_PREREQUIRES+=" + build_$pythonPackage + installer_$pythonPackage + wheel_$pythonPackage + cmd:python$pythonVersion + " +done + +INSTALL() +{ + export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion + + for i in "${!PYTHON_PACKAGES[@]}"; do + pythonVersion=${PYTHON_VERSIONS[$i]} + + python=python$pythonVersion + $python -m build --wheel --skip-dependency-check --no-isolation + $python -m installer -p $prefix dist/*.whl + + # Version suffix all the scripts + for f in $binDir/*; do + mv $f ${f%.py}-${pythonVersion}.py + done + + # And provide suffix-less symlinks for the default version + if [ $pythonVersion = $defaultVersion ]; then + for f in $binDir/*; do + ln -sr $f ${f%-$pythonVersion.py} + done + fi + + packageEntries ${PYTHON_PACKAGES[i]} \ + $prefix/lib/python* \ + $binDir + done +}