diff options
Diffstat (limited to 'dev-python/pydantic')
-rw-r--r-- | dev-python/pydantic/Manifest | 7 | ||||
-rw-r--r-- | dev-python/pydantic/files/pydantic-1.8.2_p20210719-update-py3.10rc1.patch | 174 | ||||
-rw-r--r-- | dev-python/pydantic/pydantic-1.8.2_p20210719.ebuild | 50 | ||||
-rw-r--r-- | dev-python/pydantic/pydantic-1.9.0-r2.ebuild (renamed from dev-python/pydantic/pydantic-1.9.0.ebuild) | 2 | ||||
-rw-r--r-- | dev-python/pydantic/pydantic-1.9.0-r4.ebuild (renamed from dev-python/pydantic/pydantic-1.9.0-r1.ebuild) | 13 |
5 files changed, 11 insertions, 235 deletions
diff --git a/dev-python/pydantic/Manifest b/dev-python/pydantic/Manifest index 43fc67a3f0c5..effb1c2f382a 100644 --- a/dev-python/pydantic/Manifest +++ b/dev-python/pydantic/Manifest @@ -1,7 +1,4 @@ -AUX pydantic-1.8.2_p20210719-update-py3.10rc1.patch 5461 BLAKE2B 991dc2438ebe9db73313761c59a1fc854a11990cf32b08cb98f07857a21a4123642ce280b7054071659ac3dad7c6400be83d62c990ce53dafba028d42389d84b SHA512 77dd1770c194c94dd27a9bd4ab044e02cd3f6716febd95b66b78ea043ea1b519beb896a2452c6281723cd8aef3d32f6f3db48fa08f83d6380ab7f602a74bdf16 -DIST pydantic-1.8.2_p20210719.tar.gz 310729 BLAKE2B 1905ddd100e3a40b48eadc7beb75542f4a59ff8ef55115105041b0c06249ee67df1ca91003bc01f828c543c757ec8931ff2d31663d33ca16f356f62f71a61474 SHA512 c9d91788b3143b211755806e533ae0ccafa2ab101159f98eeba921ec9370956e8f8b0f210e6ddddcef2345ea391d2e1011ea5498d2f7985bd711f48d025e30d5 DIST pydantic-1.9.0.tar.gz 299758 BLAKE2B f6c2b89e598fc94db74b8165c449c752f11166752b12bbd37c23902b74c1f895bbd49b8fc4dc8da86b10880ac2e37178275cc28a42964e1133397364ea268d02 SHA512 ace542ff12698d568f2bea6121afc889c51892042b1a1b98464a6da6f71e50ecd8aafff7abd7ffd16983769844f7c970099d1fee7aa788f2e78172c0d5c4f472 -EBUILD pydantic-1.8.2_p20210719.ebuild 1200 BLAKE2B e5d8f312a83e62fc82617211cebc670f32a140b97ab40a3be8cbc6a1a4fecec6d61a98189d2a63e938b9bff5eecbdb4cc4cfd679da2db404768aa2555e099419 SHA512 e7765492c554d4e7696f9eb115ca0505e05146c3b7c19104074986b8512bed6c56b737d91b4537df934ab35e2b923db7c34d97f8f53dd198b33251fff91f5be8 -EBUILD pydantic-1.9.0-r1.ebuild 1952 BLAKE2B d6a7d28fa73e7db97fee6465451d959f4bb8579581f7b8bc4d890383f61457246a749adc89bbe0ff54fd93516a0323ec8050d13e5cdc590d3687520c06755871 SHA512 19b445f9e2885344c03cd8c198ef50b6dec6348a8458a3485ad92da4bfd6efc555fb060d340cf9e13698c2c6540a2c6cd657a039e8a6b664d3697e3ea1b40fe5 -EBUILD pydantic-1.9.0.ebuild 1776 BLAKE2B 2ffe4da260a2dbbca936bbd7597bfa6b712a70c5fe2345da527727ca256bf240650f929792e72b09450cb98c102d880d1850fa0e706208fe3904e7932d414e90 SHA512 fbdf19ac48623242e32d5ecb4e2e9ad306868ef28a6bcea3d022f64dc5f40beffebaa49f774cd589dd5acdfccc0e38ce14cbf9f9d1014cad71f007ecb0af2778 +EBUILD pydantic-1.9.0-r2.ebuild 1781 BLAKE2B 1abc19250b73f7675214ed0f10aa8fae0f3b8f57302167e1af93c2830d05b3c080a62f1d7d37088aecb47765688b7f314017d3f0348d127422a7856a92a130b5 SHA512 2bde02fb92797d94a67ee7cc247e0cf862a7910847d9e94043b8377476db6e2ad9d528f5fbb95ee97d17b70f05573c50780965c1440f2bd84ab5dec628fcb53c +EBUILD pydantic-1.9.0-r4.ebuild 2046 BLAKE2B e97b3adbb7c234d580b1c2476843a01f9eca49a7fef9b38ad0c9b71c3212438ddf0eb22d07cde79495c78997ccff231cc0be2c2ed1c16b6b87db5bcb81b67337 SHA512 f6a8b7672c8e55938003d20aa1baf37430d2d023ac5990b8631c4c9a3448a4785efe0ef534c8e8a44524f90b77116aeb48bdfebebf4034e7fa5b2b3cae573d9c MISC metadata.xml 492 BLAKE2B e21bc5a40669b2b321ba310df9dd4c6ff424e77d9d961b3aebc1f62b579444c7f505c19dae02590de999cfd8168ac522034275583fb4835e97e8db9b153fefda SHA512 bfb9c7a069a79735543dc12101af7cca16acc5fd93cae01515dc35a106c16a419c0e0e3a97a6bc8426c3db776417f7d29231022cb6ac27020f97e5dcfe0d0cbb diff --git a/dev-python/pydantic/files/pydantic-1.8.2_p20210719-update-py3.10rc1.patch b/dev-python/pydantic/files/pydantic-1.8.2_p20210719-update-py3.10rc1.patch deleted file mode 100644 index d4700a7e33b7..000000000000 --- a/dev-python/pydantic/files/pydantic-1.8.2_p20210719-update-py3.10rc1.patch +++ /dev/null @@ -1,174 +0,0 @@ -From: PrettyWood <em.jolibois@gmail.com> -Date: Tue, 10 Aug 2021 18:00:16 +0200 -Subject: [PATCH 1/2] refactor: rename `is_union` into `is_union_origin` -https://github.com/samuelcolvin/pydantic/pull/3085 - ---- a/pydantic/fields.py -+++ b/pydantic/fields.py -@@ -41,7 +41,7 @@ - is_literal_type, - is_new_type, - is_typeddict, -- is_union, -+ is_union_origin, - new_type_supertype, - ) - from .utils import PyObjectStr, Representation, ValueItems, lenient_issubclass, sequence_like, smart_deepcopy -@@ -557,7 +557,7 @@ def _type_analysis(self) -> None: # noqa: C901 (ignore complexity) - return - if origin is Callable: - return -- if is_union(origin): -+ if is_union_origin(origin): - types_ = [] - for type_ in get_args(self.type_): - if type_ is NoneType: ---- a/pydantic/main.py -+++ b/pydantic/main.py -@@ -38,7 +38,7 @@ - get_origin, - is_classvar, - is_namedtuple, -- is_union, -+ is_union_origin, - resolve_annotations, - update_field_forward_refs, - ) -@@ -176,7 +176,7 @@ def is_untouched(v: Any) -> bool: - elif is_valid_field(ann_name): - validate_field_name(bases, ann_name) - value = namespace.get(ann_name, Undefined) -- allowed_types = get_args(ann_type) if is_union(get_origin(ann_type)) else (ann_type,) -+ allowed_types = get_args(ann_type) if is_union_origin(get_origin(ann_type)) else (ann_type,) - if ( - is_untouched(value) - and ann_type != PyObject ---- a/pydantic/schema.py -+++ b/pydantic/schema.py -@@ -71,7 +71,7 @@ - is_callable_type, - is_literal_type, - is_namedtuple, -- is_union, -+ is_union_origin, - ) - from .utils import ROOT_KEY, get_model, lenient_issubclass, sequence_like - -@@ -966,7 +966,7 @@ def go(type_: Any) -> Type[Any]: - - if origin is Annotated: - return go(args[0]) -- if is_union(origin): -+ if is_union_origin(origin): - return Union[tuple(go(a) for a in args)] # type: ignore - - if issubclass(origin, List) and (field_info.min_items is not None or field_info.max_items is not None): ---- a/pydantic/typing.py -+++ b/pydantic/typing.py -@@ -191,14 +191,14 @@ def get_args(tp: Type[Any]) -> Tuple[Any, ...]: - - if sys.version_info < (3, 10): - -- def is_union(tp: Type[Any]) -> bool: -+ def is_union_origin(tp: Type[Any]) -> bool: - return tp is Union - - - else: - import types - -- def is_union(tp: Type[Any]) -> bool: -+ def is_union_origin(tp: Type[Any]) -> bool: - return tp is Union or tp is types.Union - - -@@ -251,7 +251,7 @@ def is_union(tp: Type[Any]) -> bool: - 'get_origin', - 'typing_base', - 'get_all_type_hints', -- 'is_union', -+ 'is_union_origin', - ) - - - -From: PrettyWood <em.jolibois@gmail.com> -Date: Tue, 10 Aug 2021 18:02:57 +0200 -Subject: [PATCH 2/2] fix: "new" union and generic types are not the same as - `typing.GenericAlias` - ---- a/pydantic/typing.py -+++ b/pydantic/typing.py -@@ -28,10 +28,10 @@ - from typing import _Final as typing_base # type: ignore - - try: -- from typing import GenericAlias # type: ignore -+ from typing import GenericAlias as TypingGenericAlias # type: ignore - except ImportError: - # python < 3.9 does not have GenericAlias (list[int], tuple[str, ...] and so on) -- GenericAlias = () -+ TypingGenericAlias = () - - - if sys.version_info < (3, 7): -@@ -194,12 +194,16 @@ def get_args(tp: Type[Any]) -> Tuple[Any, ...]: - def is_union_origin(tp: Type[Any]) -> bool: - return tp is Union - -+ WithArgsTypes = (TypingGenericAlias,) - - else: - import types -+ import typing - - def is_union_origin(tp: Type[Any]) -> bool: -- return tp is Union or tp is types.Union -+ return tp is Union or tp is types.UnionType # type: ignore # noqa: E721 -+ -+ WithArgsTypes = (typing._GenericAlias, types.GenericAlias, types.UnionType) # type: ignore - - - if TYPE_CHECKING: -@@ -246,7 +250,7 @@ def is_union_origin(tp: Type[Any]) -> bool: - 'CallableGenerator', - 'ReprArgs', - 'CallableGenerator', -- 'GenericAlias', -+ 'WithArgsTypes', - 'get_args', - 'get_origin', - 'typing_base', -@@ -260,10 +264,10 @@ def is_union_origin(tp: Type[Any]) -> bool: - - - def display_as_type(v: Type[Any]) -> str: -- if not isinstance(v, typing_base) and not isinstance(v, GenericAlias) and not isinstance(v, type): -+ if not isinstance(v, typing_base) and not isinstance(v, WithArgsTypes) and not isinstance(v, type): - v = v.__class__ - -- if isinstance(v, GenericAlias): -+ if isinstance(v, WithArgsTypes): - # Generic alias are constructs like `list[int]` - return str(v).replace('typing.', '') - ---- a/pydantic/utils.py -+++ b/pydantic/utils.py -@@ -23,7 +23,7 @@ - Union, - ) - --from .typing import GenericAlias, NoneType, display_as_type -+from .typing import NoneType, WithArgsTypes, display_as_type - from .version import version_info - - if TYPE_CHECKING: -@@ -152,7 +152,7 @@ def lenient_issubclass(cls: Any, class_or_tuple: Union[Type[Any], Tuple[Type[Any - try: - return isinstance(cls, type) and issubclass(cls, class_or_tuple) - except TypeError: -- if isinstance(cls, GenericAlias): -+ if isinstance(cls, WithArgsTypes): - return False - raise # pragma: no cover - diff --git a/dev-python/pydantic/pydantic-1.8.2_p20210719.ebuild b/dev-python/pydantic/pydantic-1.8.2_p20210719.ebuild deleted file mode 100644 index 6077218fea52..000000000000 --- a/dev-python/pydantic/pydantic-1.8.2_p20210719.ebuild +++ /dev/null @@ -1,50 +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 - -COMMIT=0c26c1c4e288e0d41d2c3890d5b3befa7579455c - -DESCRIPTION="Data parsing and validation using Python type hints" -HOMEPAGE="https://github.com/samuelcolvin/pydantic" -# No tests on PyPI: https://github.com/samuelcolvin/pydantic/pull/1976 -SRC_URI=" - https://github.com/samuelcolvin/pydantic/archive/${COMMIT}.tar.gz - -> ${P}.tar.gz" -S="${WORKDIR}/${PN}-${COMMIT}" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="amd64 arm arm64 hppa ppc ppc64 ~riscv sparc x86" - -RDEPEND=" - dev-python/typing-extensions[${PYTHON_USEDEP}] -" -BDEPEND=" - dev-python/cython[${PYTHON_USEDEP}] - test? ( - dev-python/hypothesis[${PYTHON_USEDEP}] - dev-python/pytest-mock[${PYTHON_USEDEP}] - dev-python/python-email-validator[${PYTHON_USEDEP}] - ) -" - -PATCHES=( - "${FILESDIR}/${P}-update-py3.10rc1.patch" -) - -distutils_enable_tests --install pytest - -EPYTEST_DESELECT=( - # flaky test, known upstream - tests/test_hypothesis_plugin.py::test_can_construct_models_with_all_fields -) - -src_prepare() { - # seriously? - sed -i -e '/CFLAGS/d' setup.py || die - distutils-r1_src_prepare -} diff --git a/dev-python/pydantic/pydantic-1.9.0.ebuild b/dev-python/pydantic/pydantic-1.9.0-r2.ebuild index 958836539afa..fa8a4597f362 100644 --- a/dev-python/pydantic/pydantic-1.9.0.ebuild +++ b/dev-python/pydantic/pydantic-1.9.0-r2.ebuild @@ -23,7 +23,7 @@ BDEPEND=" dev-python/hypothesis[${PYTHON_USEDEP}] dev-python/pytest-mock[${PYTHON_USEDEP}] dev-python/python-dotenv[${PYTHON_USEDEP}] - dev-python/python-email-validator[${PYTHON_USEDEP}] + <dev-python/python-email-validator-1.2[${PYTHON_USEDEP}] ) " diff --git a/dev-python/pydantic/pydantic-1.9.0-r1.ebuild b/dev-python/pydantic/pydantic-1.9.0-r4.ebuild index 1e26b96ea70b..e7687b5727a4 100644 --- a/dev-python/pydantic/pydantic-1.9.0-r1.ebuild +++ b/dev-python/pydantic/pydantic-1.9.0-r4.ebuild @@ -14,7 +14,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" LICENSE="MIT" SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" RDEPEND=" dev-python/typing-extensions[${PYTHON_USEDEP}] @@ -25,7 +25,7 @@ BDEPEND=" dev-python/hypothesis[${PYTHON_USEDEP}] dev-python/pytest-mock[${PYTHON_USEDEP}] dev-python/python-dotenv[${PYTHON_USEDEP}] - dev-python/python-email-validator[${PYTHON_USEDEP}] + >=dev-python/python-email-validator-1.2.1[${PYTHON_USEDEP}] ) " @@ -37,10 +37,12 @@ src_prepare() { } python_compile() { + if [[ ${EPYTHON} == pypy3 ]]; then + # do not build extensions on PyPy to workaround + # https://github.com/cython/cython/issues/4763 + local -x SKIP_CYTHON=1 + fi distutils-r1_python_compile - # "setup.py clean" is broken - # TODO: remove this if distutils-r1.eclass is updated to do rm - rm -rf build || die } python_test() { @@ -69,5 +71,6 @@ python_test() { ) ;; esac + rm -rf pydantic || die epytest } |