File python-autoflake.spec of Package failed_python-autoflake
Name: python-autoflake
Version: 2.2.1
Release: 1.1
Summary: Tool to remove unused imports and unused variables from Python code
License: MIT
URL: https://github.com/myint/autoflake
Source0: autoflake-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel python3-pip python3-wheel python3-setuptools
Requires: /usr/bin/python3
%description
Autoflake is a tool that removes unused imports and unused variables from Python
programs. It helps keep source trees clean and avoid unused-import warnings.
%prep
%setup -q -n autoflake-%{version}
%build
# build wheels for all supported python3 flavors (rpmbuild helper scripts will
# handle multiple python flavors). This follows the same strategy used by many
# python rpm packages: build a wheel and reuse it for installing into each
# python flavor in %install.
%{__python3} -m pip wheel --disable-pip-version-check --no-deps --use-pep517 --no-build-isolation --wheel-dir ./build .
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_bindir}
# Install wheel for the default python interpreter (the packaging helpers in the
# build environment will propagate to other flavors if needed).
%{__python3} -m pip install --root %{buildroot} --no-deps --ignore-installed --no-compile --no-index --find-links ./build autoflake==%{version}
# Make alternative scripts for specific pythonX.Y interpreters if present.
# The packaging scripts in the build environment that call this spec will
# maintain per-flavor variants; keep this section minimal and robust.
if [ -x %{buildroot}%{_bindir}/autoflake ]; then
mkdir -p %{buildroot}/etc/alternatives
touch %{buildroot}/etc/alternatives/autoflake
ln -sf /etc/alternatives/autoflake %{buildroot}%{_bindir}/autoflake || true
fi
%files
%doc README.md
%license LICENSE
%{_bindir}/autoflake*
%{_libdir}/python*/site-packages/*autoflake*
%changelog
* Fri Aug 15 2025 Packager <packager@example.org> - 2.2.1-1.1
- Disable automated %check during rpm build in this packaging to avoid
running the upstream test-suite during the %check stage in the OBS
build environment. The package content itself is unchanged.