Files
haikuports/dev-python/astroid/astroid-2.15.5.recipe
Oscar Lesta 773dc55cd8 astroid: drop Python 3.9 support.
Only user on-tree of this is `asttokens`, and we only package that
for 3.10 at the moment.
2025-09-19 22:53:14 -03:00

98 lines
2.7 KiB
Bash

SUMMARY="An abstract syntax tree for Python with inference support"
DESCRIPTION="The aim of this module is to provide a common base representation of python source \
code. It is currently the library powering pylint's capabilities.
It provides a compatible representation which comes from the _ast module. It rebuilds the tree \
generated by the builtin _ast module by recursively walking down the AST and building an extended \
ast. The new node classes have additional methods and attributes for different usages. They \
include some support for static inference and local name scopes. Furthermore, astroid can also \
build partial trees by inspecting living objects."
HOMEPAGE="https://github.com/PyCQA/astroid"
COPYRIGHT="2003-2023, Logilab, PyCQA and contributors"
LICENSE="GNU LGPL v2.1"
REVISION="3"
SOURCE_URI="https://pypi.io/packages/source/a/$portName/$portName-$portVersion.tar.gz"
CHECKSUM_SHA256="1039262575027b441137ab4a62a793a9b43defb42c32d5670f38686207cd780f"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_VERSIONS=(3.10)
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
lazy_object_proxy_$pythonPackage
typing_extensions_$pythonPackage # only needed for Python < 3.11
wrapt_$pythonPackage
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
build_$pythonPackage
installer_$pythonPackage
setuptools_$pythonPackage
wheel_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
TEST_REQUIRES+="
astroid_$pythonPackage
pytest_$pythonPackage
"
done
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
python=python$pythonVersion
pythonPackage=python${pythonVersion//.}
$python -m build --wheel --skip-dependency-check --no-isolation
$python -m installer -p $prefix dist/*.whl
packageEntries $pythonPackage \
$prefix/lib/python*
done
}
TEST()
{
# The following test error out with :
# "ImportError: attempted relative import with no known parent package"
# interrupting the test run, so, skip them for now.
rm tests/test_builder.py
rm tests/test_inference.py
rm tests/test_lookup.py
rm tests/test_manager.py
rm tests/test_modutils.py
rm tests/test_nodes.py
rm tests/test_raw_building.py
rm tests/test_regrtest.py
rm tests/test_scoped_nodes.py
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
python=python$pythonVersion
$python -m pytest -m "not acceptance" tests
done
# And currently we get:
# "214 passed, 8 skipped, 2 xfailed" in Py 3.9
# "218 passed, 4 skipped, 2 xfailed" in Py 3.10
}