app-doc/ford: add Python3.11 compat.

Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
This commit is contained in:
Sergey Torokhov 2023-02-02 00:13:31 +03:00
parent d7bfdb1ff5
commit 0fe0c37ab9
No known key found for this signature in database
GPG Key ID: 6787AA71304915E3
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,22 @@
From 67b1355fea6904dc8ea540a6cfaa6164dc3a1a23 Mon Sep 17 00:00:00 2001
From: Peter Hill <peter.hill@york.ac.uk>
Date: Tue, 24 Jan 2023 10:54:10 +0000
Subject: [PATCH] Fix test for Python 3.11 (mutable default not allowed)
---
test/test_sourceform.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test_sourceform.py b/test/test_sourceform.py
index 4e6c9d3..f3a67c9 100644
--- a/test/test_sourceform.py
+++ b/test/test_sourceform.py
@@ -790,7 +790,7 @@ class FakeParent:
class FakeVariable:
name: str
vartype: str
- parent: Optional[FakeParent] = FakeParent()
+ parent: Optional[FakeParent] = field(default_factory=FakeParent)
attribs: Optional[List[str]] = field(default_factory=list)
intent: str = ""
optional: bool = False

View File

@ -0,0 +1,45 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1 toolchain-funcs
MY_PN="FORD"
DESCRIPTION="FORD, automatic documentation generator for modern Fortran programs"
HOMEPAGE="https://github.com/Fortran-FOSS-Programmers/ford"
SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
S="${WORKDIR}/${MY_PN}-${PV}"
RDEPEND="
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
>=dev-python/graphviz-0.20[${PYTHON_USEDEP}]
dev-python/jinja[${PYTHON_USEDEP}]
>=dev-python/markdown-3.4[${PYTHON_USEDEP}]
>=dev-python/markdown-include-0.7.0[${PYTHON_USEDEP}]
>=dev-python/pygments-2.12.0[${PYTHON_USEDEP}]
dev-python/python-markdown-math[${PYTHON_USEDEP}]
>=dev-python/tqdm-4.64.0[${PYTHON_USEDEP}]
>=dev-python/toposort-1.7[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}"
PATCHES=( "${FILESDIR}/${P}_fix_python3.11_tests.patch" )
DOCS=( CHANGELOG.md README.md )
distutils_enable_tests pytest
src_prepare() {
default
sed -i -e 's/"cpp /"'"$(tc-getCPP)"' /' ford/__init__.py || die # bug: 839300
}