pythonnet-3.1.0gentoo
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517="setuptools"
PYTHON_COMPAT=( python3_14 )
DOTNET_PKG_COMPAT="10.0"
NUGETS="
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
"
inherit check-reqs dotnet-pkg distutils-r1 readme.gentoo-r1
DESCRIPTION="Nearly seamless integration with the .NET Common Language Runtime"
HOMEPAGE="https://pythonnet.github.io/
https://github.com/pythonnet/pythonnet/"
if [[ "${PV}" == *9999* ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/pythonnet/${PN}"
else
SRC_URI="https://github.com/pythonnet/${PN}/archive/refs/tags/v${PV}.tar.gz
-> ${P}.gh.tar.gz"
KEYWORDS="~amd64"
fi
SRC_URI+=" ${NUGET_URIS} "
LICENSE="MIT"
SLOT="0"
RDEPEND="
dev-python/clr-loader[${PYTHON_USEDEP}]
dev-python/pycparser[${PYTHON_USEDEP}]
"
BDEPEND="
${RDEPEND}
test? (
dev-python/psutil[${PYTHON_USEDEP}]
)
"
CHECKREQS_DISK_BUILD="1500M"
PATCHES=(
"${FILESDIR}/pythonnet-3.1.0-no-pyproject-parser.patch"
)
DOCS=( AUTHORS.md CHANGELOG.md README.rst )
DOC_CONTENTS="Python.NET defaults to the mono runtime, not .NET SDK's coreclr.
You can workaround this either by exporting PYTHONNET_RUNTIME=coreclr or some
Python code. Please read the documentation on
https://pythonnet.github.io/pythonnet/python.html"
EPYTEST_PLUGINS=()
EPYTEST_DESELECT=(
'tests/test_codec.py::test_sequence'
'tests/test_engine.py::test_import_module'
'tests/test_engine.py::test_run_string'
'tests/test_method.py::test_getting_method_overloads_binding_does_not_leak_memory'
'tests/test_method.py::test_params_array_overloaded_failing'
'tests/test_module.py::test_assembly_load_recursion_bug'
'tests/test_module.py::test_implicit_assembly_load'
)
distutils_enable_tests pytest
pkg_setup() {
check-reqs_pkg_setup
dotnet-pkg_pkg_setup
}
src_prepare() {
nuget_writeconfig "$(pwd)/"
distutils-r1_src_prepare
}
src_configure() {
dotnet-pkg_src_configure
distutils-r1_src_configure
}
src_install() {
distutils-r1_src_install
readme.gentoo_create_doc
}
python_test() {
local -x PYTHONNET_RUNTIME="coreclr"
epytest --runtime coreclr
}
pkg_postinst() {
readme.gentoo_print_elog
}