commit: b21c536c3e239ba404e39db369fe41d978bb80e9 Author: Lucio Sauer <watermanpaint <AT> posteo <DOT> net> AuthorDate: Mon May 22 00:42:59 2023 +0000 Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org> CommitDate: Mon May 22 00:44:37 2023 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b21c536c
dev-python/pytest-mypy-plugins: new package, add 1.11.1 Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net> dev-python/pytest-mypy-plugins/Manifest | 1 + ...lugins-1.11.1-deprecated-chevron-to-jinja.patch | 45 ++++++++++++++++++++++ dev-python/pytest-mypy-plugins/metadata.xml | 19 +++++++++ .../pytest-mypy-plugins-1.11.1.ebuild | 37 ++++++++++++++++++ 4 files changed, 102 insertions(+) diff --git a/dev-python/pytest-mypy-plugins/Manifest b/dev-python/pytest-mypy-plugins/Manifest new file mode 100644 index 000000000..1e72cbeeb --- /dev/null +++ b/dev-python/pytest-mypy-plugins/Manifest @@ -0,0 +1 @@ +DIST pytest-mypy-plugins-1.11.1.gh.tar.gz 18201 BLAKE2B a21b089321a3d632225e0ac6aa921b23bba111dcc5234c2ada32522b7659533970a9bd19bb432d3304b0291e32ba067ab75c549c4552ca742835155ab8e711b1 SHA512 ac7a0973aba070c80480681f2910d40c7e510c906f8030413ba5c94f50131df19036c7183bfad3f211d6d375661753b9d4ff2a73b3bd7af06d0f442e94af3f64 diff --git a/dev-python/pytest-mypy-plugins/files/pytest-mypy-plugins-1.11.1-deprecated-chevron-to-jinja.patch b/dev-python/pytest-mypy-plugins/files/pytest-mypy-plugins-1.11.1-deprecated-chevron-to-jinja.patch new file mode 100644 index 000000000..ae2885893 --- /dev/null +++ b/dev-python/pytest-mypy-plugins/files/pytest-mypy-plugins-1.11.1-deprecated-chevron-to-jinja.patch @@ -0,0 +1,45 @@ +Chevron, an engine for the Mustache templating language, has been unmaintained +since 2021 and is not part of ::gentoo. The Jinja and Mustache templating +languages use the same syntax as far as this project is concerned. + +PR issued upstream by <[email protected]>: +https://github.com/typeddjango/pytest-mypy-plugins/pull/117 +--- a/pytest_mypy_plugins/utils.py ++++ b/pytest_mypy_plugins/utils.py +@@ -11,10 +11,11 @@ from itertools import zip_longest + from pathlib import Path + from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Tuple, Union + +-import chevron ++import jinja2 + import regex + from decorator import contextmanager + ++_rendering_env = jinja2.Environment() + + @contextmanager + def temp_environ() -> Iterator[None]: +@@ -351,9 +352,10 @@ def extract_output_matchers_from_out(out: str, params: Mapping[str, Any], regex: + return matchers + + +-def render_template(template: str, data: Mapping[str, Any]) -> str: +- return chevron.render(template=template, data={k: v if v is not None else "None" for k, v in data.items()}) + ++def render_template(template: str, data: Mapping[str, Any]) -> str: ++ template = _rendering_env.from_string(template) ++ return template.render({k: v if v is not None else "None" for k, v in data.items()}) + + def get_func_first_lnum(attr: Callable[..., None]) -> Optional[Tuple[int, List[str]]]: + lines, _ = inspect.getsourcelines(attr) +--- a/setup.py ++++ b/setup.py +@@ -8,7 +8,7 @@ dependencies = [ + "mypy>=0.970", + "decorator", + "pyyaml", +- "chevron", ++ "jinja2", + "regex", + "packaging", + ] diff --git a/dev-python/pytest-mypy-plugins/metadata.xml b/dev-python/pytest-mypy-plugins/metadata.xml new file mode 100644 index 000000000..e6717ac2f --- /dev/null +++ b/dev-python/pytest-mypy-plugins/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>Lucio Sauer</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>[email protected]</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <changelog> + https://github.com/typeddjango/pytest-mypy-plugins/blob/master/CHANGELOG.md + </changelog> + <remote-id type="github">typeddjango/pytest-mypy-plugins</remote-id> + <remote-id type="pypi">pytest-mypy-plugins</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/pytest-mypy-plugins/pytest-mypy-plugins-1.11.1.ebuild b/dev-python/pytest-mypy-plugins/pytest-mypy-plugins-1.11.1.ebuild new file mode 100644 index 000000000..e42608e0e --- /dev/null +++ b/dev-python/pytest-mypy-plugins/pytest-mypy-plugins-1.11.1.ebuild @@ -0,0 +1,37 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_11 ) +inherit distutils-r1 + +DESCRIPTION="pytest plugin for testing mypy types, stubs, plugins" +HOMEPAGE=" + https://pypi.org/project/pytest-mypy-plugins/ + https://github.com/typeddjango/pytest-mypy-plugins/ +" + +SRC_URI="https://github.com/typeddjango/pytest-mypy-plugins/archive/refs/tags/${PV}.tar.gz + -> ${P}.gh.tar.gz" +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +PATCHES=( + "${FILESDIR}"/${P}-deprecated-chevron-to-jinja.patch +) + +DOCS="README* CHANGELOG*" + +RDEPEND=" + dev-python/decorator[${PYTHON_USEDEP}] + dev-python/jinja[${PYTHON_USEDEP}] + dev-python/mypy[${PYTHON_USEDEP}] + dev-python/packaging[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/regex[${PYTHON_USEDEP}] +" + +distutils_enable_tests pytest
