diff --git a/0001-set-cargo-vendor-cache-for-local-build.patch b/0001-set-cargo-vendor-cache-for-local-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..4a37535a1720ade28b0ee0bc4cfe6e43847150e2 --- /dev/null +++ b/0001-set-cargo-vendor-cache-for-local-build.patch @@ -0,0 +1,41 @@ +From ea4692d3383fe2f9a49c980009a81d3042703bfa Mon Sep 17 00:00:00 2001 +From: desert-sailor +Date: Wed, 5 Jul 2023 09:17:51 +0800 +Subject: [PATCH] set cargo vendor cache for local build + +--- + .cargo/config.toml | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/.cargo/config.toml b/.cargo/config.toml +index d6ef99b..52e065b 100644 +--- a/.cargo/config.toml ++++ b/.cargo/config.toml +@@ -35,3 +35,24 @@ rustflags = [ + "-Wclippy::rest_pat_in_fully_bound_structs", + "-Wunreachable_pub" + ] ++ ++[source.crates-io] ++replace-with = "vendored-sources" ++ ++[source."git+https://github.com/astral-sh/RustPython-Parser.git?rev=c174bbf1f29527edd43d432326327f16f47ab9e0"] ++git = "https://github.com/astral-sh/RustPython-Parser.git" ++rev = "c174bbf1f29527edd43d432326327f16f47ab9e0" ++replace-with = "vendored-sources" ++ ++[source."git+https://github.com/charliermarsh/LibCST?rev=80e4c1399f95e5beb532fdd1e209ad2dbb470438"] ++git = "https://github.com/charliermarsh/LibCST" ++rev = "80e4c1399f95e5beb532fdd1e209ad2dbb470438" ++replace-with = "vendored-sources" ++ ++[source."git+https://github.com/youknowone/unicode_names2.git?rev=4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde"] ++git = "https://github.com/youknowone/unicode_names2.git" ++rev = "4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde" ++replace-with = "vendored-sources" ++ ++[source.vendored-sources] ++directory = "vendor" +-- +2.33.0 + diff --git a/cargo-vendor-cache b/cargo-vendor-cache new file mode 100644 index 0000000000000000000000000000000000000000..62dde8bc051602a338e06b3d6c4ab4c108da07a8 Binary files /dev/null and b/cargo-vendor-cache differ diff --git a/python-ruff.spec b/python-ruff.spec new file mode 100644 index 0000000000000000000000000000000000000000..2da8d4c6a05b73a0ffba6d08b9bcefbca84cf320 --- /dev/null +++ b/python-ruff.spec @@ -0,0 +1,54 @@ +%global _empty_manifest_terminate_build 0 +%global pypi_name ruff + +Name: python-%{pypi_name} +Version: 0.0.276 +Release: 1 +Summary: An extremely fast Python linter, written in Rust. + +License: MIT +URL: https://github.com/astral-sh/ruff +Source0: https://files.pythonhosted.org/packages/f7/9b/e8c42f8e0bb21a2d82b8f414c55fbf498cdfe72922bf73c973267477fd46/ruff-0.0.276.tar.gz +Source1: cargo-vendor-cache +Patch1: 0001-set-cargo-vendor-cache-for-local-build.patch + +BuildRequires: rust-packaging + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-hatchling +BuildRequires: python3-maturin + +%description +An extremely fast Python linter, written in Rust. + + +%package -n python3-%{pypi_name} +Summary: %{summary} + +%description -n python3-%{pypi_name} +An extremely fast Python linter, written in Rust. + + +%prep +%autosetup -p1 -n %{pypi_name}-%{version} +tar xzvf %{SOURCE1} -C . + +%build +%pyproject_build + +%install +%pyproject_install + +%files -n python3-%{pypi_name} +%doc README.md +%license LICENSE +%{_bindir}/ruff +%{python3_sitearch}/%{pypi_name} +%{python3_sitearch}/%{pypi_name}*.dist-info/ + +%changelog +* Sun Jul 2 2023 Dongxing Wang - 0.0.276-1 +- Initial package diff --git a/ruff-0.0.276.tar.gz b/ruff-0.0.276.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1aed73dcedbf37a793062267c8e451aa61d0982e Binary files /dev/null and b/ruff-0.0.276.tar.gz differ