summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Sautier <sbraz@gentoo.org>2021-08-25 00:58:59 +0200
committerLouis Sautier <sbraz@gentoo.org>2021-08-25 02:00:59 +0200
commit150b60befae35cc7c1f017a561d928391f5e35f2 (patch)
treedcc424231c1ee4c5ed639e9a603658b8a19f0316 /dev-python/mypy
parentmedia-gfx/gpicview: Stabilize 0.2.5-r2 ppc, #810097 (diff)
downloadgentoo-150b60befae35cc7c1f017a561d928391f5e35f2.tar.gz
gentoo-150b60befae35cc7c1f017a561d928391f5e35f2.tar.bz2
gentoo-150b60befae35cc7c1f017a561d928391f5e35f2.zip
dev-python/mypy: enable py3.10, explicitly inherit multiprocessing
Also remove an unused variable and comment failing tests. Signed-off-by: Louis Sautier <sbraz@gentoo.org>
Diffstat (limited to 'dev-python/mypy')
-rw-r--r--dev-python/mypy/files/mypy-0.910-py3.10-tests.patch51
-rw-r--r--dev-python/mypy/mypy-0.910.ebuild27
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 000000000000..16e85049cc1e
--- /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 3d67ec726460..c1cf48585100 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)")"
}