2011-07-08 14:20:20 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-autopep8
|
|
|
|
|
#
|
2023-01-23 10:00:49 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2011-07-08 14:20:20 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
2013-10-24 10:59:03 +00:00
|
|
|
|
2018-10-17 16:16:05 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-07-08 14:20:20 +00:00
|
|
|
#
|
|
|
|
|
|
2013-10-24 10:59:03 +00:00
|
|
|
|
2013-11-05 16:23:44 +00:00
|
|
|
Name: python-autopep8
|
2023-03-13 08:52:19 +00:00
|
|
|
Version: 2.0.2
|
2011-07-08 14:20:20 +00:00
|
|
|
Release: 0
|
|
|
|
|
Summary: Automatic generated to pep8 checked code
|
2013-10-24 10:59:03 +00:00
|
|
|
License: MIT
|
2011-07-08 14:20:20 +00:00
|
|
|
Group: Development/Languages/Python
|
2018-09-03 09:01:56 +00:00
|
|
|
URL: https://github.com/hhatto/autopep8
|
2017-08-04 15:23:40 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/a/autopep8/autopep8-%{version}.tar.gz
|
2023-08-25 18:46:57 +00:00
|
|
|
# PATCH-FIX-UPSTREAM https://github.com/hhatto/autopep8/pull/699 Try to fix an AttributeError related to pycodestyle 2.11.0
|
|
|
|
|
Patch0: pycodestyle211.patch
|
2023-01-23 10:00:49 +00:00
|
|
|
BuildRequires: %{python_module base >= 3.6}
|
|
|
|
|
BuildRequires: %{python_module pip}
|
2021-11-06 10:25:22 +00:00
|
|
|
BuildRequires: %{python_module pycodestyle >= 2.8}
|
2017-08-04 15:23:40 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2023-01-23 10:00:49 +00:00
|
|
|
BuildRequires: %{python_module tomli if %python-base < 3.11}
|
|
|
|
|
BuildRequires: %{python_module wheel}
|
2017-08-04 15:23:40 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2023-01-23 10:00:49 +00:00
|
|
|
Requires: python-pycodestyle >= 2.10.0
|
|
|
|
|
%if %{python_version_nodots} < 311
|
|
|
|
|
Requires: python-tomli
|
|
|
|
|
%endif
|
2013-11-05 16:23:44 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-04-06 09:07:41 +00:00
|
|
|
Requires(postun):update-alternatives
|
2011-07-08 14:20:20 +00:00
|
|
|
BuildArch: noarch
|
2017-08-04 15:23:40 +00:00
|
|
|
%python_subpackages
|
2011-07-08 14:20:20 +00:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Autopep8 is automatic generated to pep8 checked code.
|
2011-07-20 17:45:53 +00:00
|
|
|
This is old style tool, wrapped pep8 via subprocess module.
|
2011-07-08 14:20:20 +00:00
|
|
|
|
|
|
|
|
%prep
|
2023-01-25 12:46:56 +00:00
|
|
|
%autosetup -p1 -n autopep8-%{version}
|
2017-08-04 15:23:40 +00:00
|
|
|
sed -i '1s/^#!.*//' autopep8.py # Remove she-bang line
|
2011-07-08 14:20:20 +00:00
|
|
|
|
|
|
|
|
%build
|
2023-01-23 10:00:49 +00:00
|
|
|
%pyproject_wheel
|
2011-07-08 14:20:20 +00:00
|
|
|
|
|
|
|
|
%install
|
2023-01-23 10:00:49 +00:00
|
|
|
%pyproject_install
|
2017-08-04 15:23:40 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/autopep8
|
2013-11-05 16:23:44 +00:00
|
|
|
|
|
|
|
|
%check
|
2014-05-12 11:09:11 +00:00
|
|
|
export LANG="en_US.UTF-8"
|
2021-05-31 06:44:03 +00:00
|
|
|
%pyunittest discover -v
|
2013-11-05 16:23:44 +00:00
|
|
|
|
|
|
|
|
%pre
|
|
|
|
|
# Since /usr/bin/autopep8 became ghosted to be used with update-alternatives, we have to get rid
|
|
|
|
|
# of the old binary resulting from the non-update-alternativies-ified package:
|
2014-11-14 15:30:08 +00:00
|
|
|
[ -h %{_bindir}/autopep8 ] || rm -f %{_bindir}/autopep8
|
2013-11-05 16:23:44 +00:00
|
|
|
|
|
|
|
|
%post
|
2017-08-04 15:23:40 +00:00
|
|
|
%python_install_alternative autopep8
|
2013-11-05 16:23:44 +00:00
|
|
|
|
2017-08-04 15:23:40 +00:00
|
|
|
%postun
|
|
|
|
|
%python_uninstall_alternative autopep8
|
2011-07-08 14:20:20 +00:00
|
|
|
|
2017-08-04 15:23:40 +00:00
|
|
|
%files %{python_files}
|
2018-09-03 09:04:03 +00:00
|
|
|
%license LICENSE
|
2011-07-08 14:20:20 +00:00
|
|
|
%doc README.rst
|
2017-08-04 15:23:40 +00:00
|
|
|
%python_alternative %{_bindir}/autopep8
|
|
|
|
|
%pycache_only %{python_sitelib}/__pycache__/*
|
2013-11-05 16:23:44 +00:00
|
|
|
%{python_sitelib}/autopep8.py*
|
2023-01-23 10:00:49 +00:00
|
|
|
%{python_sitelib}/autopep8-%{version}.dist-info
|
2011-07-08 14:20:20 +00:00
|
|
|
|
|
|
|
|
%changelog
|