14
0
forked from pool/python-libcst
Files
python-libcst/python-libcst.spec
Matej Cepl e696634f39 Accepting request 1153705 from home:uncomfyhalomacro:branches:devel:languages:python
- Update to version 1.2.0
  * Upgrade pyo3 to 0.20
  * Remove reference to distutil
  * Add roundtrip tests from Python
  * Fix parsing list matchers without explicit brackets
  * Make readme example use python syntax highlighting
  * Upgrade rust to version 1.70 in readthedocs config
  * Update maturin requirement from <0.16,>=0.8.3 to >=0.8.3,<1.5
  * Allow `Element::codegen` to be used by external users
  * installing rustc/cargo for mybinder demo
  * Update test_fix_pyre_directives.py
  * remove 3.8 support
  * Update syn to v2
  * Set repository metadata entry for Rust crates
  * upgrade flake8
  * Update pyproject.toml for Python 3.12 support
  * fix filepathprovider generic type
  * Update README.rst
  * Fix link in type_inference_provider.py
  * Parse multiline expressions in f-strings
  * Upgrade pyre
  * eliminate relative paths from Cargo.toml
  * Parse arbitrarily nested f-strings
  * ScopeProvider: Record Access for Attributes and Decorators
  * AddImportsVisitor: add imports before the first non-import statement
  * Scope provider changes for type annotations
  * add upper bound to pyo3 dependency
  * scope_provider: Simplify parent resolution
  * parser: remove Regexes from whitespace parser
  * Add crate metadata

OBS-URL: https://build.opensuse.org/request/show/1153705
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=25
2024-03-01 20:28:12 +00:00

107 lines
3.2 KiB
RPMSpec

#
# spec file for package python-libcst
#
# Copyright (c) 2024 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/
#
%define skip_python2 1
%define rustflags '-Clink-arg=-Wl,-z,relro,-z,now'
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%define modname libcst
%{?sle15_python_module_pythons}
Name: python-libcst%{psuffix}
Version: 1.2.0
Release: 0
Summary: Python 3.5+ concrete syntax tree with AST-like properties
License: MIT
URL: https://github.com/Instagram/LibCST
Source0: https://files.pythonhosted.org/packages/source/l/%{modname}/%{modname}-%{version}.tar.gz
Source1: vendor.tar.zst
BuildRequires: %{python_module setuptools-rust}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: zstd
Requires: python-PyYAML >= 5.2
Requires: python-typing-inspect >= 0.4.0
Requires: python-typing_extensions >= 3.7.4.2
Requires: (python-dataclasses if python-base < 3.7)
%if %{with test}
# black and isort needed for tests and the code regeneration
BuildRequires: %{python_module PyYAML >= 5.2}
BuildRequires: %{python_module black}
BuildRequires: %{python_module dataclasses if %python-base < 3.7}
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
%autosetup -a1 -n libcst-%{version} -p1
# 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
# gh#Instagram/LibCST#467
sed -i -e 's/import AbstractBaseMatcherNodeMeta/import Optional, AbstractBaseMatcherNodeMeta/' libcst/codegen/gen_matcher_classes.py
%if !%{with test}
%build
export CARGO_NET_OFFLINE=true PROFILE=release
%python_build
%endif
%install
%if !%{with test}
export CARGO_NET_OFFLINE=true PROFILE=release
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%endif
%if %{with test}
%check
%python_exec -m libcst.codegen.generate all
%pyunittest -v
%endif
%if !%{with test}
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitearch}/libcst
%{python_sitearch}/libcst-%{version}-py*.egg-info
%endif
%changelog