## START: Set by rpmautospec ## (rpmautospec version 0.8.4) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 4; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # need updated libcst to update hypothesmith # and older hypothesmith does not work with newer hypothesis %bcond bootstrap 0 %bcond tests %{without bootstrap} # Use --with all_tests to run all tests %bcond all_tests 0 Name: python-libcst Version: 1.8.6 Release: %autorelease Summary: A concrete syntax tree with AST-like properties for Python 3 # see LICENSE in the upstream sources for the breakdown License: MIT AND (MIT AND PSF-2.0) AND Apache-2.0 URL: https://github.com/Instagram/LibCST Source: %{pypi_source libcst} # * drop unused, benchmark-only criterion and rayon dev-dependencies # * update PyO3 to 0.29 (requires an accompanying source-code patch): # https://github.com/Instagram/LibCST/pull/1454#issuecomment-4902787314 Patch: libcst-fix-metadata.diff # Source-code patch from https://github.com/Instagram/LibCST/pull/1454 for # updating PyO3 from 0.26 to 0.28 Patch: libcst-1.8.6-pyo3-0.28.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: python3-devel %if %{with tests} # test dependencies are intermingled with dev dependencies # so list them manually for now BuildRequires: python3dist(pytest) %endif %global _description %{expand: LibCST parses Python source code as a CST tree that keeps all formatting details (comments, whitespaces, parentheses, etc). It's useful for building automated refactoring (codemod) applications and linters. LibCST creates a compromise between an Abstract Syntax Tree (AST) and a traditional Concrete Syntax Tree (CST). By carefully reorganizing and naming node types and fields, it creates a lossless CST that looks and feels like an AST.} %description %_description %package -n python3-libcst Summary: %{summary} # (MIT OR Apache-2.0) AND Unicode-3.0 # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # MIT # MIT AND (MIT AND PSF-2.0) # MIT OR Apache-2.0 # Unlicense OR MIT License: %{shrink: MIT AND (MIT AND PSF-2.0) AND Apache-2.0 AND (MIT OR Apache-2.0) AND Unicode-3.0 AND Unicode-DFS-2016 AND (Unlicense OR MIT) } # LICENSE.dependencies contains a full license breakdown # Documentation is hard to build since libcst.native is not available to import until %%install Obsoletes: python-libcst-doc < 1.1.0-1 %description -n python3-libcst %_description %prep %autosetup -N -n libcst-%{version} # Apply patches up to 99 %autopatch -p1 -M 99 # remove version locks rm native/Cargo.lock %cargo_prep %generate_buildrequires for p in libcst_derive libcst; do cd native/$p # dev dependencies need to be included, setuptools_rust seems to include them unconditionally %cargo_generate_buildrequires -t cd ../.. done %pyproject_buildrequires %build export RUSTFLAGS="%{build_rustflags}" # write license summary and breakdown cd native %{cargo_license_summary} %{cargo_license} > ../LICENSE.dependencies cd .. %pyproject_wheel %install %pyproject_install %pyproject_save_files -l libcst %check %pyproject_check_import -e 'libcst.tests.*' %if %{with tests} mod='%{buildroot}%{python3_sitearch}/libcst' # Omit fuzz tests. These don’t make much sense downstream, and would require # hypothesmith, which hasn’t been successfully rebuilt for Python 3.15. ignore="${ignore-} --ignore=${mod}/tests/test_fuzz.py" %if %{without all_tests} ignore="${ignore-} --ignore=${mod}/codegen/tests/test_codegen_clean.py" ignore="${ignore-} --ignore=${mod}/metadata/tests/test_type_inference_provider.py" %endif # A few tests aren’t practical to run when not building in-place # Some kind of PYTHONPATH issue, it looks like ignore="${ignore-} --ignore=${mod}/codemod/tests/test_codemod_cli.py" # Broken path to fixtures for native tests (tries to find them at # %%{buildroot}%%{python3_sitearch/native/libcst/tests/fixtures) ignore="${ignore-} --ignore=${mod}/tests/test_roundtrip.py" # Pure-Python parser LIBCST_PARSER_TYPE=pure %pytest --import-mode=append ${ignore-} -v "${mod}" # Rust (native) parser %pytest --import-mode=append ${ignore-} -k "${k-}" -v "${mod}" %dnl Cargo tests fail to build on ppc64le due to a linker error related to the %dnl Python C API. It’s not obvious what’s going wrong here. %ifnarch %{power64} cd native %cargo_test %endif %endif %files -n python3-libcst -f %{pyproject_files} %changelog ## START: Generated by rpmautospec * Wed Jul 08 2026 Benjamin A. Beasley - 1.8.6-4 - Don’t attempt cargo tests on ppc64le due to a linker error * Tue Jul 07 2026 Benjamin A. Beasley - 1.8.6-3 - Update PyO3 to 0.29 (fixes RUSTSEC-2026-0176, RUSTSEC-2026-0177) * Tue Jul 07 2026 Benjamin A. Beasley - 1.8.6-2 - Also run cargo tests for native (Rust) parser * Tue Jul 07 2026 Benjamin A. Beasley - 1.8.6-1 - Update to 1.8.6 (close RHBZ#2368777) * Tue Jul 07 2026 Benjamin A. Beasley - 1.8.0-12 - Let LICENSE.dependencies be included in the .dist-info * Tue Jul 07 2026 Benjamin A. Beasley - 1.8.0-11 - Test both the pure-Python parser and the Rust parser * Tue Jul 07 2026 Benjamin A. Beasley - 1.8.0-10 - Drop the hypothesmith test dependency (omit fuzz tests) - Also drop hypothesis since it is also only used for fuzz tests * Tue Jul 07 2026 Benjamin A. Beasley - 1.8.0-9 - Simplify and update build conditionals * Wed Jun 03 2026 Python Maint - 1.8.0-8 - Rebuilt for Python 3.15 * Sat Jan 17 2026 Fedora Release Engineering - 1.8.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild * Fri Sep 19 2025 Python Maint - 1.8.0-6 - Rebuilt for Python 3.14.0rc3 bytecode * Fri Aug 15 2025 Python Maint - 1.8.0-5 - Rebuilt for Python 3.14.0rc2 bytecode * Fri Jul 25 2025 Fedora Release Engineering - 1.8.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild * Wed Jun 04 2025 Python Maint - 1.8.0-3 - Rebuilt for Python 3.14 * Tue Jun 03 2025 Python Maint - 1.8.0-2 - Bootstrap for Python 3.14 * Wed May 28 2025 Karolina Surma - 1.8.0-1 - Update to 1.8.0 * Thu Mar 20 2025 Michel Lind - 1.7.0-1 - Update to 1.7.0; Fixes: RHBZ#2351860 * Fri Feb 21 2025 Fabio Valentini - 1.6.0-2 - Apply minor patch for compatibility with annotate-snippets 0.11 * Tue Jan 21 2025 Fabio Valentini - 1.6.0-1 - Update to version 1.6.0; Fixes RHBZ#2317826 * Sat Jan 18 2025 Fedora Release Engineering - 1.4.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Tue Aug 13 2024 Michel Lind - 1.4.0-1 - Update to version 1.4.0; Fixes: RHBZ#2264887 * Fri Jul 19 2024 Fedora Release Engineering - 1.1.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sat Jun 08 2024 Python Maint - 1.1.0-4 - Rebuilt for Python 3.13 * Fri Jun 07 2024 Python Maint - 1.1.0-3 - Bootstrap for Python 3.13 * Thu Feb 01 2024 Michel Lind - 1.1.0-2 - Rebuild with tests enabled * Wed Jan 31 2024 Michel Lind - 1.1.0-1 - Update to 1.1.0 * Fri Jan 26 2024 Fedora Release Engineering - 0.4.10-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 0.4.10-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Fri Oct 27 2023 Miro Hrončok - 0.4.10-2 - Fix build --without tests * Wed Sep 06 2023 Michel Lind - 0.4.10-1 - Update to 0.4.10 - Use SPDX license identifiers - Modernize to use the new Python packaging guidelines * Fri Jul 21 2023 Fedora Release Engineering - 0.3.21-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Mon Jul 10 2023 Python Maint - 0.3.21-9 - Rebuilt for Python 3.12 * Tue Jun 13 2023 Python Maint - 0.3.21-8 - Bootstrap for Python 3.12 * Wed Feb 22 2023 Yaakov Selkowitz - 0.3.21-7 - Disable docs and tests by default in ELN builds * Fri Jan 20 2023 Fedora Release Engineering - 0.3.21-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Jul 22 2022 Fedora Release Engineering - 0.3.21-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Sat Jul 16 2022 Python Maint - 0.3.21-4 - Rebuilt for Python 3.11 * Mon Jun 20 2022 Python Maint - 0.3.21-3 - Bootstrap for Python 3.11 * Fri Jan 21 2022 Fedora Release Engineering - 0.3.21-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Sun Nov 07 2021 Davide Cavalca - 0.3.21-1 - Update to 0.3.21; Fixes: RHBZ#1960292, RHBZ#1959007 * Sun Nov 07 2021 Davide Cavalca - 0.3.18-7 - Drop logic for Fedora 32 * Fri Jul 23 2021 Fedora Release Engineering - 0.3.18-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Mon Jun 07 2021 Python Maint - 0.3.18-4 - Rebuilt for Python 3.10 * Fri Jun 04 2021 Python Maint - 0.3.18-3 - Bootstrap for Python 3.10 * Wed Apr 21 2021 Tomas Hrnciar - 0.3.18-2 - Add bcond to disable tests to avoid dependency loop on python-hypothesmith * Sat Apr 03 2021 Davide Cavalca - 0.3.18-1 - Update to 0.3.18 - Add hypothesmith to BuildRequires and enable back some more tests * Wed Mar 03 2021 Davide Cavalca - 0.3.17-4 - Fix intersphinx inventory path - Fix %%py_provides gating * Wed Mar 03 2021 Davide Cavalca - 0.3.17-3 - Fix docs build and enable it by default * Tue Mar 02 2021 Davide Cavalca - 0.3.17-2 - Fix license - Switch to GitHub tarball - Add docs build (disabled by default) - Switch to pytest and document ignored tests * Tue Mar 02 2021 Davide Cavalca - 0.3.17-1 - Initial package. ## END: Generated by rpmautospec