forked from pool/python-libcst
Accepting request 829578 from home:bnavigator:branches:devel:languages:python
- Update to v0.3.10 Added * Handle string annotations in ScopeProvider #373 * Add is_annotation subtype for Access inreferences. #372 Updated * Call pyre query with noninteractive logging #371 * Replace matchers with explicit visitation in gatherers #366 * Include missing test data in install #365 Fixed * Spaces around walrus operator are not required #368 * SaveMachedNode now matches with trailing empty wildcards #356 * Correctly extract wildcard matchers #355 - clean specfile multibuild - don't require own package on test flavor - require dataclasses for Python 3.6 distros - despite gh#Instagram/LibCST#365 says it's fixed, we still need to regenerate the code for tests => don't skip tests which actually pass after codegen - can use plain unittest again, same as upstream - define skip_python2 for Leap repositories OBS-URL: https://build.opensuse.org/request/show/829578 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=5
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the MIT license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree.
|
|
||||||
#
|
|
||||||
# pyre-strict
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
from contextlib import AsyncExitStack
|
|
||||||
|
|
||||||
|
|
||||||
def fun() -> None:
|
|
||||||
# this is an explicit syntax error to cause formatter error
|
|
||||||
async with AsyncExitStack() as stack:
|
|
||||||
stack
|
|
||||||
3
libcst-0.3.10.tar.gz
Normal file
3
libcst-0.3.10.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:b0dccbfc1cff7bfa3214980e1d2d90b4e00b2fed002d4b276a8a411217738df3
|
||||||
|
size 395395
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:b5185c84f0e4a38409aac59f53a71741bec8c1b1159c874996b3266daafe63e5
|
|
||||||
size 393996
|
|
||||||
@@ -1,3 +1,27 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 25 11:33:22 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- Update to v0.3.10
|
||||||
|
Added
|
||||||
|
* Handle string annotations in ScopeProvider #373
|
||||||
|
* Add is_annotation subtype for Access inreferences. #372
|
||||||
|
Updated
|
||||||
|
* Call pyre query with noninteractive logging #371
|
||||||
|
* Replace matchers with explicit visitation in gatherers #366
|
||||||
|
* Include missing test data in install #365
|
||||||
|
Fixed
|
||||||
|
* Spaces around walrus operator are not required #368
|
||||||
|
* SaveMachedNode now matches with trailing empty wildcards #356
|
||||||
|
* Correctly extract wildcard matchers #355
|
||||||
|
- clean specfile multibuild
|
||||||
|
- don't require own package on test flavor
|
||||||
|
- require dataclasses for Python 3.6 distros
|
||||||
|
- despite gh#Instagram/LibCST#365 says it's fixed, we still need to
|
||||||
|
regenerate the code for tests
|
||||||
|
=> don't skip tests which actually pass after codegen
|
||||||
|
- can use plain unittest again, same as upstream
|
||||||
|
- define skip_python2 for Leap repositories
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Aug 21 09:43:55 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
Fri Aug 21 09:43:55 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
|
%define skip_python2 1
|
||||||
%global flavor @BUILD_FLAVOR@%{nil}
|
%global flavor @BUILD_FLAVOR@%{nil}
|
||||||
%if "%{flavor}" == "test"
|
%if "%{flavor}" == "test"
|
||||||
%define psuffix -test
|
%define psuffix -test
|
||||||
@@ -26,31 +27,35 @@
|
|||||||
%bcond_with test
|
%bcond_with test
|
||||||
%endif
|
%endif
|
||||||
Name: python-libcst%{psuffix}
|
Name: python-libcst%{psuffix}
|
||||||
Version: 0.3.9
|
Version: 0.3.10
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Python 3.5+ concrete syntax tree with AST-like properties
|
Summary: Python 3.5+ concrete syntax tree with AST-like properties
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/Instagram/LibCST
|
URL: https://github.com/Instagram/LibCST
|
||||||
Source: https://files.pythonhosted.org/packages/source/l/libcst/libcst-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/l/libcst/libcst-%{version}.tar.gz
|
||||||
Source1: https://raw.githubusercontent.com/Instagram/LibCST/master/libcst/codemod/tests/codemod_formatter_error_input.py.txt
|
# isort needed for the code regeneration, code mod also on non test flavor
|
||||||
# all the deps over setuptools are for the generateor fix
|
|
||||||
BuildRequires: %{python_module black}
|
|
||||||
BuildRequires: %{python_module isort}
|
BuildRequires: %{python_module isort}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module typing-inspect >= 0.4.0}
|
|
||||||
BuildRequires: %{python_module typing_extensions >= 3.7.4.2}
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-PyYAML >= 5.2
|
Requires: python-PyYAML >= 5.2
|
||||||
Requires: python-typing-inspect >= 0.4.0
|
Requires: python-typing-inspect >= 0.4.0
|
||||||
Requires: python-typing_extensions >= 3.7.4.2
|
Requires: python-typing_extensions >= 3.7.4.2
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
%if %{python_version_nodots} < 37
|
||||||
|
Requires: python-dataclasses
|
||||||
|
%endif
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
|
%if %{python_version_nodots} < 37
|
||||||
|
BuildRequires: %{python_module dataclasses}
|
||||||
|
%endif
|
||||||
BuildRequires: %{python_module PyYAML >= 5.2}
|
BuildRequires: %{python_module PyYAML >= 5.2}
|
||||||
|
# black needed for tests and the code regeneration
|
||||||
|
BuildRequires: %{python_module black}
|
||||||
BuildRequires: %{python_module hypothesis >= 4.36.0}
|
BuildRequires: %{python_module hypothesis >= 4.36.0}
|
||||||
BuildRequires: %{python_module hypothesmith >= 0.0.4}
|
BuildRequires: %{python_module hypothesmith >= 0.0.4}
|
||||||
BuildRequires: %{python_module libcst >= %{version}}
|
BuildRequires: %{python_module typing-inspect >= 0.4.0}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module typing_extensions >= 3.7.4.2}
|
||||||
%endif
|
%endif
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
@@ -59,10 +64,10 @@ A concrete syntax tree with AST-like properties for Python 3.5+ programs.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n libcst-%{version}
|
%setup -q -n libcst-%{version}
|
||||||
cp %{SOURCE1} libcst/codemod/tests/
|
# fix executable
|
||||||
sed -i 's/"python"/"python3"/' libcst/codemod/tests/test_codemod_cli.py
|
sed -i 's/"python"/"python3"/' libcst/codemod/tests/test_codemod_cli.py
|
||||||
# https://github.com/Instagram/LibCST/issues/331
|
# https://github.com/Instagram/LibCST/issues/331
|
||||||
[ isort --version | grep "VERSION 4" ] || sed -i 's/"isort", "-y"/"isort"/' libcst/codegen/generate.py
|
isort --version | grep "VERSION 4" || sed -i 's/"isort", "-y"/"isort"/' libcst/codegen/generate.py
|
||||||
|
|
||||||
# Depends on optional pyre
|
# Depends on optional pyre
|
||||||
rm \
|
rm \
|
||||||
@@ -73,30 +78,25 @@ rm \
|
|||||||
# Test result depends on pyre
|
# Test result depends on pyre
|
||||||
sed -i 's/"error: .* stack:",/"Transformed 1 files successfully.",/' libcst/codemod/tests/test_codemod_cli.py
|
sed -i 's/"error: .* stack:",/"Transformed 1 files successfully.",/' libcst/codemod/tests/test_codemod_cli.py
|
||||||
|
|
||||||
|
%if !%{with test}
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
%python_install
|
%python_install
|
||||||
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with test}
|
||||||
|
%check
|
||||||
%{python_expand # https://github.com/Instagram/LibCST/issues/331
|
%{python_expand # https://github.com/Instagram/LibCST/issues/331
|
||||||
export PYTHONPATH=%{buildroot}%{$python_sitelib}
|
|
||||||
$python -m libcst.codegen.generate visitors
|
$python -m libcst.codegen.generate visitors
|
||||||
$python -m libcst.codegen.generate return_types
|
$python -m libcst.codegen.generate return_types
|
||||||
$python -m libcst.codegen.generate matchers
|
$python -m libcst.codegen.generate matchers
|
||||||
|
|
||||||
rm -r %{buildroot}%{$python_sitelib}/libcst/tests/ \
|
|
||||||
%{buildroot}%{$python_sitelib}/libcst/*/tests/ \
|
|
||||||
%{buildroot}%{$python_sitelib}/libcst/*/*/tests/
|
|
||||||
|
|
||||||
%fdupes %{buildroot}%{$python_sitelib}
|
|
||||||
}
|
}
|
||||||
%endif
|
%pyunittest -v
|
||||||
|
|
||||||
%check
|
|
||||||
%if %{with test}
|
|
||||||
# the two tests pass in non-multibuild setup, just skip them here
|
|
||||||
%pytest -k 'not test_codegen_clean_return_types and not test_codegen_clean_visitor_functions'
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
|
|||||||
Reference in New Issue
Block a user