Accepting request 860005 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/860005
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-libcst?expand=0&rev=4
This commit is contained in:
Dominique Leuenberger 2021-01-08 16:31:59 +00:00 committed by Git OBS Bridge
commit 7bbaa89857
5 changed files with 84 additions and 7 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2ce363a6c46ac0100f6b0f72f6a4dd2116e1e1d84259e229d580d30a6d086d84
size 409871

3
libcst-0.3.16.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:99c200004b6e845642eea7a433844d144994767f9ed50705171720b76d28cf7e
size 411727

View File

@ -1,3 +1,31 @@
-------------------------------------------------------------------
Sun Jan 3 21:02:37 UTC 2021 - Benjamin Greiner <code@bnavigator.de>
- Update to version 0.3.16
Added
* Support PEP-604 style unions in decorator annotations #429
* Gathering exports in augmented assignment statements #426
Fixed
* Don't allow out of order accesses in the global scope #431
* Handle scope ordering in For statements #430
* Fix for not parsing subscripts such as cast()["from"] #428
* Walrus operator's left hand side now has STORE expression
context #433
- Changes in 0.3.15
Added
* Support Named Unicode Characters and yield in f-strings #424
Fixed
* Assignment/access ordering in comprehensions #423
* Referencing of remaining objects in cast() #422
- refresh skip_failing_test.patch
-------------------------------------------------------------------
Sun Jan 3 16:38:46 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Add skip_failing_test.patch skipping test_ordering
(libcst.metadata.tests.test_scope_provider.ScopeProviderTest) which
doesn't work with Python 3.6 on i586 (gh#Instagram/LibCST#442).
-------------------------------------------------------------------
Sat Nov 21 00:16:24 UTC 2020 - Benjamin Greiner <code@bnavigator.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-libcst
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -27,12 +27,15 @@
%bcond_with test
%endif
Name: python-libcst%{psuffix}
Version: 0.3.14
Version: 0.3.16
Release: 0
Summary: Python 3.5+ concrete syntax tree with AST-like properties
License: MIT
URL: https://github.com/Instagram/LibCST
Source: https://files.pythonhosted.org/packages/source/l/libcst/libcst-%{version}.tar.gz
# PATCH-FIX-UPSTREAM skip_failing_test.patch gh#Instagram/LibCST#442 mcepl@suse.com
# test fails on i586 with Python 3.6
Patch0: skip_failing_test.patch
# isort needed for the code regeneration, code mod also on non test flavor
BuildRequires: %{python_module isort >= 5.5.3}
BuildRequires: %{python_module setuptools}
@ -47,14 +50,14 @@ Requires: python-dataclasses
%endif
%if %{with test}
BuildRequires: %{python_module PyYAML >= 5.2}
BuildRequires: (python3-dataclasses if python3-base < 3.7)
BuildRequires: (python36-dataclasses if python36-base)
# black needed for tests and the code regeneration
BuildRequires: %{python_module black}
BuildRequires: %{python_module hypothesis >= 4.36.0}
BuildRequires: %{python_module hypothesmith >= 0.0.4}
BuildRequires: %{python_module typing-inspect >= 0.4.0}
BuildRequires: %{python_module typing_extensions >= 3.7.4.2}
BuildRequires: (python3-dataclasses if python3-base < 3.7)
BuildRequires: (python36-dataclasses if python36-base)
%endif
%python_subpackages
@ -63,6 +66,8 @@ A concrete syntax tree with AST-like properties for Python 3.5+ programs.
%prep
%setup -q -n libcst-%{version}
%autopatch -p1
# fix executable
sed -i 's/"python"/sys.executable/' libcst/codemod/tests/test_codemod_cli.py

44
skip_failing_test.patch Normal file
View File

@ -0,0 +1,44 @@
Index: libcst-0.3.16/libcst/metadata/tests/test_scope_provider.py
===================================================================
--- libcst-0.3.16.orig/libcst/metadata/tests/test_scope_provider.py
+++ libcst-0.3.16/libcst/metadata/tests/test_scope_provider.py
@@ -5,6 +5,7 @@
import sys
+from sys import maxsize
from textwrap import dedent
from typing import Mapping, Tuple, cast
@@ -24,8 +25,9 @@ from libcst.metadata.scope_provider impo
ScopeProvider,
_gen_dotted_names,
)
-from libcst.testing.utils import UnitTest, data_provider
+from libcst.testing.utils import UnitTest, skipUnless, data_provider
+is_64bits = maxsize > 2**32
class DependentVisitor(cst.CSTVisitor):
METADATA_DEPENDENCIES = (ScopeProvider,)
@@ -1365,6 +1367,7 @@ class ScopeProviderTest(UnitTest):
}
self.assertEqual(names, {"a.b.c", "a.b", "a"})
+ @skipUnless(is_64bits, "Doesn't work on 32bit platforms")
def test_ordering(self) -> None:
m, scopes = get_scope_metadata_provider(
"""
Index: libcst-0.3.16/libcst/testing/utils.py
===================================================================
--- libcst-0.3.16.orig/libcst/testing/utils.py
+++ libcst-0.3.16/libcst/testing/utils.py
@@ -20,7 +20,7 @@ from typing import (
TypeVar,
Union,
)
-from unittest import TestCase
+from unittest import TestCase, skipUnless
DATA_PROVIDER_DATA_ATTR_NAME = "__data_provider_data"