%global _default_patch_fuzz 2 %bcond_without check # reduce peak memory usage %constrain_build -m 4096 Name: ruff Version: 0.6.4 Release: 0.1 Summary: Extremely fast Python linter and code formatter SourceLicense: MIT # to generate this list, remove '--offline' from # rpm --eval %%{cargo_license_summary} and run # that script in mock --shell --enable-network # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # Apache-2.0 # Apache-2.0 OR BSD-2-Clause # Apache-2.0 OR BSL-1.0 # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-2-Clause OR Apache-2.0 OR MIT # BSD-2-Clause-Views # BSD-3-Clause # CC0-1.0 # ISC # MIT # MIT AND BSD-3-Clause # MIT OR Apache-2.0 # MIT OR Apache-2.0 OR Zlib # MIT OR BSD-3-Clause # MPL-2.0 # Unlicense OR MIT # WTFPL # Zlib OR Apache-2.0 OR MIT License: (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Apache-2.0 AND (Apache-2.0 OR BSD-2-Clause) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-2-Clause-Views AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND MIT AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR BSD-3-Clause) AND (Unlicense OR MIT) AND WTFPL URL: https://github.com/astral-sh/ruff Source: %{url}/archive/v%{version}/ruff-%{version}.tar.gz # * drop Windows-specific dependencies (non-upstreamable), generated with: # "for i in $(find -name Cargo.toml) ; do rust2rpm-helper strip-foreign $i -o $i ; done" Patch: 0001-drop-Windows-specific-dependencies.patch ## * drop unavailable compile-time diagnostics feature for UUIDs (non-upstreamable) #Patch: 0002-drop-unavailable-features-from-uuid-dependency.patch ## * drop unavailable custom memory allocators (non-upstreamable) #Patch: 0003-remove-unavailable-custom-allocators.patch # * do not strip debuginfo from the built executable (non-upstreamable) Patch: 0004-do-not-strip-debuginfo-from-built-binary-executable.patch ExcludeArch: %{ix86} BuildRequires: cargo-rpm-macros >= 24 BuildRequires: git-core BuildRequires: maturin BuildRequires: python3-devel BuildRequires: python3-installer BuildRequires: python3-pip %description An extremely fast Python linter and code formatter, written in Rust. Ruff aims to be orders of magnitude faster than alternative tools while integrating more functionality behind a single, common interface. Ruff can be used to replace Flake8 (plus dozens of plugins), Black, isort, pydocstyle, pyupgrade, autoflake, and more, all while executing tens or hundreds of times faster than any individual tool. %prep %autosetup -n ruff-%{version} -p1 %cargo_prep # disable offline mode & registry conf # so we can download crates sed -i -e'/^\[net.*/d' .cargo/config.toml sed -i -e'/^offline.*/d' .cargo/config.toml sed -i -e'/^\[source.*/d' .cargo/config.toml sed -i -e'/^directory.*/d' .cargo/config.toml sed -i -e'/^replace-with.*/d' .cargo/config.toml sed -i -e'/^registry.*/d' .cargo/config.toml # drop unused subprojects rm -rv crates/ruff_benchmark rm -rv crates/ruff_wasm #%%generate_buildrequires %pyproject_buildrequires #%%cargo_generate_buildrequires -a # update Cargo.lock because of the patches cargo generate-lockfile %build export RUSTFLAGS="%{build_rustflags}" %pyproject_wheel # write license summary and breakdown # rpm --eval %%{cargo_license_summary} and remove --offline #%%{cargo_license_summary} ( set -euo pipefail; /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn' /usr/bin/cargo tree -Z avoid-dev-deps --workspace --edges no-build,no-dev,no-proc-macro --no-dedupe --target all --prefix none --format "# {l}" | sed -e "s: / :/:g" -e "s:/: OR :g" | sort -u ) # rpm --eval %%{cargo_license} and remove --offline #%%{cargo_license} > LICENSE.dependencies ( set -euo pipefail; /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn' /usr/bin/cargo tree -Z avoid-dev-deps --workspace --edges no-build,no-dev,no-proc-macro --no-dedupe --target all --prefix none --format "{l}: {p}" | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "s:/: OR :g" | sort -u; ) > LICENSE.dependencies %install %pyproject_install %pyproject_save_files ruff # generate and install shell completions target/release/ruff generate-shell-completion bash > ruff.bash target/release/ruff generate-shell-completion fish > ruff.fish target/release/ruff generate-shell-completion zsh > _ruff install -Dpm 0644 ruff.bash -t %{buildroot}/%{bash_completions_dir} install -Dpm 0644 ruff.fish -t %{buildroot}/%{fish_completions_dir} install -Dpm 0644 _ruff -t %{buildroot}/%{zsh_completions_dir} %if %{with check} %check # ignore false positive snapshot test failures export INSTA_UPDATE=always # reduce peak memory usage %cargo_test -- -- --test-threads 2 %endif %files -f %{pyproject_files} %license LICENSE %license LICENSE.dependencies %doc README.md %doc BREAKING_CHANGES.md %doc CODE_OF_CONDUCT.md %doc CONTRIBUTING.md %{_bindir}/ruff %{bash_completions_dir}/ruff.bash %{fish_completions_dir}/ruff.fish %{zsh_completions_dir}/_ruff %changelog * Sun Sep 08 2024 Patrick Laimbock - 0.6.4-0.1 - update to version 0.6.4 * Mon Jun 03 2024 Patrick Laimbock - 0.4.7-0.1 - update to version 0.4.7 * Thu May 23 2024 Fabio Valentini - 0.3.7-2 - Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces * Sat Apr 13 2024 Fabio Valentini - 0.3.7-1 - Update to version 0.3.7; Fixes RHBZ#2267115 * Tue Feb 20 2024 Fabio Valentini - 0.2.2-1 - Update to version 0.2.2; Fixes RHBZ#2261934 * Tue Jan 23 2024 Fabio Valentini - 0.1.14-1 - Update to version 0.1.14; Fixes RHBZ#2257994 * Mon Jan 08 2024 Fabio Valentini - 0.1.11-1 - Initial import (#2257092) ## END: Generated by rpmautospec