summaryrefslogtreecommitdiff
path: root/dev-python/mypy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-12-22 06:30:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-12-22 06:30:44 +0000
commit5a2cecfc8661e1d3a762adf05cf8eb142cd41710 (patch)
tree341806a72603cc8845e7e1595289e7a8b9570f2a /dev-python/mypy
parentd2bcdab82e5f5f38a8ab54026e8aa94edb1b77a6 (diff)
gentoo auto-resync : 22:12:2024 - 06:30:44
Diffstat (limited to 'dev-python/mypy')
-rw-r--r--dev-python/mypy/Manifest3
-rw-r--r--dev-python/mypy/files/mypy-1.14.0-no-werror.patch11
-rw-r--r--dev-python/mypy/mypy-1.14.0.ebuild131
3 files changed, 145 insertions, 0 deletions
diff --git a/dev-python/mypy/Manifest b/dev-python/mypy/Manifest
index 4e241a3cdacb..6ea48c4fcd71 100644
--- a/dev-python/mypy/Manifest
+++ b/dev-python/mypy/Manifest
@@ -1,3 +1,6 @@
+AUX mypy-1.14.0-no-werror.patch 325 BLAKE2B ae4291ac5dfdb6d03234e1ce04e23cee4178bbdc3a1c9a74667f61850816d92acab7accc4f4cd5bcaa5de7732cb6b8f96c4863de654a812a160a2e5ae3801675 SHA512 1cab2a42bc3a9822742c811001572665a07a2aef402f5a28a4ceb7100724e57652a76313c2313f85b86a2179451d0a8deda59034449f695b3d09d06bc5c4ebc4
DIST mypy-1.13.0.gh.tar.gz 3165219 BLAKE2B 67e05628fb79666a84a7c284c8437222ce159260ef490c8c91a3f92fd21985032043821823dcbd0fb8775956ca4660b3468c6955fef5d13a104b3339b1e6a0b5 SHA512 a351a30bfc7ac687d4802c6459296a4a46356fc153258c686051fa3cb149ab3e8690357cad21cd6ab07b4fb6e91dd3610b57f7b38078da7e563c114cd3ed562a
+DIST mypy-1.14.0.gh.tar.gz 3227612 BLAKE2B 370ad0a515f75c13c97844d40a20645d641a56ae052684bc789c716a42feead4e22ac79460fd91f81c4fb67cd316b657795ff700f537970a145c04438eb2e2b0 SHA512 409bd40ca552b3d34b74b0f236c3db29b180cefe863d658c22378c5ef251e033fdc093fe2f47440d888f5c0a7afcceeb9357be35c9bf368b37cdca615a614bbd
EBUILD mypy-1.13.0.ebuild 3841 BLAKE2B 0d30ce41b282121da88a746ae8f01048a549a4d32fc89f414f0c2f0d27c92e7e56ab2914263220f073f01b63ef5d96ecbc75793f1445690632c716c59ea99a5e SHA512 44f49ce6b035084ea73d01377946d470c21523d046b33966b6c7983579436e8cad642a4d855ccdc30c9c41f332c588cc2896684b9b8e4e0f59cdf2b7bd33a624
+EBUILD mypy-1.14.0.ebuild 3999 BLAKE2B c90d1b12642ccd58e4add1c7088c8a8f595d8b024784d1cdfd2f2d6e36ed26691f8ff346d8b0fd489d86ff56931889c8662b33a7f9f1572abfb115c294ba72b1 SHA512 1deaa135814dae3e433aee508b3b5ed668492a53cebbbf213151e6fab4eed561696704771ca96a60f82ffe411836440a3790fe9f0247b24960423babeb0c2c4e
MISC metadata.xml 661 BLAKE2B df57cc2dfde5b112f8c26b51ca5cc9e7727d318ee274ea7e1abf448819daf0307f471aeb7c32b19f20e87ce1ccffd47a5529415003765c275523e1b5236f3bb1 SHA512 eddd19c4b0b5211f73f9619f388a799ced108b62bb43d852ed2d01d0b1717e7b9ef118d34b9d61db543c7b47080fb8058c3d35f7359cc456069636f357e080c9
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
new file mode 100644
index 000000000000..e86f197574bc
--- /dev/null
+++ b/dev-python/mypy/mypy-1.14.0.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit distutils-r1
+
+DESCRIPTION="Optional static typing for Python"
+HOMEPAGE="
+ https://www.mypy-lang.org/
+ https://github.com/python/mypy/
+ https://pypi.org/project/mypy/
+"
+SRC_URI="
+ https://github.com/python/mypy/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="+native-extensions"
+
+# stubgen collides with this package: https://bugs.gentoo.org/585594
+RDEPEND="
+ !dev-util/stubgen
+ >=dev-python/psutil-4[${PYTHON_USEDEP}]
+ >=dev-python/typing-extensions-4.6.0[${PYTHON_USEDEP}]
+ >=dev-python/mypy-extensions-1.0.0[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/tomli[${PYTHON_USEDEP}]
+ ' 3.10)
+"
+BDEPEND="
+ native-extensions? (
+ ${RDEPEND}
+ dev-python/types-psutil[${PYTHON_USEDEP}]
+ dev-python/types-setuptools[${PYTHON_USEDEP}]
+ )
+ test? (
+ >=dev-python/attrs-18.0[${PYTHON_USEDEP}]
+ >=dev-python/filelock-3.3.0[${PYTHON_USEDEP}]
+ >=dev-python/lxml-4.9.1[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_XDIST=1
+distutils_enable_tests pytest
+
+# 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)
+export CCACHE_DISABLE=1
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.14.0-no-werror.patch
+)
+
+src_prepare() {
+ distutils-r1_src_prepare
+
+ # don't force pytest-xdist, in case user asked for EPYTEST_JOBS=1
+ sed -i -e '/addopts/s:-nauto::' pyproject.toml || die
+}
+
+python_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_python_compile
+}
+
+python_test() {
+ local EPYTEST_DESELECT=(
+ # the majority of them require Internet (via pip)
+ mypy/test/testpep561.py
+ # known broken with assertions enabled
+ # https://github.com/python/mypy/issues/16043
+ mypyc/test/test_run.py::TestRun::run-i64.test::testI64GlueMethodsAndInheritance
+ mypyc/test/test_run.py::TestRun::run-floats.test::testFloatOps
+ mypyc/test/test_run.py::TestRunStrictDunderTyping::run-floats.test::testFloatOps_dunder_typing
+ # these assume that types-docutils are not installed
+ mypy/test/testpythoneval.py::PythonEvaluationSuite::pythoneval.test::testIgnoreImportIfNoPython3StubAvailable
+ mypy/test/testpythoneval.py::PythonEvaluationSuite::pythoneval.test::testNoPython3StubAvailable
+ # TODO
+ mypy/test/meta/test_parse_data.py
+ mypy/test/meta/test_update_data.py
+ )
+ case ${EPYTHON} in
+ python3.13)
+ ;&
+ python3.12)
+ EPYTEST_DESELECT+=(
+ # more assertions, sigh
+ mypyc/test/test_run.py::TestRun::run-bools.test::testBoolOps
+ mypyc/test/test_run.py::TestRun::run-i64.test::testI64BasicOps
+ mypyc/test/test_run.py::TestRun::run-i64.test::testI64DefaultArgValues
+ mypyc/test/test_run.py::TestRun::run-i64.test::testI64ErrorValuesAndUndefined
+ )
+ ;;
+ esac
+
+ # Some mypy/test/testcmdline.py::PythonCmdlineSuite tests
+ # fail with high COLUMNS values
+ local -x COLUMNS=80
+
+ # The tests depend on having in-source compiled extensions if you want to
+ # test those compiled extensions. Various crucial test dependencies aren't
+ # installed. Even pyproject.toml is needed because that's where pytest args
+ # are in. Hack them into the build directory and delete them afterwards.
+ # See: https://github.com/python/mypy/issues/16143
+ local -x MYPY_TEST_PREFIX="${S}"
+ cd "${BUILD_DIR}/install$(python_get_sitedir)" || die
+ cp -r "${S}"/{conftest.py,pyproject.toml} . || die
+
+ local failed=
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ nonfatal epytest || failed=1
+
+ rm conftest.py pyproject.toml || die
+
+ [[ ${failed} ]] && die "epytest failed with ${EPYTHON}"
+}