public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/
@ 2020-10-07 16:31 Louis Sautier
  0 siblings, 0 replies; 7+ messages in thread
From: Louis Sautier @ 2020-10-07 16:31 UTC (permalink / raw
  To: gentoo-commits

commit:     86c0328e98c5f0e0bf8e8db163b03953c6d92467
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  7 10:42:37 2020 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Wed Oct  7 16:30:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86c0328e

dev-python/mypy: bump to 0.782, add Py3.9 support, fix tests

Also:
* Fetch the package from PyPI, removes the need to get typeshed
  separately and simplifies pre-build steps.
* Run tests directly with pytest, allowing us to remove code checkers from
  dependencies.
* Use distutils_enable_sphinx to build the doc.
* Remove live ebuild logic as no such ebuild is present.
* Use EAPI 7.

Closes: https://bugs.gentoo.org/739694
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 dev-python/mypy/Manifest                          |   1 +
 dev-python/mypy/files/mypy-0.782-conftest.patch   |  24 +++
 dev-python/mypy/files/mypy-0.782-py39-fixes.patch | 138 ++++++++++++++
 dev-python/mypy/files/mypy-0.782-pytest-6.patch   | 210 ++++++++++++++++++++++
 dev-python/mypy/mypy-0.782.ebuild                 |  58 ++++++
 5 files changed, 431 insertions(+)

diff --git a/dev-python/mypy/Manifest b/dev-python/mypy/Manifest
index 523c9a998a2..767904fcde5 100644
--- a/dev-python/mypy/Manifest
+++ b/dev-python/mypy/Manifest
@@ -1,2 +1,3 @@
 DIST mypy-0.781.tar.gz 2056785 BLAKE2B aa95d71400d5d46223a141adae5a8d797d2f076d3b6b48a7c09db6f7f3f2193d571368759f0ca307331d8e8c241b0322e758716a10fabccca3aaa6b733a63347 SHA512 dd3173115720510b278d15f5083a57fdb41582dfcaaf16e587116e41e87d608f4e226b61a978f4b41ef6b5ec6d3d9279facd65c0a74888b367171dcbe25550f2
+DIST mypy-0.782.tar.gz 2529814 BLAKE2B c75771fb40524c2c8675236eaaddd6e39d13b4fd4f6f15f279b2e0be75eb0630987cb90f31bd7c65c4a322de4915d3a260e8f6f375b49157fea4b6362316f333 SHA512 f94433f79ea76b53ebb70589ca04ba3f39847050f73cf6deac00a3db13d742613a8ecb1a11fb84a878458025c6776b236b074e93e577c1b597e31d1300974767
 DIST mypy-typeshed-0.781-e199c2e.tar.gz 541588 BLAKE2B f663d0feccffb315efd1b6e3ebc54bbe3cf4c7873c240ed54c7be1042807e2213326db8756b5a540fd9bf5ae95a2c0850e8cb35ae2e849ec3e9a628367fabe72 SHA512 57f3159d909799838779c04ccc6541322c27c01efb026c26a145676fa75076f64b8cd3e99f7488501582c743e1102cad59320512d52d4a058d8731c54c0705cd

diff --git a/dev-python/mypy/files/mypy-0.782-conftest.patch b/dev-python/mypy/files/mypy-0.782-conftest.patch
new file mode 100644
index 00000000000..08da1b1b690
--- /dev/null
+++ b/dev-python/mypy/files/mypy-0.782-conftest.patch
@@ -0,0 +1,24 @@
+diff --git a/conftest.py b/conftest.py
+new file mode 100644
+index 00000000..83a6689f
+--- /dev/null
++++ b/conftest.py
+@@ -0,0 +1,18 @@
++import os.path
++
++pytest_plugins = [
++    'mypy.test.data',
++]
++
++
++def pytest_configure(config):
++    mypy_source_root = os.path.dirname(os.path.abspath(__file__))
++    if os.getcwd() != mypy_source_root:
++        os.chdir(mypy_source_root)
++
++
++# This function name is special to pytest.  See
++# http://doc.pytest.org/en/latest/writing_plugins.html#initialization-command-line-and-configuration-hooks
++def pytest_addoption(parser) -> None:
++    parser.addoption('--bench', action='store_true', default=False,
++                     help='Enable the benchmark test runs')

diff --git a/dev-python/mypy/files/mypy-0.782-py39-fixes.patch b/dev-python/mypy/files/mypy-0.782-py39-fixes.patch
new file mode 100644
index 00000000000..16c12daecae
--- /dev/null
+++ b/dev-python/mypy/files/mypy-0.782-py39-fixes.patch
@@ -0,0 +1,138 @@
+From 13ae58ffe8bedb7da9f4c657297f0d61e681d671 Mon Sep 17 00:00:00 2001
+From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
+Date: Sun, 30 Aug 2020 18:11:57 -0700
+Subject: [PATCH] mypy: get CI green for py39 (#9376)
+
+Due to Python 3.9's new parser, this has a different (and better) error
+message on Python 3.9.
+
+This is effectively a test of typed_ast / ast, so I don't think it
+matters too much. I'm happy to alternatively just get rid of the test
+altogether, or if people feel strongly, come up with a way to run the
+test when run with older Pythons.
+
+Co-authored-by: hauntsaninja <>
+---
+ .travis.yml                        | 3 ---
+ mypy/test/testcheck.py             | 2 ++
+ test-data/unit/check-kwargs.test   | 7 -------
+ test-data/unit/check-python39.test | 9 +++++++++
+ 4 files changed, 11 insertions(+), 10 deletions(-)
+ create mode 100644 test-data/unit/check-python39.test
+
+diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py
+index 49a85861b6..39a35c7280 100644
+--- a/mypy/test/testcheck.py
++++ b/mypy/test/testcheck.py
+@@ -94,6 +94,8 @@
+ # Tests that use Python 3.8-only AST features (like expression-scoped ignores):
+ if sys.version_info >= (3, 8):
+     typecheck_files.append('check-python38.test')
++if sys.version_info >= (3, 9):
++    typecheck_files.append('check-python39.test')
+ 
+ # Special tests for platforms with case-insensitive filesystems.
+ if sys.platform in ('darwin', 'win32'):
+diff --git a/test-data/unit/check-kwargs.test b/test-data/unit/check-kwargs.test
+index 1dd450caae..a587be3e06 100644
+--- a/test-data/unit/check-kwargs.test
++++ b/test-data/unit/check-kwargs.test
+@@ -53,13 +53,6 @@ f(b=[], a=A())
+ class A: pass
+ [builtins fixtures/list.pyi]
+ 
+-[case testGivingSameKeywordArgumentTwice]
+-import typing
+-def f(a: 'A', b: 'B') -> None: pass
+-f(a=A(), b=B(), a=A()) # E: keyword argument repeated
+-class A: pass
+-class B: pass
+-
+ [case testGivingArgumentAsPositionalAndKeywordArg]
+ import typing
+ def f(a: 'A', b: 'B' = None) -> None: pass
+diff --git a/test-data/unit/check-python39.test b/test-data/unit/check-python39.test
+new file mode 100644
+index 0000000000..0e9ec683ae
+--- /dev/null
++++ b/test-data/unit/check-python39.test
+@@ -0,0 +1,9 @@
++[case testGivingSameKeywordArgumentTwice]
++# This test was originally in check-kwargs.test
++# Python 3.9's new parser started producing a different error message here. Since this isn't the
++# most important test, to deal with this we'll only run this test with Python 3.9 and later.
++import typing
++def f(a: 'A', b: 'B') -> None: pass
++f(a=A(), b=B(), a=A()) # E: "f" gets multiple values for keyword argument "a"
++class A: pass
++class B: pass
+From da4430119255ac9205c96d54deb2e2ebed0ce8ce Mon Sep 17 00:00:00 2001
+From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
+Date: Fri, 31 Jul 2020 09:58:15 -0700
+Subject: [PATCH] mypyc: ignore deprecation (#9107)
+
+PyUnicode_AsUnicodeAndSize has been deprecated since 3.3
+
+Python 3.9 has compiler warnings for this deprecated function, and we
+compile with Werror, causing Python 3.9 builds to fail.
+
+I've just copied over the relevant deprecation ignoring code from the
+original getargs.c (including the TODO, but I can remove that)
+
+Co-authored-by: hauntsaninja <>
+---
+ mypyc/lib-rt/getargs.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/mypyc/lib-rt/getargs.c b/mypyc/lib-rt/getargs.c
+index 32b387c8ab..e6b1a0c937 100644
+--- a/mypyc/lib-rt/getargs.c
++++ b/mypyc/lib-rt/getargs.c
+@@ -18,6 +18,29 @@
+  *    and is responsible for decrefing them.
+  */
+ 
++// These macro definitions are copied from pyport.h in Python 3.9 and later
++// https://bugs.python.org/issue19569
++#if defined(__clang__)
++#define _Py_COMP_DIAG_PUSH _Pragma("clang diagnostic push")
++#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
++    _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
++#define _Py_COMP_DIAG_POP _Pragma("clang diagnostic pop")
++#elif defined(__GNUC__) \
++    && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
++#define _Py_COMP_DIAG_PUSH _Pragma("GCC diagnostic push")
++#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
++    _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
++#define _Py_COMP_DIAG_POP _Pragma("GCC diagnostic pop")
++#elif defined(_MSC_VER)
++#define _Py_COMP_DIAG_PUSH __pragma(warning(push))
++#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS __pragma(warning(disable: 4996))
++#define _Py_COMP_DIAG_POP __pragma(warning(pop))
++#else
++#define _Py_COMP_DIAG_PUSH
++#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS
++#define _Py_COMP_DIAG_POP
++#endif
++
+ #include "Python.h"
+ #include "pythonsupport.h"
+ 
+@@ -756,6 +779,9 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
+     case 'u': /* raw unicode buffer (Py_UNICODE *) */
+     case 'Z': /* raw unicode buffer or None */
+     {
++        // TODO: Raise DeprecationWarning
++_Py_COMP_DIAG_PUSH
++_Py_COMP_DIAG_IGNORE_DEPR_DECLS
+         Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
+ 
+         if (*format == '#') {
+@@ -795,6 +821,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
+                                   arg, msgbuf, bufsize);
+         }
+         break;
++_Py_COMP_DIAG_POP
+     }
+ 
+     case 'e': {/* encoded string */

diff --git a/dev-python/mypy/files/mypy-0.782-pytest-6.patch b/dev-python/mypy/files/mypy-0.782-pytest-6.patch
new file mode 100644
index 00000000000..0252d113880
--- /dev/null
+++ b/dev-python/mypy/files/mypy-0.782-pytest-6.patch
@@ -0,0 +1,210 @@
+From 3e77959eacf3d445a0cb4db5a4bc6dcf606fc040 Mon Sep 17 00:00:00 2001
+From: Lawrence Chan <llchan@users.noreply.github.com>
+Date: Tue, 4 Aug 2020 18:14:55 -0500
+Subject: [PATCH] Use pytest Node.from_parent if available (#9263)
+
+* Use pytest Node.from_parent if available
+
+* Use pytest Node.from_parent unconditionally (requires pytest 5.4+)
+
+* Bump pytest test requirements
+
+* Require pytest 6.0 and remove unused type ignores
+
+* Make flake8 happy
+---
+ mypy/test/data.py            | 37 ++++++++++++++++++++++--------------
+ mypy/test/helpers.py         |  2 +-
+ mypy/test/testfinegrained.py |  2 +-
+ mypy/test/testipc.py         |  2 +-
+ mypy/test/testparse.py       |  2 +-
+ mypy/test/testpep561.py      |  2 +-
+ mypy/test/testpythoneval.py  |  2 +-
+ mypyc/test/testutil.py       |  2 +-
+ pytest.ini                   |  3 +--
+ test-requirements.txt        |  9 ++++-----
+ 10 files changed, 35 insertions(+), 28 deletions(-)
+
+diff --git a/mypy/test/data.py b/mypy/test/data.py
+index 5484fd99e9..a4f2d798b1 100644
+--- a/mypy/test/data.py
++++ b/mypy/test/data.py
+@@ -9,7 +9,7 @@
+ from abc import abstractmethod
+ import sys
+ 
+-import pytest  # type: ignore  # no pytest in typeshed
++import pytest
+ from typing import List, Tuple, Set, Optional, Iterator, Any, Dict, NamedTuple, Union
+ 
+ from mypy.test.config import test_data_prefix, test_temp_dir, PREFIX
+@@ -160,9 +160,12 @@ def parse_test_case(case: 'DataDrivenTestCase') -> None:
+     case.expected_fine_grained_targets = targets
+ 
+ 
+-class DataDrivenTestCase(pytest.Item):  # type: ignore  # inheriting from Any
++class DataDrivenTestCase(pytest.Item):
+     """Holds parsed data-driven test cases, and handles directory setup and teardown."""
+ 
++    # Override parent member type
++    parent = None  # type: DataSuiteCollector
++
+     input = None  # type: List[str]
+     output = None  # type: List[str]  # Output for the first pass
+     output2 = None  # type: Dict[int, List[str]]  # Output for runs 2+, indexed by run number
+@@ -266,7 +269,7 @@ def repr_failure(self, excinfo: Any, style: Optional[Any] = None) -> str:
+             # call exit() and they already print out a stack trace.
+             excrepr = excinfo.exconly()
+         else:
+-            self.parent._prunetraceback(excinfo)
++            self.parent._prunetraceback(excinfo)  # type: ignore[no-untyped-call]
+             excrepr = excinfo.getrepr(style='short')
+ 
+         return "data: {}:{}:\n{}".format(self.file, self.line, excrepr)
+@@ -510,7 +513,9 @@ def pytest_pycollect_makeitem(collector: Any, name: str,
+             # Non-None result means this obj is a test case.
+             # The collect method of the returned DataSuiteCollector instance will be called later,
+             # with self.obj being obj.
+-            return DataSuiteCollector(name, parent=collector)
++            return DataSuiteCollector.from_parent(  # type: ignore[no-untyped-call]
++                parent=collector, name=name
++            )
+     return None
+ 
+ 
+@@ -535,19 +540,23 @@ def split_test_cases(parent: 'DataSuiteCollector', suite: 'DataSuite',
+     for i in range(1, len(cases), 6):
+         name, writescache, only_when, platform_flag, skip, data = cases[i:i + 6]
+         platform = platform_flag[1:] if platform_flag else None
+-        yield DataDrivenTestCase(parent, suite, file,
+-                                 name=add_test_name_suffix(name, suite.test_name_suffix),
+-                                 writescache=bool(writescache),
+-                                 only_when=only_when,
+-                                 platform=platform,
+-                                 skip=bool(skip),
+-                                 data=data,
+-                                 line=line_no)
++        yield DataDrivenTestCase.from_parent(
++            parent=parent,
++            suite=suite,
++            file=file,
++            name=add_test_name_suffix(name, suite.test_name_suffix),
++            writescache=bool(writescache),
++            only_when=only_when,
++            platform=platform,
++            skip=bool(skip),
++            data=data,
++            line=line_no,
++        )
+         line_no += data.count('\n') + 1
+ 
+ 
+-class DataSuiteCollector(pytest.Class):  # type: ignore  # inheriting from Any
+-    def collect(self) -> Iterator[pytest.Item]:  # type: ignore
++class DataSuiteCollector(pytest.Class):
++    def collect(self) -> Iterator[pytest.Item]:
+         """Called by pytest on each of the object returned from pytest_pycollect_makeitem"""
+ 
+         # obj is the object for which pytest_pycollect_makeitem returned self.
+diff --git a/mypy/test/helpers.py b/mypy/test/helpers.py
+index 46c01114c4..91c5ff6ab2 100644
+--- a/mypy/test/helpers.py
++++ b/mypy/test/helpers.py
+@@ -10,7 +10,7 @@
+ from mypy import defaults
+ import mypy.api as api
+ 
+-import pytest  # type: ignore  # no pytest in typeshed
++import pytest
+ 
+ # Exporting Suite as alias to TestCase for backwards compatibility
+ # TODO: avoid aliasing - import and subclass TestCase directly
+diff --git a/mypy/test/testfinegrained.py b/mypy/test/testfinegrained.py
+index 596391da44..d4ed18cab0 100644
+--- a/mypy/test/testfinegrained.py
++++ b/mypy/test/testfinegrained.py
+@@ -35,7 +35,7 @@
+ from mypy.config_parser import parse_config_file
+ from mypy.find_sources import create_source_list
+ 
+-import pytest  # type: ignore  # no pytest in typeshed
++import pytest
+ 
+ # Set to True to perform (somewhat expensive) checks for duplicate AST nodes after merge
+ CHECK_CONSISTENCY = False
+diff --git a/mypy/test/testipc.py b/mypy/test/testipc.py
+index 1d4829d561..7dd829a590 100644
+--- a/mypy/test/testipc.py
++++ b/mypy/test/testipc.py
+@@ -3,7 +3,7 @@
+ 
+ from mypy.ipc import IPCClient, IPCServer
+ 
+-import pytest  # type: ignore
++import pytest
+ import sys
+ import time
+ 
+diff --git a/mypy/test/testparse.py b/mypy/test/testparse.py
+index e990a403a5..e9ff6839bc 100644
+--- a/mypy/test/testparse.py
++++ b/mypy/test/testparse.py
+@@ -2,7 +2,7 @@
+ 
+ import sys
+ 
+-from pytest import skip  # type: ignore[import]
++from pytest import skip
+ 
+ from mypy import defaults
+ from mypy.test.helpers import assert_string_arrays_equal, parse_options
+diff --git a/mypy/test/testpep561.py b/mypy/test/testpep561.py
+index a8eabd7702..aadf01ae5f 100644
+--- a/mypy/test/testpep561.py
++++ b/mypy/test/testpep561.py
+@@ -1,6 +1,6 @@
+ from contextlib import contextmanager
+ import os
+-import pytest  # type: ignore
++import pytest
+ import re
+ import subprocess
+ from subprocess import PIPE
+diff --git a/mypy/test/testpythoneval.py b/mypy/test/testpythoneval.py
+index 7586a3854e..e7e9f16183 100644
+--- a/mypy/test/testpythoneval.py
++++ b/mypy/test/testpythoneval.py
+@@ -18,7 +18,7 @@
+ import sys
+ from tempfile import TemporaryDirectory
+ 
+-import pytest  # type: ignore  # no pytest in typeshed
++import pytest
+ 
+ from typing import List
+ 
+diff --git a/mypyc/test/testutil.py b/mypyc/test/testutil.py
+index 18ab39a103..c1ce8626ba 100644
+--- a/mypyc/test/testutil.py
++++ b/mypyc/test/testutil.py
+@@ -7,7 +7,7 @@
+ import shutil
+ from typing import List, Callable, Iterator, Optional, Tuple
+ 
+-import pytest  # type: ignore[import]
++import pytest
+ 
+ from mypy import build
+ from mypy.errors import CompileError
+diff --git a/pytest.ini b/pytest.ini
+index 81586a2370..ed76809091 100644
+--- a/pytest.ini
++++ b/pytest.ini
+@@ -1,6 +1,5 @@
+ [pytest]
+-# testpaths is new in 2.8
+-minversion = 2.8
++minversion = 6.0.0
+ 
+ testpaths = mypy/test mypyc/test
+ 

diff --git a/dev-python/mypy/mypy-0.782.ebuild b/dev-python/mypy/mypy-0.782.ebuild
new file mode 100644
index 00000000000..f6931385e1e
--- /dev/null
+++ b/dev-python/mypy/mypy-0.782.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+
+inherit distutils-r1
+
+DESCRIPTION="Optional static typing for Python"
+HOMEPAGE="http://www.mypy-lang.org/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+# stubgen collides with this package: https://bugs.gentoo.org/585594
+RDEPEND="
+	!dev-util/stubgen
+	>=dev-python/psutil-4[${PYTHON_USEDEP}]
+	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
+	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
+	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
+	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
+	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
+"
+BDEPEND="
+	test? (
+			>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
+			>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
+			>=dev-python/pytest-6.0.0[${PYTHON_USEDEP}]
+			>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
+			>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
+			>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
+	)
+"
+
+PATCHES=(
+	# The first two patches are backports from upstream commits
+	# They should be removed during the next bump
+	"${FILESDIR}/${P}-py39-fixes.patch"
+	"${FILESDIR}/${P}-pytest-6.patch"
+	# Needed to collect all tests
+	# https://github.com/python/mypy/pull/9543
+	"${FILESDIR}/${P}-conftest.patch"
+)
+
+distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
+distutils_enable_tests pytest
+
+python_prepare_all() {
+	# https://github.com/python/mypy/commit/2f291f2e312dd3bf2c05c45da0b032b240bfd7ab
+	# Avoid a big patch by deleting the file manually
+	rm test-data/samples/crawl.py || die
+	distutils-r1_python_prepare_all
+}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/
@ 2020-11-18 17:43 Louis Sautier
  0 siblings, 0 replies; 7+ messages in thread
From: Louis Sautier @ 2020-11-18 17:43 UTC (permalink / raw
  To: gentoo-commits

commit:     43e7824af28e565bef9186901bd015049aa7261a
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 18 17:38:03 2020 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Wed Nov 18 17:42:27 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43e7824a

dev-python/mypy: bump to 0.790

Closes: https://bugs.gentoo.org/754846
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 dev-python/mypy/Manifest                          |   2 +
 dev-python/mypy/files/mypy-0.790-py39-fixes.patch | 161 ++++++++++++++++++++++
 dev-python/mypy/mypy-0.790.ebuild                 |  76 ++++++++++
 3 files changed, 239 insertions(+)

diff --git a/dev-python/mypy/Manifest b/dev-python/mypy/Manifest
index c589ce5c1b6..75ba045782b 100644
--- a/dev-python/mypy/Manifest
+++ b/dev-python/mypy/Manifest
@@ -1 +1,3 @@
 DIST mypy-0.782.tar.gz 2529814 BLAKE2B c75771fb40524c2c8675236eaaddd6e39d13b4fd4f6f15f279b2e0be75eb0630987cb90f31bd7c65c4a322de4915d3a260e8f6f375b49157fea4b6362316f333 SHA512 f94433f79ea76b53ebb70589ca04ba3f39847050f73cf6deac00a3db13d742613a8ecb1a11fb84a878458025c6776b236b074e93e577c1b597e31d1300974767
+DIST mypy-0.790.tar.gz 2082487 BLAKE2B f8efcb701b4b7533306948721968c9a01ab6c6e56ec99fe6c36e35aca50b52f29f518aee2268a628539a372b8024094ef2d4d87da580b4dd667f41133351596e SHA512 be670456bb64cd197bb6a73832b7e0fd6439ae4af128212328a41cd93d9f644a82e79ffb05bf4695e99bd9788244a24916bf765cf30a6f162cf3b471f45c25b8
+DIST mypy-typeshed-5be9c91.tar.gz 583006 BLAKE2B 08ab2b6d479ccc66493524482051e825c65c0a94ea5cac8e56a8ea1dca85eda6104e4ed3188b7d5ce1ea99058019d66a21a7e270e3ad9df694be67ea1e6a7ce9 SHA512 2912bcf66e0f550941eb9c1f34979644857448a4bec478cfc0d662e9a401ade93ccfb2f57b5348504b4d6f0f23e576da609167f1ec3a0861414fc9c7dea80243

diff --git a/dev-python/mypy/files/mypy-0.790-py39-fixes.patch b/dev-python/mypy/files/mypy-0.790-py39-fixes.patch
new file mode 100644
index 00000000000..a7a581ea896
--- /dev/null
+++ b/dev-python/mypy/files/mypy-0.790-py39-fixes.patch
@@ -0,0 +1,161 @@
+From 13ae58ffe8bedb7da9f4c657297f0d61e681d671 Mon Sep 17 00:00:00 2001
+From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
+Date: Sun, 30 Aug 2020 18:11:57 -0700
+Subject: [PATCH] mypy: get CI green for py39 (#9376)
+
+Due to Python 3.9's new parser, this has a different (and better) error
+message on Python 3.9.
+
+This is effectively a test of typed_ast / ast, so I don't think it
+matters too much. I'm happy to alternatively just get rid of the test
+altogether, or if people feel strongly, come up with a way to run the
+test when run with older Pythons.
+
+Co-authored-by: hauntsaninja <>
+---
+ .travis.yml                        | 3 ---
+ mypy/test/testcheck.py             | 2 ++
+ test-data/unit/check-kwargs.test   | 7 -------
+ test-data/unit/check-python39.test | 9 +++++++++
+ 4 files changed, 11 insertions(+), 10 deletions(-)
+ create mode 100644 test-data/unit/check-python39.test
+
+diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py
+index 49a85861b6..39a35c7280 100644
+--- a/mypy/test/testcheck.py
++++ b/mypy/test/testcheck.py
+@@ -94,6 +94,8 @@
+ # Tests that use Python 3.8-only AST features (like expression-scoped ignores):
+ if sys.version_info >= (3, 8):
+     typecheck_files.append('check-python38.test')
++if sys.version_info >= (3, 9):
++    typecheck_files.append('check-python39.test')
+ 
+ # Special tests for platforms with case-insensitive filesystems.
+ if sys.platform in ('darwin', 'win32'):
+diff --git a/test-data/unit/check-kwargs.test b/test-data/unit/check-kwargs.test
+index 1dd450caae..a587be3e06 100644
+--- a/test-data/unit/check-kwargs.test
++++ b/test-data/unit/check-kwargs.test
+@@ -53,13 +53,6 @@ f(b=[], a=A())
+ class A: pass
+ [builtins fixtures/list.pyi]
+ 
+-[case testGivingSameKeywordArgumentTwice]
+-import typing
+-def f(a: 'A', b: 'B') -> None: pass
+-f(a=A(), b=B(), a=A()) # E: keyword argument repeated
+-class A: pass
+-class B: pass
+-
+ [case testGivingArgumentAsPositionalAndKeywordArg]
+ import typing
+ def f(a: 'A', b: 'B' = None) -> None: pass
+diff --git a/test-data/unit/check-python39.test b/test-data/unit/check-python39.test
+new file mode 100644
+index 0000000000..0e9ec683ae
+--- /dev/null
++++ b/test-data/unit/check-python39.test
+@@ -0,0 +1,9 @@
++[case testGivingSameKeywordArgumentTwice]
++# This test was originally in check-kwargs.test
++# Python 3.9's new parser started producing a different error message here. Since this isn't the
++# most important test, to deal with this we'll only run this test with Python 3.9 and later.
++import typing
++def f(a: 'A', b: 'B') -> None: pass
++f(a=A(), b=B(), a=A()) # E: "f" gets multiple values for keyword argument "a"
++class A: pass
++class B: pass
+From ab1bd98cc8a6415398121a47c687ede6f4cca4fd Mon Sep 17 00:00:00 2001
+From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
+Date: Thu, 8 Oct 2020 11:18:18 -0700
+Subject: [PATCH] py39: fix mypyc complaint (#9552)
+
+I was trying to build wheels for Python 3.9 as part of #9536, but ran
+into this issue. You'll notice a couple hundred lines up msullivan
+points out that mypyc can't handle conditional method definition, so
+that's not an option here.
+
+Co-authored-by: hauntsaninja <>
+---
+ mypy/fastparse.py | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/mypy/fastparse.py b/mypy/fastparse.py
+index 2dafbf4e14..0b72214100 100644
+--- a/mypy/fastparse.py
++++ b/mypy/fastparse.py
+@@ -1257,11 +1257,13 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr:
+ 
+     # ExtSlice(slice* dims)
+     def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
+-        return TupleExpr(self.translate_expr_list(n.dims))
++        # cast for mypyc's benefit on Python 3.9
++        return TupleExpr(self.translate_expr_list(cast(Any, n.dims)))
+ 
+     # Index(expr value)
+     def visit_Index(self, n: Index) -> Node:
+-        return self.visit(n.value)
++        # cast for mypyc's benefit on Python 3.9
++        return self.visit(cast(Any, n.value))
+ 
+ 
+ class TypeConverter:
+From ffed88fb95fcbfdd1363f0f719bd3e13f8fe20e9 Mon Sep 17 00:00:00 2001
+From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
+Date: Thu, 8 Oct 2020 15:00:42 -0700
+Subject: [PATCH] py39: fix mypyc complaints part 2 (#9562)
+
+Necessary because I previously didn't actually fix mypyc's complaint +
+mypyc has more complaints.
+The sys.version_info aliasing works around us hitting
+https://github.com/python/mypy/blob/08f207ef4a09f56d710d63775771ae921c41d4bc/mypyc/irbuild/expression.py#L44
+
+Co-authored-by: hauntsaninja <>
+---
+ mypy/fastparse.py | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/mypy/fastparse.py b/mypy/fastparse.py
+index 0b72214100..3319cd6489 100644
+--- a/mypy/fastparse.py
++++ b/mypy/fastparse.py
+@@ -169,7 +169,9 @@ def parse(source: Union[str, bytes],
+         tree.path = fnam
+         tree.is_stub = is_stub_file
+     except SyntaxError as e:
+-        if sys.version_info < (3, 9) and e.filename == "<fstring>":
++        # alias to please mypyc
++        is_py38_or_earlier = sys.version_info < (3, 9)
++        if is_py38_or_earlier and e.filename == "<fstring>":
+             # In Python 3.8 and earlier, syntax errors in f-strings have lineno relative to the
+             # start of the f-string. This would be misleading, as mypy will report the error as the
+             # lineno within the file.
+@@ -1210,9 +1212,11 @@ def visit_Attribute(self, n: Attribute) -> Union[MemberExpr, SuperExpr]:
+     def visit_Subscript(self, n: ast3.Subscript) -> IndexExpr:
+         e = IndexExpr(self.visit(n.value), self.visit(n.slice))
+         self.set_line(e, n)
++        # alias to please mypyc
++        is_py38_or_earlier = sys.version_info < (3, 9)
+         if (
+             isinstance(n.slice, ast3.Slice) or
+-            (sys.version_info < (3, 9) and isinstance(n.slice, ast3.ExtSlice))
++            (is_py38_or_earlier and isinstance(n.slice, ast3.ExtSlice))
+         ):
+             # Before Python 3.9, Slice has no line/column in the raw ast. To avoid incompatibility
+             # visit_Slice doesn't set_line, even in Python 3.9 on.
+@@ -1258,12 +1262,12 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr:
+     # ExtSlice(slice* dims)
+     def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
+         # cast for mypyc's benefit on Python 3.9
+-        return TupleExpr(self.translate_expr_list(cast(Any, n.dims)))
++        return TupleExpr(self.translate_expr_list(cast(Any, n).dims))
+ 
+     # Index(expr value)
+     def visit_Index(self, n: Index) -> Node:
+         # cast for mypyc's benefit on Python 3.9
+-        return self.visit(cast(Any, n.value))
++        return self.visit(cast(Any, n).value)
+ 
+ 
+ class TypeConverter:

diff --git a/dev-python/mypy/mypy-0.790.ebuild b/dev-python/mypy/mypy-0.790.ebuild
new file mode 100644
index 00000000000..f2b26d130ce
--- /dev/null
+++ b/dev-python/mypy/mypy-0.790.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+
+inherit distutils-r1
+
+DESCRIPTION="Optional static typing for Python"
+HOMEPAGE="http://www.mypy-lang.org/"
+# One module is missing from the PyPI tarball
+# https://github.com/python/mypy/pull/9587
+# conftest.py is missing at the moment
+# https://github.com/python/mypy/pull/9543
+TYPESHED_COMMIT="5be9c91"
+SRC_URI="
+	https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+	https://api.github.com/repos/python/typeshed/tarball/${TYPESHED_COMMIT} -> mypy-typeshed-${TYPESHED_COMMIT}.tar.gz
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ia64 ~x86"
+
+# stubgen collides with this package: https://bugs.gentoo.org/585594
+RDEPEND="
+	!dev-util/stubgen
+	>=dev-python/psutil-4[${PYTHON_USEDEP}]
+	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
+	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
+	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
+	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
+	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
+"
+BDEPEND="
+	test? (
+		>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
+		>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
+		>=dev-python/pytest-6.0.0[${PYTHON_USEDEP}]
+		>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
+		>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
+		>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
+	)
+"
+
+PATCHES=(
+	# https://github.com/python/mypy/commit/13ae58ffe8bedb7da9f4c657297f0d61e681d671
+	# https://github.com/python/mypy/commit/ab1bd98cc8a6415398121a47c687ede6f4cca4fd
+	# https://github.com/python/mypy/commit/ffed88fb95fcbfdd1363f0f719bd3e13f8fe20e9
+	"${FILESDIR}/${P}-py39-fixes.patch"
+)
+
+distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
+distutils_enable_tests pytest
+
+src_unpack() {
+	unpack ${A}
+	rmdir "${S}/mypy/typeshed" || die
+	mv "${WORKDIR}/python-typeshed-${TYPESHED_COMMIT}" "${S}/mypy/typeshed"
+}
+
+python_prepare_all() {
+	# https://github.com/python/mypy/commit/2f291f2e312dd3bf2c05c45da0b032b240bfd7ab
+	# Avoid a big patch by deleting the file manually
+	rm test-data/samples/crawl.py || die
+	distutils-r1_python_prepare_all
+}
+
+python_test() {
+	# Some mypy/test/testcmdline.py::PythonCmdlineSuite tests
+	# fail with high COLUMNS values
+	local -x COLUMNS=80
+	pytest -vv || die "Tests fail with ${EPYTHON}"
+}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/
@ 2021-02-26 14:35 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2021-02-26 14:35 UTC (permalink / raw
  To: gentoo-commits

commit:     2d14e70d597d62cdf758f83ed19fc5126179350a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 26 14:26:21 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Feb 26 14:33:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d14e70d

dev-python/mypy: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/mypy/Manifest                          |   2 -
 dev-python/mypy/files/mypy-0.790-py39-fixes.patch | 161 ----------------------
 dev-python/mypy/mypy-0.790.ebuild                 |  76 ----------
 3 files changed, 239 deletions(-)

diff --git a/dev-python/mypy/Manifest b/dev-python/mypy/Manifest
index aa88d3040ca..161f8763256 100644
--- a/dev-python/mypy/Manifest
+++ b/dev-python/mypy/Manifest
@@ -1,6 +1,4 @@
-DIST mypy-0.790.tar.gz 2082487 BLAKE2B f8efcb701b4b7533306948721968c9a01ab6c6e56ec99fe6c36e35aca50b52f29f518aee2268a628539a372b8024094ef2d4d87da580b4dd667f41133351596e SHA512 be670456bb64cd197bb6a73832b7e0fd6439ae4af128212328a41cd93d9f644a82e79ffb05bf4695e99bd9788244a24916bf765cf30a6f162cf3b471f45c25b8
 DIST mypy-0.800.tar.gz 2119165 BLAKE2B 48ead6c893f7055f4b1c0167f61e07b647a15f3a13688e1a93f11ebfdfe70ec3ccba3678bb5cf0e61af8dacfa64c241e5b79f28af55e8bfc5ce0a81c409deca9 SHA512 e267fa288f9c538e5c1d0a115b353aabbfbbd46a372dbaefbf43abeae1e6b88cc1b3e0bb301881f20e20b4e69eeeff4be22cf330bf58eaad09b4ea152ab02c12
 DIST mypy-0.812.tar.gz 2122474 BLAKE2B 3bfbfe3010798d49bcf00aa1d926ffa8a54be50fb2e88f4ffc3cde3edba80a9b74853de17126394dc1806c07b740b5f8e7775f2fe4b2312e0a85134b446a690b SHA512 ee89f56a7a01214540f9b727f153a075a097b161b7f654d926d1080ae540ec68303629a4fe691fcb53d37c3eb08924bf01d22cdf1c3761b414a3bc40af3363e6
-DIST mypy-typeshed-5be9c91.tar.gz 583006 BLAKE2B 08ab2b6d479ccc66493524482051e825c65c0a94ea5cac8e56a8ea1dca85eda6104e4ed3188b7d5ce1ea99058019d66a21a7e270e3ad9df694be67ea1e6a7ce9 SHA512 2912bcf66e0f550941eb9c1f34979644857448a4bec478cfc0d662e9a401ade93ccfb2f57b5348504b4d6f0f23e576da609167f1ec3a0861414fc9c7dea80243
 DIST typeshed-8cad322a8ccf4b104cafbac2c798413edaa4f327.tar.gz 600618 BLAKE2B acc4397fba21db1bcc7b3ca0922fb561d19161579062e1ee506cadfbbb1de952e36fab6ce552bdca932757274c882a90a948e9dfc257905d7f2e90de9f22bf55 SHA512 728808a568074310bd700a6fe3d667ced01a36f4a6ed2fa6df9d7a784e3167e2c96f7b91dcca1f99d50e325165f3ddea6bbafeab2469a9105c1cb217f16beded
 DIST typeshed-add4d92f050fb11d3901c6f0ee579a122d4a7a98.tar.gz 600241 BLAKE2B 2bf91ba7bfa2ed3e2369d70ab76ce152e00f321e79f36ef7c264d477e350579eaade222e8347b4105fb93b847d944ce0aa182466ce636649098a2df69c09ee5d SHA512 8497ee9719e162f84556407296d383e0b7e695cf6cd60bbf7f34c1d7aada3926fd5516ce7ea3863e11b3bcb87f12617733082f020718610e467877872f0b4487

diff --git a/dev-python/mypy/files/mypy-0.790-py39-fixes.patch b/dev-python/mypy/files/mypy-0.790-py39-fixes.patch
deleted file mode 100644
index a7a581ea896..00000000000
--- a/dev-python/mypy/files/mypy-0.790-py39-fixes.patch
+++ /dev/null
@@ -1,161 +0,0 @@
-From 13ae58ffe8bedb7da9f4c657297f0d61e681d671 Mon Sep 17 00:00:00 2001
-From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
-Date: Sun, 30 Aug 2020 18:11:57 -0700
-Subject: [PATCH] mypy: get CI green for py39 (#9376)
-
-Due to Python 3.9's new parser, this has a different (and better) error
-message on Python 3.9.
-
-This is effectively a test of typed_ast / ast, so I don't think it
-matters too much. I'm happy to alternatively just get rid of the test
-altogether, or if people feel strongly, come up with a way to run the
-test when run with older Pythons.
-
-Co-authored-by: hauntsaninja <>
----
- .travis.yml                        | 3 ---
- mypy/test/testcheck.py             | 2 ++
- test-data/unit/check-kwargs.test   | 7 -------
- test-data/unit/check-python39.test | 9 +++++++++
- 4 files changed, 11 insertions(+), 10 deletions(-)
- create mode 100644 test-data/unit/check-python39.test
-
-diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py
-index 49a85861b6..39a35c7280 100644
---- a/mypy/test/testcheck.py
-+++ b/mypy/test/testcheck.py
-@@ -94,6 +94,8 @@
- # Tests that use Python 3.8-only AST features (like expression-scoped ignores):
- if sys.version_info >= (3, 8):
-     typecheck_files.append('check-python38.test')
-+if sys.version_info >= (3, 9):
-+    typecheck_files.append('check-python39.test')
- 
- # Special tests for platforms with case-insensitive filesystems.
- if sys.platform in ('darwin', 'win32'):
-diff --git a/test-data/unit/check-kwargs.test b/test-data/unit/check-kwargs.test
-index 1dd450caae..a587be3e06 100644
---- a/test-data/unit/check-kwargs.test
-+++ b/test-data/unit/check-kwargs.test
-@@ -53,13 +53,6 @@ f(b=[], a=A())
- class A: pass
- [builtins fixtures/list.pyi]
- 
--[case testGivingSameKeywordArgumentTwice]
--import typing
--def f(a: 'A', b: 'B') -> None: pass
--f(a=A(), b=B(), a=A()) # E: keyword argument repeated
--class A: pass
--class B: pass
--
- [case testGivingArgumentAsPositionalAndKeywordArg]
- import typing
- def f(a: 'A', b: 'B' = None) -> None: pass
-diff --git a/test-data/unit/check-python39.test b/test-data/unit/check-python39.test
-new file mode 100644
-index 0000000000..0e9ec683ae
---- /dev/null
-+++ b/test-data/unit/check-python39.test
-@@ -0,0 +1,9 @@
-+[case testGivingSameKeywordArgumentTwice]
-+# This test was originally in check-kwargs.test
-+# Python 3.9's new parser started producing a different error message here. Since this isn't the
-+# most important test, to deal with this we'll only run this test with Python 3.9 and later.
-+import typing
-+def f(a: 'A', b: 'B') -> None: pass
-+f(a=A(), b=B(), a=A()) # E: "f" gets multiple values for keyword argument "a"
-+class A: pass
-+class B: pass
-From ab1bd98cc8a6415398121a47c687ede6f4cca4fd Mon Sep 17 00:00:00 2001
-From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
-Date: Thu, 8 Oct 2020 11:18:18 -0700
-Subject: [PATCH] py39: fix mypyc complaint (#9552)
-
-I was trying to build wheels for Python 3.9 as part of #9536, but ran
-into this issue. You'll notice a couple hundred lines up msullivan
-points out that mypyc can't handle conditional method definition, so
-that's not an option here.
-
-Co-authored-by: hauntsaninja <>
----
- mypy/fastparse.py | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/mypy/fastparse.py b/mypy/fastparse.py
-index 2dafbf4e14..0b72214100 100644
---- a/mypy/fastparse.py
-+++ b/mypy/fastparse.py
-@@ -1257,11 +1257,13 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr:
- 
-     # ExtSlice(slice* dims)
-     def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
--        return TupleExpr(self.translate_expr_list(n.dims))
-+        # cast for mypyc's benefit on Python 3.9
-+        return TupleExpr(self.translate_expr_list(cast(Any, n.dims)))
- 
-     # Index(expr value)
-     def visit_Index(self, n: Index) -> Node:
--        return self.visit(n.value)
-+        # cast for mypyc's benefit on Python 3.9
-+        return self.visit(cast(Any, n.value))
- 
- 
- class TypeConverter:
-From ffed88fb95fcbfdd1363f0f719bd3e13f8fe20e9 Mon Sep 17 00:00:00 2001
-From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
-Date: Thu, 8 Oct 2020 15:00:42 -0700
-Subject: [PATCH] py39: fix mypyc complaints part 2 (#9562)
-
-Necessary because I previously didn't actually fix mypyc's complaint +
-mypyc has more complaints.
-The sys.version_info aliasing works around us hitting
-https://github.com/python/mypy/blob/08f207ef4a09f56d710d63775771ae921c41d4bc/mypyc/irbuild/expression.py#L44
-
-Co-authored-by: hauntsaninja <>
----
- mypy/fastparse.py | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
-
-diff --git a/mypy/fastparse.py b/mypy/fastparse.py
-index 0b72214100..3319cd6489 100644
---- a/mypy/fastparse.py
-+++ b/mypy/fastparse.py
-@@ -169,7 +169,9 @@ def parse(source: Union[str, bytes],
-         tree.path = fnam
-         tree.is_stub = is_stub_file
-     except SyntaxError as e:
--        if sys.version_info < (3, 9) and e.filename == "<fstring>":
-+        # alias to please mypyc
-+        is_py38_or_earlier = sys.version_info < (3, 9)
-+        if is_py38_or_earlier and e.filename == "<fstring>":
-             # In Python 3.8 and earlier, syntax errors in f-strings have lineno relative to the
-             # start of the f-string. This would be misleading, as mypy will report the error as the
-             # lineno within the file.
-@@ -1210,9 +1212,11 @@ def visit_Attribute(self, n: Attribute) -> Union[MemberExpr, SuperExpr]:
-     def visit_Subscript(self, n: ast3.Subscript) -> IndexExpr:
-         e = IndexExpr(self.visit(n.value), self.visit(n.slice))
-         self.set_line(e, n)
-+        # alias to please mypyc
-+        is_py38_or_earlier = sys.version_info < (3, 9)
-         if (
-             isinstance(n.slice, ast3.Slice) or
--            (sys.version_info < (3, 9) and isinstance(n.slice, ast3.ExtSlice))
-+            (is_py38_or_earlier and isinstance(n.slice, ast3.ExtSlice))
-         ):
-             # Before Python 3.9, Slice has no line/column in the raw ast. To avoid incompatibility
-             # visit_Slice doesn't set_line, even in Python 3.9 on.
-@@ -1258,12 +1262,12 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr:
-     # ExtSlice(slice* dims)
-     def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
-         # cast for mypyc's benefit on Python 3.9
--        return TupleExpr(self.translate_expr_list(cast(Any, n.dims)))
-+        return TupleExpr(self.translate_expr_list(cast(Any, n).dims))
- 
-     # Index(expr value)
-     def visit_Index(self, n: Index) -> Node:
-         # cast for mypyc's benefit on Python 3.9
--        return self.visit(cast(Any, n.value))
-+        return self.visit(cast(Any, n).value)
- 
- 
- class TypeConverter:

diff --git a/dev-python/mypy/mypy-0.790.ebuild b/dev-python/mypy/mypy-0.790.ebuild
deleted file mode 100644
index 35743fc5204..00000000000
--- a/dev-python/mypy/mypy-0.790.ebuild
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} )
-DISTUTILS_USE_SETUPTOOLS=rdepend
-
-inherit distutils-r1
-
-DESCRIPTION="Optional static typing for Python"
-HOMEPAGE="http://www.mypy-lang.org/"
-# One module is missing from the PyPI tarball
-# https://github.com/python/mypy/pull/9587
-# conftest.py is missing at the moment
-# https://github.com/python/mypy/pull/9543
-TYPESHED_COMMIT="5be9c91"
-SRC_URI="
-	https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
-	https://api.github.com/repos/python/typeshed/tarball/${TYPESHED_COMMIT} -> mypy-typeshed-${TYPESHED_COMMIT}.tar.gz
-"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~ia64 ppc ppc64 sparc x86"
-
-# stubgen collides with this package: https://bugs.gentoo.org/585594
-RDEPEND="
-	!dev-util/stubgen
-	>=dev-python/psutil-4[${PYTHON_USEDEP}]
-	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
-	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
-	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	test? (
-		>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
-		>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-6.0.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
-		>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
-		>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
-	)
-"
-
-PATCHES=(
-	# https://github.com/python/mypy/commit/13ae58ffe8bedb7da9f4c657297f0d61e681d671
-	# https://github.com/python/mypy/commit/ab1bd98cc8a6415398121a47c687ede6f4cca4fd
-	# https://github.com/python/mypy/commit/ffed88fb95fcbfdd1363f0f719bd3e13f8fe20e9
-	"${FILESDIR}/${P}-py39-fixes.patch"
-)
-
-distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
-distutils_enable_tests pytest
-
-src_unpack() {
-	unpack ${A}
-	rmdir "${S}/mypy/typeshed" || die
-	mv "${WORKDIR}/python-typeshed-${TYPESHED_COMMIT}" "${S}/mypy/typeshed"
-}
-
-python_prepare_all() {
-	# https://github.com/python/mypy/commit/2f291f2e312dd3bf2c05c45da0b032b240bfd7ab
-	# Avoid a big patch by deleting the file manually
-	rm test-data/samples/crawl.py || die
-	distutils-r1_python_prepare_all
-}
-
-python_test() {
-	# Some mypy/test/testcmdline.py::PythonCmdlineSuite tests
-	# fail with high COLUMNS values
-	local -x COLUMNS=80
-	pytest -vv || die "Tests fail with ${EPYTHON}"
-}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/
@ 2022-05-07  9:35 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2022-05-07  9:35 UTC (permalink / raw
  To: gentoo-commits

commit:     d8ac507127674c2ff33ba646d67758eac8c440b0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May  7 09:34:39 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May  7 09:34:39 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8ac5071

dev-python/mypy: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/mypy/Manifest                           |  6 --
 .../mypy/files/mypy-0.910-py3.10-tests.patch       | 51 ----------------
 dev-python/mypy/mypy-0.910-r1.ebuild               | 68 ----------------------
 dev-python/mypy/mypy-0.921.ebuild                  | 61 -------------------
 dev-python/mypy/mypy-0.930.ebuild                  | 64 --------------------
 dev-python/mypy/mypy-0.931.ebuild                  | 64 --------------------
 dev-python/mypy/mypy-0.940.ebuild                  | 66 ---------------------
 dev-python/mypy/mypy-0.941.ebuild                  | 66 ---------------------
 8 files changed, 446 deletions(-)

diff --git a/dev-python/mypy/Manifest b/dev-python/mypy/Manifest
index c43416443d74..0cf397ea48cf 100644
--- a/dev-python/mypy/Manifest
+++ b/dev-python/mypy/Manifest
@@ -1,8 +1,2 @@
-DIST mypy-0.910.tar.gz 2551057 BLAKE2B a3c6939c8f0e2ea19a3a3f91031330df2fb25a93cc3f9239535f15c17eedcca5716cc75c5412a1d345d8572d396c3d7128e38989fd694833cb6aec8366ac4afe SHA512 49060c13da8bf17385b6b1db6efa9ac5771f2bac92d26760c4087cf128de22846b8a062f38e83ecff524e7893f8c9cd0647a2ef89e10387138544436a2840459
-DIST mypy-0.921.tar.gz 2730985 BLAKE2B cfb7b54165b961758891fcf225f1a7d6bd9c6a7b14e6bb6d8adb990ed047bc4983b5e82de6709d3b8db85a3914e1bae2be4fd36e878d37db7387ebe6e81daac1 SHA512 f592d440b45a1bbcab973aeb717ffc805164168f1369793067a46bd2884fedcb9f981bfadd3447c6801120042553a7a7110d8cfc4e1649241d3b8685dffef653
-DIST mypy-0.930.tar.gz 2777310 BLAKE2B 4681991993b04679d21c8f6bf8327a02eb628addc289ed22fbf06e4865ee9e60b90ab41a0d0b069d0a50924bf210816bdb87cff902d4424741f4e141f0957684 SHA512 f7f7ed762eb0f56b46a174c51c34423633d72b5046129617e456c41647705380b014c0c27bd0a104319e4872f2a7d7900a260bf6151d4419c95c93e4c01c6e9d
-DIST mypy-0.931.tar.gz 2779826 BLAKE2B 11986102c6bc498a23bae52002e6ac515fa03724eed867b5356e3fb9aaa9a6eb7e699b612ab81b99dac215119402beecc702421fa82d655913976889dd4cb833 SHA512 8a336ae2f784c8ff912fc6b7dd53ed106cf14f435cee65604de74b8d4d7ab39ad65af0646060ef78e958d5a51a1de090fad628461412f2eef9593a8c032aa87a
-DIST mypy-0.940.tar.gz 2700469 BLAKE2B 4ac13002c3752566ade30a720c4de56d600552221c42f930af54a68573e6b5eb10de90ce66e2cd42f9eb419d5d09e354e4bf2d09cbcf0d6b841ab0e6710d7058 SHA512 5131ea3fe8d96f12442c68dddf04261582a063dcdd031804276263949af9f9af967be3dd775868d289709987773e1911f33e1f43951389f93cabf91c771e271f
-DIST mypy-0.941.tar.gz 2700297 BLAKE2B 1d0369336b82c167dc25da8bcc21817b351a65a2543727f08c2e14aa15a75fec21b0937eb09b8060b405c09703b8052d4ed2df65d6e27f5dd429998b110a9e35 SHA512 39ef6e0d9215f0f530ca572d3b701a877f9b968034c2ca5a04549bf6a337a8d3609c23bc45bf45b16209128d26ab2b74bca27ecbdc5de53581429b47fb348aa8
 DIST mypy-0.942.tar.gz 2701940 BLAKE2B 5501466e57b4afb8825e6c804cbdc270c79ff457c39f2e5834f4b68df70263c05b2b9abb08fe58202ee65f5e22d2291f39fcb1fc47168416134538c5f6e12ab3 SHA512 79b83587eefad10d7d20d3bfd8484a9e8b2d363e68c1e5ffaa3a82ca8b8f8d9183036ea46695a634f9156911d6f918af684ac636105b37b3a5d0e958f5d661f4
 DIST mypy-0.950.tar.gz 2746164 BLAKE2B 8466012fd3622f5e730acef774115ac84ff8c6f5488213a450de63d5acc790f937b7c69a1b05b46deef6fe8f81a13ed8e85f83c6c22cce9abdbb73b2ecf4179c SHA512 949d1dade3f225bbef0934fff040f7d5aec47039f554a669ca491d6cb46d56de3fcae0186864cdcaf5dec1347bc3af453218520536a0afa77e89a5c0e4640500

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
deleted file mode 100644
index 16e85049cc1e..000000000000
--- a/dev-python/mypy/files/mypy-0.910-py3.10-tests.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-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-r1.ebuild b/dev-python/mypy/mypy-0.910-r1.ebuild
deleted file mode 100644
index dcee802477a7..000000000000
--- a/dev-python/mypy/mypy-0.910-r1.ebuild
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit distutils-r1 multiprocessing
-
-DESCRIPTION="Optional static typing for Python"
-HOMEPAGE="http://www.mypy-lang.org/"
-SRC_URI="https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-
-# stubgen collides with this package: https://bugs.gentoo.org/585594
-# Note: replace toml with tomli on next version bump
-# https://github.com/python/mypy/pull/10824
-RDEPEND="
-	!dev-util/stubgen
-	>=dev-python/psutil-4[${PYTHON_USEDEP}]
-	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
-	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
-	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
-	dev-python/toml[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	test? (
-		>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
-		>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-6.1.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
-		>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
-		>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
-	)
-"
-
-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 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 -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
-}

diff --git a/dev-python/mypy/mypy-0.921.ebuild b/dev-python/mypy/mypy-0.921.ebuild
deleted file mode 100644
index 5b0169a2ae37..000000000000
--- a/dev-python/mypy/mypy-0.921.ebuild
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit distutils-r1 multiprocessing
-
-DESCRIPTION="Optional static typing for Python"
-HOMEPAGE="http://www.mypy-lang.org/"
-SRC_URI="https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-
-# stubgen collides with this package: https://bugs.gentoo.org/585594
-RDEPEND="
-	!dev-util/stubgen
-	>=dev-python/psutil-4[${PYTHON_USEDEP}]
-	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
-	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
-	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
-	dev-python/tomli[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	test? (
-		>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
-		>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-6.1.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
-		>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
-		>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
-distutils_enable_tests pytest
-
-# this requires packaging a lot of type stubs
-export MYPY_USE_MYPYC=0
-
-python_test() {
-	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 -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
-}

diff --git a/dev-python/mypy/mypy-0.930.ebuild b/dev-python/mypy/mypy-0.930.ebuild
deleted file mode 100644
index f1b8dc80aa27..000000000000
--- a/dev-python/mypy/mypy-0.930.ebuild
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit distutils-r1 multiprocessing
-
-DESCRIPTION="Optional static typing for Python"
-HOMEPAGE="http://www.mypy-lang.org/"
-SRC_URI="https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc ~x86"
-
-# stubgen collides with this package: https://bugs.gentoo.org/585594
-RDEPEND="
-	!dev-util/stubgen
-	>=dev-python/psutil-4[${PYTHON_USEDEP}]
-	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
-	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
-	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
-	dev-python/tomli[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	test? (
-		>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
-		>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-6.1.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
-		>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
-		>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-		>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
-distutils_enable_tests pytest
-
-# this requires packaging a lot of type stubs
-export MYPY_USE_MYPYC=0
-
-python_test() {
-	local EPYTEST_DESELECT=(
-		# Fails with pytest-xdist 2.3.0
-		# https://github.com/python/mypy/issues/11019
-		mypy/test/teststubtest.py
-		# fails due to setuptools deprecation warnings
-		mypyc/test/test_run.py::TestRun::run-imports.test::testImports
-	)
-
-	[[ "${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 -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
-}

diff --git a/dev-python/mypy/mypy-0.931.ebuild b/dev-python/mypy/mypy-0.931.ebuild
deleted file mode 100644
index 2cbc867f7765..000000000000
--- a/dev-python/mypy/mypy-0.931.ebuild
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit distutils-r1 multiprocessing
-
-DESCRIPTION="Optional static typing for Python"
-HOMEPAGE="http://www.mypy-lang.org/"
-SRC_URI="https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-
-# stubgen collides with this package: https://bugs.gentoo.org/585594
-RDEPEND="
-	!dev-util/stubgen
-	>=dev-python/psutil-4[${PYTHON_USEDEP}]
-	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
-	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
-	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
-	dev-python/tomli[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	test? (
-		>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
-		>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-6.1.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
-		>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
-		>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-		>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
-distutils_enable_tests pytest
-
-# this requires packaging a lot of type stubs
-export MYPY_USE_MYPYC=0
-
-python_test() {
-	local EPYTEST_DESELECT=(
-		# Fails with pytest-xdist 2.3.0
-		# https://github.com/python/mypy/issues/11019
-		mypy/test/teststubtest.py
-		# fails due to setuptools deprecation warnings
-		mypyc/test/test_run.py::TestRun::run-imports.test::testImports
-	)
-
-	[[ "${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 -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
-}

diff --git a/dev-python/mypy/mypy-0.940.ebuild b/dev-python/mypy/mypy-0.940.ebuild
deleted file mode 100644
index aa40a8f0ad7f..000000000000
--- a/dev-python/mypy/mypy-0.940.ebuild
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} )
-
-inherit distutils-r1 multiprocessing
-
-DESCRIPTION="Optional static typing for Python"
-HOMEPAGE="http://www.mypy-lang.org/"
-SRC_URI="https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-
-# stubgen collides with this package: https://bugs.gentoo.org/585594
-RDEPEND="
-	!dev-util/stubgen
-	>=dev-python/psutil-4[${PYTHON_USEDEP}]
-	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
-	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
-	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
-	dev-python/tomli[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	test? (
-		>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
-		>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-6.1.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
-		>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
-		>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-		>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
-distutils_enable_tests pytest
-
-# this requires packaging a lot of type stubs
-export MYPY_USE_MYPYC=0
-
-python_test() {
-	local EPYTEST_DESELECT=(
-		# Fails with pytest-xdist 2.3.0
-		# https://github.com/python/mypy/issues/11019
-		mypy/test/teststubtest.py
-		# fails due to setuptools deprecation warnings
-		mypyc/test/test_run.py::TestRun::run-imports.test::testImports
-	)
-
-	[[ "${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 -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
-}

diff --git a/dev-python/mypy/mypy-0.941.ebuild b/dev-python/mypy/mypy-0.941.ebuild
deleted file mode 100644
index 7c67c9d5047e..000000000000
--- a/dev-python/mypy/mypy-0.941.ebuild
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} )
-
-inherit distutils-r1 multiprocessing
-
-DESCRIPTION="Optional static typing for Python"
-HOMEPAGE="http://www.mypy-lang.org/"
-SRC_URI="https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-
-# stubgen collides with this package: https://bugs.gentoo.org/585594
-RDEPEND="
-	!dev-util/stubgen
-	>=dev-python/psutil-4[${PYTHON_USEDEP}]
-	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
-	>=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
-	<dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
-	dev-python/tomli[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	test? (
-		>=dev-python/attrs-18.0[${PYTHON_USEDEP}]
-		>=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-6.1.0[${PYTHON_USEDEP}]
-		>=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
-		>=dev-python/py-1.5.2[${PYTHON_USEDEP}]
-		>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
-		>=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
-distutils_enable_tests pytest
-
-# this requires packaging a lot of type stubs
-export MYPY_USE_MYPYC=0
-
-python_test() {
-	local EPYTEST_DESELECT=(
-		# Fails with pytest-xdist 2.3.0
-		# https://github.com/python/mypy/issues/11019
-		mypy/test/teststubtest.py
-		# fails due to setuptools deprecation warnings
-		mypyc/test/test_run.py::TestRun::run-imports.test::testImports
-	)
-
-	[[ "${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 -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
-}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/
@ 2024-07-09 19:29 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2024-07-09 19:29 UTC (permalink / raw
  To: gentoo-commits

commit:     3a323b02beb6cc986c4451b5c9fd2b0323b3ffc2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  9 18:13:42 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jul  9 19:29:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a323b02

dev-python/mypy: Enable py3.13

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/mypy/files/mypy-1.10.1-py313.patch | 25 +++++++++++++++++++++++++
 dev-python/mypy/mypy-1.10.1.ebuild            | 19 +++++++++++++++++--
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/dev-python/mypy/files/mypy-1.10.1-py313.patch b/dev-python/mypy/files/mypy-1.10.1-py313.patch
new file mode 100644
index 000000000000..d98bc079cb52
--- /dev/null
+++ b/dev-python/mypy/files/mypy-1.10.1-py313.patch
@@ -0,0 +1,25 @@
+From 29b4303e905f43556043efde95e19f32e04df9a5 Mon Sep 17 00:00:00 2001
+From: Jelle Zijlstra <jelle.zijlstra@gmail.com>
+Date: Fri, 24 May 2024 21:00:17 -0700
+Subject: [PATCH] Fix stubgen for Python 3.13
+
+__firstlineno__ and __static_attributes__ are new in 3.13.
+__annotate__ will be new in 3.14, so we might as well add it now.
+---
+ mypy/stubgenc.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/mypy/stubgenc.py b/mypy/stubgenc.py
+index 29b2636d39cc..7e3ef49c6e9a 100755
+--- a/mypy/stubgenc.py
++++ b/mypy/stubgenc.py
+@@ -466,6 +466,9 @@ def is_skipped_attribute(self, attr: str) -> bool:
+                 "__module__",
+                 "__weakref__",
+                 "__annotations__",
++                "__firstlineno__",
++                "__static_attributes__",
++                "__annotate__",
+             )
+             or attr in self.IGNORED_DUNDERS
+             or is_pybind_skipped_attribute(attr)  # For pickling

diff --git a/dev-python/mypy/mypy-1.10.1.ebuild b/dev-python/mypy/mypy-1.10.1.ebuild
index 2f0a69442d64..70f03443e40a 100644
--- a/dev-python/mypy/mypy-1.10.1.ebuild
+++ b/dev-python/mypy/mypy-1.10.1.ebuild
@@ -5,9 +5,9 @@ EAPI=8
 
 DISTUTILS_EXT=1
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
 
-inherit distutils-r1 multiprocessing
+inherit distutils-r1
 
 DESCRIPTION="Optional static typing for Python"
 HOMEPAGE="
@@ -51,6 +51,11 @@ BDEPEND="
 EPYTEST_XDIST=1
 distutils_enable_tests pytest
 
+PATCHES=(
+	# https://github.com/python/mypy/pull/17290
+	"${FILESDIR}/${P}-py313.patch"
+)
+
 # frustratingly, mypyc produces non-deterministic output. If ccache is enabled it will be a waste of time,
 # but simultaneously it might trash your system and fill up the cache with a giant wave of non-reproducible
 # test files (https://github.com/mypyc/mypyc/issues/1014)
@@ -58,6 +63,11 @@ export CCACHE_DISABLE=1
 
 src_compile() {
 	local -x MYPY_USE_MYPYC=$(usex native-extensions 1 0)
+	case ${EPYTHON} in
+		python3.13)
+			# https://github.com/mypyc/mypyc/issues/1056
+			MYPY_USE_MYPYC=0
+	esac
 	distutils-r1_src_compile
 }
 
@@ -87,6 +97,11 @@ python_test() {
 				mypyc/test/test_run.py::TestRun::run-i64.test::testI64ErrorValuesAndUndefined
 			)
 			;;
+		python3.13)
+			EPYTEST_DESELECT+=(
+				# https://github.com/mypyc/mypyc/issues/1056
+				mypyc/test
+			)
 	esac
 
 	# Some mypy/test/testcmdline.py::PythonCmdlineSuite tests


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/
@ 2024-07-09 19:29 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2024-07-09 19:29 UTC (permalink / raw
  To: gentoo-commits

commit:     a58394b7c687a4ae8b16f5a967d441b955478c3e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  9 19:07:02 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jul  9 19:29:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a58394b7

dev-python/mypy: Enable py3.13

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/mypy/files/mypy-1.10.1-py313.patch | 128 ++++++++++++++++++++++++++
 dev-python/mypy/mypy-1.10.1.ebuild            |   7 +-
 2 files changed, 134 insertions(+), 1 deletion(-)

diff --git a/dev-python/mypy/files/mypy-1.10.1-py313.patch b/dev-python/mypy/files/mypy-1.10.1-py313.patch
index d98bc079cb52..5b9932852e19 100644
--- a/dev-python/mypy/files/mypy-1.10.1-py313.patch
+++ b/dev-python/mypy/files/mypy-1.10.1-py313.patch
@@ -23,3 +23,131 @@ index 29b2636d39cc..7e3ef49c6e9a 100755
              )
              or attr in self.IGNORED_DUNDERS
              or is_pybind_skipped_attribute(attr)  # For pickling
+From 071e3f5f4685470f55dab7fc474e9f89a8e49fb9 Mon Sep 17 00:00:00 2001
+From: hauntsaninja <hauntsaninja@gmail.com>
+Date: Fri, 17 May 2024 18:49:27 -0400
+Subject: [PATCH] stubtest: changes for py313
+
+Technically it feels like we should be able to put the new dunders on
+`type` or something, but that wasn't enough to make false positives go
+away. But also we might not want to do that because it only applies to
+pure Python types
+---
+ mypy/stubtest.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/mypy/stubtest.py b/mypy/stubtest.py
+index dd43c472d67f..d78b71715159 100644
+--- a/mypy/stubtest.py
++++ b/mypy/stubtest.py
+@@ -634,6 +634,10 @@ def strip_prefix(s: str, prefix: str) -> str:
+     if strip_prefix(stub_arg.variable.name, "__") == runtime_arg.name:
+         return
+ 
++    nonspecific_names = {"object", "args"}
++    if runtime_arg.name in nonspecific_names:
++        return
++
+     def names_approx_match(a: str, b: str) -> bool:
+         a = a.strip("_")
+         b = b.strip("_")
+@@ -1455,6 +1459,8 @@ def verify_typealias(
+         "__getattr__",  # resulting behaviour might be typed explicitly
+         "__setattr__",  # defining this on a class can cause worse type checking
+         "__vectorcalloffset__",  # undocumented implementation detail of the vectorcall protocol
++        "__firstlineno__",
++        "__static_attributes__",
+         # isinstance/issubclass hooks that type-checkers don't usually care about
+         "__instancecheck__",
+         "__subclasshook__",
+diff --git a/mypy/plugins/dataclasses.py b/mypy/plugins/dataclasses.py
+index dd2eceab217f..edfc6840fc37 100644
+--- a/mypy/plugins/dataclasses.py
++++ b/mypy/plugins/dataclasses.py
+@@ -385,6 +385,9 @@ def transform(self) -> bool:
+ 
+         self._add_dataclass_fields_magic_attribute()
+         self._add_internal_replace_method(attributes)
++        if self._api.options.python_version >= (3, 13):
++            self._add_dunder_replace(attributes)
++
+         if "__post_init__" in info.names:
+             self._add_internal_post_init_method(attributes)
+ 
+@@ -395,6 +398,18 @@ def transform(self) -> bool:
+ 
+         return True
+ 
++    def _add_dunder_replace(self, attributes: list[DataclassAttribute]) -> None:
++        """Add a `__replace__` method to the class, which is used to replace attributes in the `copy` module."""
++        args = [attr.to_argument(self._cls.info, of="replace") for attr in attributes]
++        type_vars = [tv for tv in self._cls.type_vars]
++        add_method_to_class(
++            self._api,
++            self._cls,
++            "__replace__",
++            args=args,
++            return_type=Instance(self._cls.info, type_vars),
++        )
++
+     def _add_internal_replace_method(self, attributes: list[DataclassAttribute]) -> None:
+         """
+         Stashes the signature of 'dataclasses.replace(...)' for this specific dataclass
+From 160a9c767324460e916978d49f8d770738572119 Mon Sep 17 00:00:00 2001
+From: hauntsaninja <hauntsaninja@gmail.com>
+Date: Fri, 17 May 2024 18:23:01 -0400
+Subject: [PATCH 1/2] Support namedtuple.__replace__ in Python 3.13
+
+---
+ mypy/semanal_namedtuple.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/mypy/semanal_namedtuple.py b/mypy/semanal_namedtuple.py
+index 9a0be9d9c14c..bdd633a60635 100644
+--- a/mypy/semanal_namedtuple.py
++++ b/mypy/semanal_namedtuple.py
+@@ -599,6 +599,12 @@ def add_method(
+             ret=selftype,
+             args=[Argument(var, var.type, EllipsisExpr(), ARG_NAMED_OPT) for var in vars],
+         )
++        if self.options.python_version >= (3, 13):
++            add_method(
++                "__replace__",
++                ret=selftype,
++                args=[Argument(var, var.type, EllipsisExpr(), ARG_NAMED_OPT) for var in vars],
++            )
+ 
+         def make_init_arg(var: Var) -> Argument:
+             default = default_items.get(var.name, None)
+
+From 9fcaedb9f757595486ed231dbdb9433151ec669d Mon Sep 17 00:00:00 2001
+From: hauntsaninja <hauntsaninja@gmail.com>
+Date: Sat, 18 May 2024 18:40:09 -0400
+Subject: [PATCH 2/2] .
+
+---
+ test-data/unit/check-namedtuple.test | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/test-data/unit/check-namedtuple.test b/test-data/unit/check-namedtuple.test
+index 23e109e1af78..b2ba69abb045 100644
+--- a/test-data/unit/check-namedtuple.test
++++ b/test-data/unit/check-namedtuple.test
+@@ -1376,3 +1376,17 @@ class Test3(NamedTuple, metaclass=type):  # E: Unexpected keyword argument "meta
+     ...
+ [builtins fixtures/tuple.pyi]
+ [typing fixtures/typing-namedtuple.pyi]
++
++
++[case testNamedTupleDunderReplace]
++# flags: --python-version 3.13
++from typing import NamedTuple
++
++class A(NamedTuple):
++    x: int
++
++A(x=0).__replace__(x=1)
++A(x=0).__replace__(x="asdf")  # E: Argument "x" to "__replace__" of "A" has incompatible type "str"; expected "int"
++A(x=0).__replace__(y=1)  # E: Unexpected keyword argument "y" for "__replace__" of "A"
++[builtins fixtures/tuple.pyi]
++[typing fixtures/typing-namedtuple.pyi]

diff --git a/dev-python/mypy/mypy-1.10.1.ebuild b/dev-python/mypy/mypy-1.10.1.ebuild
index 70f03443e40a..b87fe789fc41 100644
--- a/dev-python/mypy/mypy-1.10.1.ebuild
+++ b/dev-python/mypy/mypy-1.10.1.ebuild
@@ -52,6 +52,8 @@ EPYTEST_XDIST=1
 distutils_enable_tests pytest
 
 PATCHES=(
+	# https://github.com/python/mypy/pull/17259
+	# https://github.com/python/mypy/pull/17261
 	# https://github.com/python/mypy/pull/17290
 	"${FILESDIR}/${P}-py313.patch"
 )
@@ -101,7 +103,10 @@ python_test() {
 			EPYTEST_DESELECT+=(
 				# https://github.com/mypyc/mypyc/issues/1056
 				mypyc/test
+				# requires typeshed update
+				mypy/test/teststubtest.py::StubtestUnit::test_type_alias
 			)
+			;;
 	esac
 
 	# Some mypy/test/testcmdline.py::PythonCmdlineSuite tests
@@ -119,7 +124,7 @@ python_test() {
 
 	local failed=
 	local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
-	nonfatal epytest -n "$(makeopts_jobs)" --dist=worksteal || failed=1
+	nonfatal epytest || failed=1
 
 	rm conftest.py pyproject.toml || die
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/
@ 2024-12-22  0:34 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2024-12-22  0:34 UTC (permalink / raw
  To: gentoo-commits

commit:     bd9fbe99c67b8b0399a8af212b36308d44b36d54
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 22 00:33:30 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Dec 22 00:33:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd9fbe99

dev-python/mypy: don't pass -Werror

Closes: https://bugs.gentoo.org/916577
Closes: https://bugs.gentoo.org/944118
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/mypy/files/mypy-1.14.0-no-werror.patch | 11 +++++++++++
 dev-python/mypy/mypy-1.14.0.ebuild                |  4 ++++
 2 files changed, 15 insertions(+)

diff --git a/dev-python/mypy/files/mypy-1.14.0-no-werror.patch b/dev-python/mypy/files/mypy-1.14.0-no-werror.patch
new file mode 100644
index 000000000000..038c1964020e
--- /dev/null
+++ b/dev-python/mypy/files/mypy-1.14.0-no-werror.patch
@@ -0,0 +1,11 @@
+https://bugs.gentoo.org/916577
+--- a/mypyc/build.py
++++ b/mypyc/build.py
+@@ -551,7 +551,6 @@ def mypycify(
+         cflags += [
+             f"-O{opt_level}",
+             f"-g{debug_level}",
+-            "-Werror",
+             "-Wno-unused-function",
+             "-Wno-unused-label",
+             "-Wno-unreachable-code",

diff --git a/dev-python/mypy/mypy-1.14.0.ebuild b/dev-python/mypy/mypy-1.14.0.ebuild
index da0b9a425592..e86f197574bc 100644
--- a/dev-python/mypy/mypy-1.14.0.ebuild
+++ b/dev-python/mypy/mypy-1.14.0.ebuild
@@ -56,6 +56,10 @@ distutils_enable_tests pytest
 # test files (https://github.com/mypyc/mypyc/issues/1014)
 export CCACHE_DISABLE=1
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.14.0-no-werror.patch
+)
+
 src_prepare() {
 	distutils-r1_src_prepare
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-12-22  0:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-07 16:31 [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/ Louis Sautier
  -- strict thread matches above, loose matches on Subject: below --
2020-11-18 17:43 Louis Sautier
2021-02-26 14:35 Michał Górny
2022-05-07  9:35 Michał Górny
2024-07-09 19:29 Michał Górny
2024-07-09 19:29 Michał Górny
2024-12-22  0:34 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox