python-libcst/python-libcst.spec
Markéta Machová ec3880cbff Accepting request 849770 from home:bnavigator:branches:devel:languages:python
- Update to version 0.3.14
  Fixed
  * Fix is_annotation for types used in classdef base and assign
    value [#406]
  * Visit concatenated f-strings during scope analysis [#411]
  * Correct handling of walrus operator in function args [#417]
  * Allow generator expressions in f-strings [#419]
  * Keep track of assignment/access ordering during scope analysis
    [#413]
  * Handle string type references in cast() during scope analysis 
    [#418]
- 0.3.13
  Fixed
  * Use correct type for AugAssign and AnnAssign target [#396]
  * Support string annotations for type aliases [#401]
- 0.3.12
  Fixed
  * fix RemoveImportsVisitor crash when ImportAlias is 
    inserted without comma [#397]
  * Provide STORE for {Class,Function}Def.name in 
    ExpressionContextProvider [#394]
- 0.3.11
  Added
  * Implement TypeOf matcher [#384]
  Updated
  * Update return type of ParentNodeProvider to be CSTNode [#377]
  * Add source code links to each class/function [#378]
  Fixed
  * Removing an import alias with a trailing standalone 
    comment should preserve the comment [#392]

OBS-URL: https://build.opensuse.org/request/show/849770
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=7
2020-11-23 09:25:48 +00:00

100 lines
3.0 KiB
RPMSpec

#
# spec file for package python-libcst
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-libcst%{psuffix}
Version: 0.3.14
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
# isort needed for the code regeneration, code mod also on non test flavor
BuildRequires: %{python_module isort >= 5.5.3}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-PyYAML >= 5.2
Requires: python-typing-inspect >= 0.4.0
Requires: python-typing_extensions >= 3.7.4.2
BuildArch: noarch
%if %{python_version_nodots} < 37
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}
%endif
%python_subpackages
%description
A concrete syntax tree with AST-like properties for Python 3.5+ programs.
%prep
%setup -q -n libcst-%{version}
# fix executable
sed -i 's/"python"/sys.executable/' libcst/codemod/tests/test_codemod_cli.py
# Depends on optional pyre
rm \
libcst/metadata/tests/test_type_inference_provider.py \
libcst/metadata/tests/test_full_repo_manager.py \
libcst/tests/test_pyre_integration.py
%if !%{with test}
%build
%python_build
%endif
%install
%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
%pyunittest -v
%endif
%if !%{with test}
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/libcst
%{python_sitelib}/libcst-%{version}-py*.egg-info
%endif
%changelog