@ -1,8 +1,8 @@
## START: Set by rpmautospec
## (rpmautospec version 0.6.5 )
## (rpmautospec version 0.7.2 )
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 5 ;
release_number = 1 ;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
@ -13,24 +13,32 @@
# reduce peak memory usage
%constrain_build -m 4096
# replacements for git snapshot dependencies
%global lsp_types_commit 3512a9f33eadc5402cfab1b8f7340824c8ca1439
%global salsa_commit f608ff8b24f07706492027199f51132244034f29
Name: ruff
Version: 0.4.4
Version: 0.6.7
Release: %autorelease
Summary: Extremely fast Python linter and code formatter
SourceLicense: MIT
# ruff: MIT
# bundled typeshed snapshot: (Apache-2.0 AND MIT)
# bundled lsp-types fork: MIT
# bundled salsa snapshot: (Apache-2.0 OR MIT)
SourceLicense: MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
# 0BSD
# 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
# CC0-1.0
# ISC
# MIT
# MIT AND BSD-3-Clause
# MIT AND PSF-2.0
# MIT OR Apache-2.0
# MIT OR Apache-2.0 OR Zlib
@ -39,34 +47,51 @@ SourceLicense: MIT
# Unlicense OR MIT
# WTFPL
# Zlib OR Apache-2.0 OR MIT
License: MIT AND 0BSD AND Apache-2.0 AND BSD-2-Clause-Views AND CC0-1.0 AND ISC AND MPL-2.0 AND PSF-2.0 AND Unicode-DFS-2016 AND WTFPL 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 (MIT OR Apache-2.0 OR Zlib) AND (MIT OR BSD-3-Clause) AND (Unlicense OR MIT)
License: MIT AND Apache-2.0 AND BSD-3-Clause AND CC0-1.0 AND ISC AND MPL-2.0 AND PSF-2.0 AND Unicode-DFS-2016 AND WTFPL 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 (MIT OR Apache-2.0 OR Zlib) AND (MIT OR BSD-3-Clause) AND (Unlicense OR MIT)
URL: https://github.com/astral-sh/ruff
Source: %{url}/archive/v%{version}/ruff-%{version}.tar.gz
Source: %{url}/archive/%{version}/ruff-%{version}.tar.gz
Source1: https://github.com/astral-sh/lsp-types/archive/%{lsp_types_commit}/lsp-types-%{lsp_types_commit}.tar.gz
Source2: https://github.com/salsa-rs/salsa/archive/%{salsa_commit}/salsa-%{salsa_commit}.tar.gz
Source3: 0007-avoid-duplicate-workspace-definitions.patch
# * drop non-Linux 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-and-macOS-specific-dependencies.patch
# * drop unavailable compile-time diagnostics feature for UUIDs (non-upstreamable)
Patch: 0002-drop-unavailable-features-from-uuid-dependency.patch
# * replace git snapshot dependencies with path-based dependencies from
# unpacked additional sources (non-upstreamable)
Patch: 0002-replace-git-snapshot-dependencies-with-path-dependen.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
# * bump pyproject-toml-dependency from 0.9 to 0.10 :
# * bump pyproject-toml-dependency from 0.9 to 0.11 (blocked upstream) :
# https://github.com/astral-sh/ruff/pull/10705
Patch: 0005-bump-pyproject-toml-dependency-from-0.9-to-0.10.patch
# * downgrade pep440_rs dependency from 0.6 to 0.5 to match pyproject-toml:
Patch: 0006-downgrade-pep440_rs-from-0.6-to-0.5-to-avoid-duplica.patch
# * Update Rust crate clap_complete_command to 0.6.0
# https://github.com/astral-sh/ruff/commit/b1cf9ea663636551cd490d74b8b82d8f778230b0
Patch: 0007-Update-Rust-crate-clap_complete_command-to-0.6.0-123.patch
# https://github.com/astral-sh/ruff/pull/11708
Patch: 0005-bump-pyproject-toml-dependency-from-0.9-to-0.11.patch
# * drop unavailable compile-time diagnostics feature for UUIDs (non-upstreamable)
Patch: 0006-drop-unavailable-features-from-uuid-dependency.patch
ExcludeArch: %{ix86}
BuildRequires: cargo-rpm-macros >= 24
BuildRequires: python3-devel
# git snapshot of the python/typeshed project at commit 9e506eb:
# https://github.com/python/typeshed
Provides: bundled(typeshed)
# forked from lsp-types upstream: https://github.com/gluon-lang/lsp-types
# with changes applied: https://github.com/astral-sh/lsp-types/tree/notebook-support
Provides: bundled(crate(lsp-types)) = 0.95.1
# git snapshot of unreleased upstream at some point after v0.18.0:
# https://github.com/salsa-rs/salsa/commit/f608ff8
Provides: bundled(crate(salsa)) = 0.18.0
Provides: bundled(crate(salsa-macros)) = 0.18.0
Provides: bundled(crate(salsa-macro-rules)) = 0.1.0
%description
An extremely fast Python linter and code formatter, written in Rust.
@ -80,7 +105,27 @@ tens or hundreds of times faster than any individual tool.
%prep
%autosetup -n ruff-%{version} -p1
%cargo_prep
# move git snapshot replacements into place
tar -xzvf %{SOURCE1}
tar -xzvf %{SOURCE2}
mv lsp-types-%{lsp_types_commit} crates/lsp-types
mv salsa-%{salsa_commit} crates/salsa
# avoid duplicate workspace definitions
pushd crates/salsa
patch -p1 < %{SOURCE3}
mv components/* ../
popd
# prepare license files under distinct names
cp -pav crates/lsp-types/LICENSE LICENSE.lsp-types
cp -pav crates/salsa/LICENSE-APACHE LICENSE-APACHE.salsa
cp -pav crates/salsa/LICENSE-MIT LICENSE-MIT.salsa
cp -pav crates/ruff_vendored/vendor/typeshed/LICENSE LICENSE.typeshed
# drop unused subprojects
rm -rv crates/red_knot_wasm
rm -rv crates/ruff_benchmark
rm -rv crates/ruff_wasm
@ -101,9 +146,9 @@ export RUSTFLAGS="%{build_rustflags}"
%pyproject_save_files ruff
# generate and install shell completions
target/rpm/ruff -- generate-shell-completion bash > ruff.bash
target/rpm/ruff -- generate-shell-completion fish > ruff.fish
target/rpm/ruff -- generate-shell-completion zsh > _ruff
target/rpm/ruff generate-shell-completion bash > ruff.bash
target/rpm/ruff generate-shell-completion fish > ruff.fish
target/rpm/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}
@ -119,6 +164,10 @@ export INSTA_UPDATE=always
%files -f %{pyproject_files}
%license LICENSE
%license LICENSE.lsp-types
%license LICENSE-APACHE.salsa
%license LICENSE-MIT.salsa
%license LICENSE.typeshed
%license LICENSE.dependencies
%doc README.md
%doc BREAKING_CHANGES.md
@ -132,9 +181,12 @@ export INSTA_UPDATE=always
%{zsh_completions_dir}/_ruff
%changelog
* Sun Dec 29 2024 Dmitriy Samoylik <samoylikdv@msvsphere-os.ru> - 0.6.7-1
- Rebuilt for MSVSphere 10
## START: Generated by rpmautospec
* Fri Dec 27 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.4.4-5
- Rebuilt for MSVSphera 10
* Sat Sep 28 2024 Fabio Valentini <decathorpe@gmail.com> - 0.6.7-1
- Update to version 0.6.7
* Mon Jul 22 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.4.4-5
- Fix typo in License expression