commit: 150b60befae35cc7c1f017a561d928391f5e35f2 Author: Louis Sautier <sbraz <AT> gentoo <DOT> org> AuthorDate: Tue Aug 24 22:58:59 2021 +0000 Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org> CommitDate: Wed Aug 25 00:00:59 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=150b60be
dev-python/mypy: enable py3.10, explicitly inherit multiprocessing Also remove an unused variable and comment failing tests. Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org> .../mypy/files/mypy-0.910-py3.10-tests.patch | 51 ++++++++++++++++++++++ dev-python/mypy/mypy-0.910.ebuild | 27 +++++++----- 2 files changed, 68 insertions(+), 10 deletions(-) diff --git a/dev-python/mypy/files/mypy-0.910-py3.10-tests.patch b/dev-python/mypy/files/mypy-0.910-py3.10-tests.patch new file mode 100644 index 00000000000..16e85049cc1 --- /dev/null +++ b/dev-python/mypy/files/mypy-0.910-py3.10-tests.patch @@ -0,0 +1,51 @@ +diff --git a/mypyc/test-data/run-misc.test b/mypyc/test-data/run-misc.test +index 431efc228..0c1a26c1b 100644 +--- a/mypyc/test-data/run-misc.test ++++ b/mypyc/test-data/run-misc.test +@@ -13,8 +13,7 @@ async def g() -> int: + async def f() -> int: + return await g() + +-loop = asyncio.get_event_loop() +-result = loop.run_until_complete(f()) ++result = asyncio.run(f()) + assert result == 1 + + [typing fixtures/typing-full.pyi] +@@ -22,8 +21,8 @@ assert result == 1 + [file driver.py] + from native import f + import asyncio +-loop = asyncio.get_event_loop() +-result = loop.run_until_complete(f()) ++ ++result = asyncio.run(f()) + assert result == 1 + + [case testMaybeUninitVar] +diff --git a/test-data/stdlib-samples/3.2/random.py b/test-data/stdlib-samples/3.2/random.py +index 7eecdfe04..82bda03f7 100644 +--- a/test-data/stdlib-samples/3.2/random.py ++++ b/test-data/stdlib-samples/3.2/random.py +@@ -41,7 +41,7 @@ from types import MethodType as _MethodType, BuiltinMethodType as _BuiltinMethod + from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil + from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin + from os import urandom as _urandom +-from collections import Set as _Set, Sequence as _Sequence ++from collections.abc import Set as _Set, Sequence as _Sequence + from hashlib import sha512 as _sha512 + + from typing import ( +diff --git a/test-data/unit/cmdline.test b/test-data/unit/cmdline.test +index 92ef7e069..87d04f3c4 100644 +--- a/test-data/unit/cmdline.test ++++ b/test-data/unit/cmdline.test +@@ -791,7 +791,7 @@ c.py:2: error: Argument 1 to "bar" has incompatible type "str"; expected "int" + [case testSrcPEP420Packages] + # cmd: mypy -p anamespace --namespace-packages + [file mypy.ini] +-\[mypy]] ++\[mypy] + mypy_path = src + [file src/setup.cfg] + [file src/anamespace/foo/__init__.py] diff --git a/dev-python/mypy/mypy-0.910.ebuild b/dev-python/mypy/mypy-0.910.ebuild index 3d67ec72646..c1cf4858510 100644 --- a/dev-python/mypy/mypy-0.910.ebuild +++ b/dev-python/mypy/mypy-0.910.ebuild @@ -3,15 +3,12 @@ EAPI=7 -PYTHON_COMPAT=( python3_{8..9} ) -inherit distutils-r1 +PYTHON_COMPAT=( python3_{8..10} ) +inherit distutils-r1 multiprocessing DESCRIPTION="Optional static typing for Python" HOMEPAGE="http://www.mypy-lang.org/" -TYPESHED_COMMIT="add4d92f050fb11d3901c6f0ee579a122d4a7a98" -SRC_URI=" - https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz -" +SRC_URI="https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" LICENSE="MIT" SLOT="0" @@ -41,18 +38,28 @@ BDEPEND=" distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme distutils_enable_tests pytest +PATCHES=( + # https://github.com/python/mypy/pull/11017 + "${FILESDIR}/${P}-py3.10-tests.patch" +) + # this requires packaging a lot of type stubs export MYPY_USE_MYPYC=0 python_test() { - local deselect=( - # TODO + local EPYTEST_DESELECT=( + # Fails with pytest-xdist 2.3.0 + # https://github.com/python/mypy/issues/11019 mypy/test/teststubtest.py ) + [[ "${EPYTHON}" == "python3.10" ]] && EPYTEST_DESELECT+=( + # https://github.com/python/mypy/issues/11018 + mypyc/test/test_commandline.py::TestCommandLine::testErrorOutput + ) + # Some mypy/test/testcmdline.py::PythonCmdlineSuite tests # fail with high COLUMNS values local -x COLUMNS=80 - epytest ${deselect[@]/#/--deselect } \ - -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" + epytest -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" }