14
0
forked from pool/python-libcst

15 Commits

Author SHA256 Message Date
2a86d019fb Accepting request 1313292 from devel:languages:python
- Update to 1.8.5:
  * Added
    + Support parsing of t-strings
    + add helper to convert nodes to matchers
    + Allow configuring empty formatter lists in codemod CLI
    + Enable support for free-threaded CPython
    + Expose TypeAlias and TypeVar related structs in rust library
    + FullyQualifiedNameProvider: Optionally consider pyproject.toml files
      when determining a file's module name and package
    + Add validation for If node
    + include python 3.13 in build
  * Fixed
    + generate Attribute nodes when applying type annotations
    + Avoid raising bare Exception
    + fix various Match statement visitation errors
    + Mention codemod -x flag in docs
    + Clear warnings for each file in codemod cli
    + Typo fix in codemods_tutorial.rst (trivial)
    + fix certain matchers breaking under multiprocessing by initializing
      them late
  * Updated
    + update pyo3 to 0.25
    + Replace multiprocessing with ProcessPoolExecutor
    + Support pipe syntax for Union types in codegen
    + Remove dependency on chic and upgrade annotate-snippets
    + make libcst_native::tokenizer public
- Drop patch pyo3-022.patch, no longer required.
- Do not build the package when running the testsuite.
- Reinstate running the testsuite.

OBS-URL: https://build.opensuse.org/request/show/1313292
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-libcst?expand=0&rev=11
2025-10-27 13:37:59 +00:00
d4de30e648 - Update to 1.8.5:
* Added
    + Support parsing of t-strings
    + add helper to convert nodes to matchers
    + Allow configuring empty formatter lists in codemod CLI
    + Enable support for free-threaded CPython
    + Expose TypeAlias and TypeVar related structs in rust library
    + FullyQualifiedNameProvider: Optionally consider pyproject.toml files
      when determining a file's module name and package
    + Add validation for If node
    + include python 3.13 in build
  * Fixed
    + generate Attribute nodes when applying type annotations
    + Avoid raising bare Exception
    + fix various Match statement visitation errors
    + Mention codemod -x flag in docs
    + Clear warnings for each file in codemod cli
    + Typo fix in codemods_tutorial.rst (trivial)
    + fix certain matchers breaking under multiprocessing by initializing
      them late
  * Updated
    + update pyo3 to 0.25
    + Replace multiprocessing with ProcessPoolExecutor
    + Support pipe syntax for Union types in codegen
    + Remove dependency on chic and upgrade annotate-snippets
    + make libcst_native::tokenizer public
- Drop patch pyo3-022.patch, no longer required.
- Do not build the package when running the testsuite.
- Reinstate running the testsuite.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=38
2025-10-24 01:47:58 +00:00
ea2db36096 first shot at 1.8.5
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=37
2025-10-23 02:26:21 +00:00
1e5d5da4a7 Accepting request 1199686 from devel:languages:python
- Add pyo3-022.patch bumping the dependency of pyo3 to 0.22
  (gh#Instagram/LibCST!1180).

OBS-URL: https://build.opensuse.org/request/show/1199686
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-libcst?expand=0&rev=10
2024-09-10 19:12:28 +00:00
13880de221 Fix patches and build system.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=35
2024-09-09 12:22:44 +00:00
60e473bc48 - Add pyo3-022.patch bumping the dependency of pyo3 to 0.22
(gh#Instagram/LibCST!1180).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=34
2024-09-09 11:39:04 +00:00
a38fda0232 Update SPEC file
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=33
2024-07-30 18:31:35 +00:00
cfed6da62a Accepting request 1189034 from devel:languages:python
- Upgrade to 1.4.0:
  - Fix Literal parse error in RemoveImportsVisitor
  - Don't reset context.scratch between files
  - Various documentation fixes
        Typo fix FullRepoManager
        ✏️ Fix tiny typo in docs/source/metadata.rst
        ✏️ Fix typo in docs/source/scope_tutorial.ipynb
        Update CONTRIBUTING.md
  - Add helper functions for common ways of filtering nodes
  - Dump CST to .dot (graphviz) files
  - Implement PEP-696
- Upgrade to 1.3.1:
  - ImportError due to missing mypy_extensions dependency
- Upgrade to 1.3.0:
  - Removed dependencies on typing_extensions and typing_inspect
- Temporarily switch off running of the test suite (gh#Instagram/LibCST#1176)

- 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

OBS-URL: https://build.opensuse.org/request/show/1189034
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-libcst?expand=0&rev=9
2024-07-24 13:33:03 +00:00
fd4a60d508 Correct calling %pyunittest
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=31
2024-07-22 12:48:32 +00:00
54895e0d6c No, do delete _multibuild
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=30
2024-07-22 11:54:17 +00:00
2879455b4e Fix switching off tests
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=29
2024-07-22 11:53:43 +00:00
3371b242bf Fix switching off tests
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=28
2024-07-22 11:51:27 +00:00
040d94e898 Fix switching off tests
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=27
2024-07-22 11:49:54 +00:00
568ae33f3c - Upgrade to 1.4.0:
- Fix Literal parse error in RemoveImportsVisitor
  - Don't reset context.scratch between files
  - Various documentation fixes
        Typo fix FullRepoManager
        ✏️ Fix tiny typo in docs/source/metadata.rst
        ✏️ Fix typo in docs/source/scope_tutorial.ipynb
        Update CONTRIBUTING.md
  - Add helper functions for common ways of filtering nodes
  - Dump CST to .dot (graphviz) files
  - Implement PEP-696
- Upgrade to 1.3.1:
  - ImportError due to missing mypy_extensions dependency
- Upgrade to 1.3.0:
  - Removed dependencies on typing_extensions and typing_inspect
- Temporarily switch off running of the test suite (gh#Instagram/LibCST#1176)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libcst?expand=0&rev=26
2024-07-22 11:47:40 +00:00
7214b3e593 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
10 changed files with 180 additions and 119 deletions

View File

@@ -1,10 +1,7 @@
<services>
<service name="cargo_vendor" mode="disabled">
<param name="srcdir">libcst-0.4.9/native</param>
<param name="compression">xz</param>
<service name="cargo_vendor" mode="manual">
<param name="srcdir">libcst-*.tar.gz</param>
<param name="cargotoml">native/Cargo.toml</param>
<param name="update">true</param>
</service>
<service name="cargo_audit" mode="disabled">
<param name="srcdir">libcst-0.4.9/native</param>
</service>
</services>

View File

@@ -1,5 +0,0 @@
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"

BIN
libcst-0.4.9.tar.gz (Stored with Git LFS)

Binary file not shown.

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

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

View File

@@ -1,3 +1,145 @@
-------------------------------------------------------------------
Fri Oct 24 01:47:06 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 1.8.5:
* Added
+ Support parsing of t-strings
+ add helper to convert nodes to matchers
+ Allow configuring empty formatter lists in codemod CLI
+ Enable support for free-threaded CPython
+ Expose TypeAlias and TypeVar related structs in rust library
+ FullyQualifiedNameProvider: Optionally consider pyproject.toml files
when determining a file's module name and package
+ Add validation for If node
+ include python 3.13 in build
* Fixed
+ generate Attribute nodes when applying type annotations
+ Avoid raising bare Exception
+ fix various Match statement visitation errors
+ Mention codemod -x flag in docs
+ Clear warnings for each file in codemod cli
+ Typo fix in codemods_tutorial.rst (trivial)
+ fix certain matchers breaking under multiprocessing by initializing
them late
* Updated
+ update pyo3 to 0.25
+ Replace multiprocessing with ProcessPoolExecutor
+ Support pipe syntax for Union types in codegen
+ Remove dependency on chic and upgrade annotate-snippets
+ make libcst_native::tokenizer public
- Drop patch pyo3-022.patch, no longer required.
- Do not build the package when running the testsuite.
- Reinstate running the testsuite.
-------------------------------------------------------------------
Mon Sep 9 11:38:15 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Add pyo3-022.patch bumping the dependency of pyo3 to 0.22
(gh#Instagram/LibCST!1180).
-------------------------------------------------------------------
Mon Jul 22 10:24:31 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Upgrade to 1.4.0:
- Fix Literal parse error in RemoveImportsVisitor
- Don't reset context.scratch between files
- Various documentation fixes
Typo fix FullRepoManager
✏️ Fix tiny typo in docs/source/metadata.rst
✏️ Fix typo in docs/source/scope_tutorial.ipynb
Update CONTRIBUTING.md
- Add helper functions for common ways of filtering nodes
- Dump CST to .dot (graphviz) files
- Implement PEP-696
- Upgrade to 1.3.1:
- ImportError due to missing mypy_extensions dependency
- Upgrade to 1.3.0:
- Removed dependencies on typing_extensions and typing_inspect
- Temporarily switch off running of the test suite (gh#Instagram/LibCST#1176)
-------------------------------------------------------------------
Fri Mar 1 00:29:21 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
- 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
* Support files with mixed newlines
* PEP 695 - Type Parameter Syntax
* Remove need for regex in TextPosition::matches
* Fix readme's Python version requirement
* Switch to using thread_local regular expressions to avoid regex mutex contention
* Remove criterion-cycles-per-byte dependency and related benchmark measurement
* drop support for Python 3.7
* Don't gather dirs ending .py
* Don't insert duplicate imports
* Don't swallow trailing whitespace
* Allow pyo3 >=0.17
* Do not annotate the same variable multiple times in ApplyTypeAnnotationsVisitor
* Update changelog to 1.0.1
* Codemod CLI: Print diff only when there is a change
* Fix parsing of code without trailing newlines
* Fix whitespace, fstring, walrus related parse errors
* Fix Sentinal typo
* remove quotes around charset in .editorconfig
* Update maturin requirement from <0.14,>=0.8.3 to >=0.8.3,<0.16
* Fix type of `evaluated_value` on string to allow bytes
* Switch default parser implementation to native
* exclude native/target directory from sdist
* update changelog
* relax validation rules on decorators
* Fix crash on escaped backslashes in rf-string
* Fix pyre setup link in metadata.rst
* Support PEP 604 in ApplyTypeAnnotationsVisitor
* Fix spelling and grammar in some comments
* Fix ApplyTypeAnnotationsVisitor behavior on attribute assignments.
* Allow running codemods without configuring in YAML
* Ensure current Python interpreter is used for subprocesses
* Use subprocess.DEVNULL instead of opening os.devnull by hand
* PEP 621 + hatch to run tests/lint/etc
* Fix: relative imports from '' package are not allowed
* Add new FilePathProvider
* Use new setup-python caching actions
* Pass root path to FullyQualifiedNameProvider
* Script to regenerate test fixtures
* Add setuptools-rust to build requirements in setup.py
* Ignore common virtualenv names
* Fix Github issue 855 - fail to parse with statement
* fix PEP 604 union annotations in decorators
* Add py3.11 classifier
- Update _service file
* remove obsoleted mode "disabled" to "manual"
* adopt new obs-service-cargo packaging method
- Remove patches
* remove-ufmt-dep.patch
* replace-python-call.patch
-------------------------------------------------------------------
Fri Apr 21 12:27:55 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file
# spec file for package python-libcst
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,8 +16,6 @@
#
%define skip_python2 1
%define rustflags '-Clink-arg=-Wl,-z,relro,-z,now'
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
@@ -29,19 +27,15 @@
%define modname libcst
%{?sle15_python_module_pythons}
Name: python-libcst%{psuffix}
Version: 0.4.9
Version: 1.8.5
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.xz
Source2: cargo_config
# PATCH-FIX-OPENSUSE remove-ufmt-dep.patch python-ufmt package doesn't exists in Tumbleweed
Patch0: remove-ufmt-dep.patch
# PATCH-FIX-OPENSUSE replace-python-call.patch
# wrong executable call when outside of venv (gh#Instagram/LibCST#468)
Patch1: replace-python-call.patch
Source0: https://files.pythonhosted.org/packages/source/l/libcst/%{modname}-%{version}.tar.gz
Source1: vendor.tar.zst
BuildRequires: %{python_module base >= 3.9}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools-rust}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
@@ -50,20 +44,15 @@ BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: rust
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}
BuildRequires: %{python_module libcst = %{version}}
%endif
%python_subpackages
@@ -71,52 +60,43 @@ BuildRequires: %{python_module typing_extensions >= 3.7.4.2}
A concrete syntax tree with AST-like properties for Python 3.5+ programs.
%prep
%setup -q -n libcst-%{version}
tar x -C native/ -f %{SOURCE1}
cp -rf native/vendor vendor
mkdir -p .cargo && echo "" >> .cargo/config.toml && cat %{SOURCE2} >>.cargo/config.toml
%autosetup -a1 -n libcst-%{version} -p1
pushd native
mkdir -p .cargo
cat %{SOURCE2} >>.cargo/config.toml
popd
# # 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
%autopatch -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
%if %{without test}
export CARGO_NET_OFFLINE=true PROFILE=release CARGO_HOME=$PWD/native/.cargo
%pyproject_wheel
%endif
%install
%if !%{with test}
%if %{without test}
export CARGO_NET_OFFLINE=true PROFILE=release
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%pyproject_install
# gh#Instagram/LibCST#818
%{python_expand rm -rf %{buildroot}%{$python_sitearch}/libcst/tests
%fdupes %{buildroot}%{$python_sitearch}
}
%endif
%if %{with test}
%check
%python_exec -m libcst.codegen.generate all
%pyunittest -v
pushd libcst/tests
%python_exec -m unittest discover -v
popd
%endif
%if !%{with test}
%if %{without test}
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitearch}/libcst
%{python_sitearch}/libcst-%{version}-py*.egg-info
%{python_sitearch}/libcst-%{version}.dist-info
%endif
%changelog

View File

@@ -1,17 +0,0 @@
Index: libcst-0.4.9/libcst/codegen/generate.py
===================================================================
--- libcst-0.4.9.orig/libcst/codegen/generate.py
+++ libcst-0.4.9/libcst/codegen/generate.py
@@ -25,8 +25,10 @@ from libcst.codegen.transforms import (
def format_file(fname: str) -> None:
- with open(os.devnull, "w") as devnull:
- subprocess.check_call(["ufmt", "format", fname], stdout=devnull, stderr=devnull)
+ # Do not format to avoid ufmt dependency that's not yet in opensuse
+ pass
+ # with open(os.devnull, "w") as devnull:
+ # subprocess.check_call(["ufmt", "format", fname], stdout=devnull, stderr=devnull)
def clean_generated_code(code: str) -> str:

View File

@@ -1,36 +0,0 @@
---
libcst/codegen/generate.py | 2 +-
libcst/codemod/tests/test_codemod_cli.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
--- a/libcst/codegen/generate.py
+++ b/libcst/codegen/generate.py
@@ -69,7 +69,7 @@ def codegen_visitors() -> None:
# by attempting to run codegen again in a new process.
with open(os.devnull, "w") as devnull:
subprocess.check_call(
- ["python3", "-m", "libcst.codegen.gen_visitor_functions"],
+ [sys.executable, "-m", "libcst.codegen.gen_visitor_functions"],
cwd=base,
stdout=devnull,
)
--- a/libcst/codemod/tests/test_codemod_cli.py
+++ b/libcst/codemod/tests/test_codemod_cli.py
@@ -4,7 +4,7 @@
# LICENSE file in the root directory of this source tree.
#
-
+import sys
import subprocess
from pathlib import Path
@@ -16,7 +16,7 @@ class TestCodemodCLI(UnitTest):
def test_codemod_formatter_error_input(self) -> None:
rlt = subprocess.run(
[
- "python",
+ sys.executable,
"-m",
"libcst.tool",
"codemod",

BIN
vendor.tar.xz (Stored with Git LFS)

Binary file not shown.

3
vendor.tar.zst Normal file
View File

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