From 305e8f1fd7157569c55c0b776c1bff2193c274d4 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Fri, 13 Jan 2023 15:55:37 +0100 Subject: [PATCH] python3-astroid: update to 2.13.2. --- ...ire-typing_extensions-on-Python-3.11.patch | 66 +++++++++++++++++++ srcpkgs/python3-astroid/template | 15 +++-- 2 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/python3-astroid/patches/0001-Do-not-require-typing_extensions-on-Python-3.11.patch diff --git a/srcpkgs/python3-astroid/patches/0001-Do-not-require-typing_extensions-on-Python-3.11.patch b/srcpkgs/python3-astroid/patches/0001-Do-not-require-typing_extensions-on-Python-3.11.patch new file mode 100644 index 00000000000..d36276db4d2 --- /dev/null +++ b/srcpkgs/python3-astroid/patches/0001-Do-not-require-typing_extensions-on-Python-3.11.patch @@ -0,0 +1,66 @@ +From 9555255e220554e3eab05257b1c39b4e635de18b Mon Sep 17 00:00:00 2001 +From: Michal Vasilek +Date: Fri, 13 Jan 2023 10:20:49 +0100 +Subject: [PATCH] Do not require typing_extensions on Python 3.11 + +19878a55e61ce8788db530240dba9570706a5aac added an unconditional +dependency on typing_extensions to fix tests with Python 3.10 3.11. +This commit fixes this issue by only requiring typing_extensions on +Python versions lower than 3.11 and using standard typing on Python 3.11 +and newer. +--- + ChangeLog | 2 ++ + pyproject.toml | 2 +- + tests/unittest_scoped_nodes.py | 7 +++++-- + 3 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 94208b67..5eb6c5e9 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -16,6 +16,8 @@ Release date: TBA + + Closes #1958 + ++* Remove unnecessary typing_extensions dependency on Python 3.11 and newer ++ + What's New in astroid 2.13.2? + ============================= + Release date: 2023-01-08 +diff --git a/pyproject.toml b/pyproject.toml +index 537bca9a..3fac032e 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -36,7 +36,7 @@ dependencies = [ + "wrapt>=1.14,<2;python_version>='3.11'", + "wrapt>=1.11,<2;python_version<'3.11'", + "typed-ast>=1.4.0,<2.0;implementation_name=='cpython' and python_version<'3.8'", +- "typing-extensions>=4.0.0", ++ "typing-extensions>=4.0.0;python_version<'3.11'", + ] + dynamic = ["version"] + +diff --git a/tests/unittest_scoped_nodes.py b/tests/unittest_scoped_nodes.py +index 39d21369..c59bdc3f 100644 +--- a/tests/unittest_scoped_nodes.py ++++ b/tests/unittest_scoped_nodes.py +@@ -1907,11 +1907,14 @@ class ClassNodeTest(ModuleLoader, unittest.TestCase): + import typing + import dataclasses + +- import typing_extensions ++ if sys.version_info >= (3, 8): ++ from typing import Protocol ++ else: ++ from typing_extensions import Protocol + + T = typing.TypeVar("T") + +- class MyProtocol(typing_extensions.Protocol): pass ++ class MyProtocol(Protocol): pass + class EarlyBase(typing.Generic[T], MyProtocol): pass + class Base(EarlyBase[T], abc.ABC): pass + class Final(Base[object]): pass +-- +2.39.0 + diff --git a/srcpkgs/python3-astroid/template b/srcpkgs/python3-astroid/template index 3a6925ceaf1..aa4df6e16c1 100644 --- a/srcpkgs/python3-astroid/template +++ b/srcpkgs/python3-astroid/template @@ -1,15 +1,20 @@ # Template file for 'python3-astroid' pkgname=python3-astroid -version=2.12.13 +version=2.13.2 revision=1 -build_style=python3-module -hostmakedepends="python3-setuptools" +build_style=python3-pep517 +hostmakedepends="python3-setuptools python3-wheel" depends="python3-lazy-object-proxy python3-wrapt" -checkdepends="$depends python3-pytest python3-numpy python3-typing_extensions" +checkdepends="$depends python3-pytest python3-numpy" short_desc="Abstract syntax tree for Python3" maintainer="Michal Vasilek " license="GPL-2.0-or-later, LGPL-2.1-or-later" homepage="https://github.com/PyCQA/astroid" changelog="https://raw.githubusercontent.com/PyCQA/astroid/master/ChangeLog" distfiles="https://github.com/PyCQA/astroid/archive/refs/tags/v$version.tar.gz" -checksum=f8002fe851dae5eea3d0e74be87bcb1ad6cd252277c713f0fe5d4f3564890a4c +checksum=c0be1d4323656f7b1d66f450fbe766b05709a02c4e5ebe5483b4c29b83891791 + +post_extract() { + # relax build tool version restrictions + vsed -e '/^requires =/s/~=[0-9.]\+//g' -i pyproject.toml +}