2017-11-07 17:19:02 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-yapf
|
|
|
|
#
|
2023-04-21 15:27:40 +02:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2017-11-07 17:19:02 +01: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.
|
|
|
|
|
2018-10-24 15:24:49 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-03-04 12:10:46 +01:00
|
|
|
#
|
2017-11-07 17:19:02 +01:00
|
|
|
|
|
|
|
|
2023-04-21 15:27:40 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2017-11-07 17:19:02 +01:00
|
|
|
Name: python-yapf
|
2023-09-07 13:15:55 +02:00
|
|
|
Version: 0.40.1
|
2017-11-07 17:19:02 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: A formatter for Python code
|
2018-03-04 12:10:46 +01:00
|
|
|
License: Apache-2.0
|
2017-11-07 17:19:02 +01:00
|
|
|
Group: Development/Languages/Python
|
2018-08-29 13:40:45 +02:00
|
|
|
URL: https://github.com/google/yapf
|
2017-11-07 17:19:02 +01:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/y/yapf/yapf-%{version}.tar.gz
|
2023-09-07 13:15:55 +02:00
|
|
|
BuildRequires: %{python_module devel >= 3.7}
|
|
|
|
BuildRequires: %{python_module platformdirs}
|
Accepting request 810164 from home:mcalabkova:branches:devel:languages:python
- update to 0.30.0
* Added `SPACES_AROUND_LIST_DELIMITERS`, `SPACES_AROUND_DICT_DELIMITERS`,
and `SPACES_AROUND_TUPLE_DELIMITERS` to add spaces after the opening
and before the closing delimiters for lists, dicts, and tuples.
* Adds `FORCE_MULTILINE_DICT` knob to ensure dictionaries always split,
even when shorter than the max line length.
* New knob `SPACE_INSIDE_BRACKETS` to add spaces inside brackets, braces, and
parentheses.
* New knob `SPACES_AROUND_SUBSCRIPT_COLON` to add spaces around the subscript /
slice operator.
* Renamed "chromium" style to "yapf". Chromium will now use PEP-8 directly.
* `CONTINUATION_ALIGN_STYLE` with `FIXED` or `VALIGN-RIGHT` now works with
space indentation.
* Don't over-indent a parameter list when not needed. But make sure it is
properly indented so that it doesn't collide with the lines afterwards.
* Don't split between two-word comparison operators: "is not", "not in", etc.
- Replace nose with pytest
* not WLOG, some tests get skipped because of capturing stdin
OBS-URL: https://build.opensuse.org/request/show/810164
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-yapf?expand=0&rev=17
2020-05-29 13:00:49 +02:00
|
|
|
BuildRequires: %{python_module pytest}
|
2017-11-07 17:19:02 +01:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
2018-08-29 13:40:45 +02:00
|
|
|
BuildRequires: python-rpm-macros
|
2023-09-07 13:15:55 +02:00
|
|
|
Requires: python-platformdirs
|
2018-08-29 13:40:45 +02:00
|
|
|
Requires(post): update-alternatives
|
2021-07-17 08:46:24 +02:00
|
|
|
Requires(postun):update-alternatives
|
2017-11-07 17:19:02 +01:00
|
|
|
BuildArch: noarch
|
|
|
|
%ifpython2
|
|
|
|
Recommends: python-futures
|
|
|
|
%endif
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2018-03-04 12:10:46 +01:00
|
|
|
YAPF is based off clang-format and reformats it to the closest
|
|
|
|
formatting that conforms to the style guide, even if the original
|
|
|
|
code did not violate the style guide.
|
|
|
|
|
|
|
|
This is in contrast to other formatters like autopep8 and pep8ify
|
|
|
|
which are made to only remove lint errors from code, which has some
|
|
|
|
limitations, like, code that conforms to the PEP 8 guidelines may not
|
|
|
|
be reformatted.
|
2017-11-07 17:19:02 +01:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n yapf-%{version}
|
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/yapf
|
2021-07-17 08:46:24 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/yapf-diff
|
2019-02-14 09:32:53 +01:00
|
|
|
%python_expand rm -r %{buildroot}%{$python_sitelib}/yapftests
|
2017-11-07 17:19:02 +01:00
|
|
|
|
|
|
|
%check
|
Accepting request 810164 from home:mcalabkova:branches:devel:languages:python
- update to 0.30.0
* Added `SPACES_AROUND_LIST_DELIMITERS`, `SPACES_AROUND_DICT_DELIMITERS`,
and `SPACES_AROUND_TUPLE_DELIMITERS` to add spaces after the opening
and before the closing delimiters for lists, dicts, and tuples.
* Adds `FORCE_MULTILINE_DICT` knob to ensure dictionaries always split,
even when shorter than the max line length.
* New knob `SPACE_INSIDE_BRACKETS` to add spaces inside brackets, braces, and
parentheses.
* New knob `SPACES_AROUND_SUBSCRIPT_COLON` to add spaces around the subscript /
slice operator.
* Renamed "chromium" style to "yapf". Chromium will now use PEP-8 directly.
* `CONTINUATION_ALIGN_STYLE` with `FIXED` or `VALIGN-RIGHT` now works with
space indentation.
* Don't over-indent a parameter list when not needed. But make sure it is
properly indented so that it doesn't collide with the lines afterwards.
* Don't split between two-word comparison operators: "is not", "not in", etc.
- Replace nose with pytest
* not WLOG, some tests get skipped because of capturing stdin
OBS-URL: https://build.opensuse.org/request/show/810164
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-yapf?expand=0&rev=17
2020-05-29 13:00:49 +02:00
|
|
|
%pytest --capture=no
|
2017-11-07 17:19:02 +01:00
|
|
|
|
|
|
|
%post
|
2022-06-04 13:48:13 +02:00
|
|
|
%python_install_alternative yapf yapf-diff
|
2017-11-07 17:19:02 +01:00
|
|
|
|
|
|
|
%postun
|
2022-06-04 13:50:10 +02:00
|
|
|
%python_uninstall_alternative yapf
|
2017-11-07 17:19:02 +01:00
|
|
|
|
|
|
|
%files %{python_files}
|
2018-08-29 13:40:45 +02:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.rst CHANGELOG
|
2017-11-07 17:19:02 +01:00
|
|
|
%python_alternative %{_bindir}/yapf
|
2021-07-17 08:46:24 +02:00
|
|
|
%python_alternative %{_bindir}/yapf-diff
|
2019-02-14 09:32:53 +01:00
|
|
|
%{python_sitelib}/yapf/
|
2023-09-07 13:15:55 +02:00
|
|
|
%{python_sitelib}/yapf_third_party/
|
2019-02-14 09:32:53 +01:00
|
|
|
%{python_sitelib}/yapf-%{version}-py*.egg-info/
|
2017-11-07 17:19:02 +01:00
|
|
|
|
|
|
|
%changelog
|