2017-11-07 16:19:02 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-yapf
|
|
|
|
#
|
2024-03-11 05:48:00 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2017-11-07 16:19:02 +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.
|
|
|
|
|
2018-10-24 13:24:49 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-03-04 11:10:46 +00:00
|
|
|
#
|
2017-11-07 16:19:02 +00:00
|
|
|
|
|
|
|
|
2023-04-21 13:27:40 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2017-11-07 16:19:02 +00:00
|
|
|
Name: python-yapf
|
2023-11-27 20:13:51 +00:00
|
|
|
Version: 0.40.2
|
2017-11-07 16:19:02 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: A formatter for Python code
|
2018-03-04 11:10:46 +00:00
|
|
|
License: Apache-2.0
|
2018-08-29 11:40:45 +00:00
|
|
|
URL: https://github.com/google/yapf
|
2017-11-07 16:19:02 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/y/yapf/yapf-%{version}.tar.gz
|
2023-09-07 11:15:55 +00:00
|
|
|
BuildRequires: %{python_module devel >= 3.7}
|
2024-03-11 05:48:00 +00:00
|
|
|
BuildRequires: %{python_module importlib-metadata}
|
2023-11-27 20:13:51 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2023-09-07 11:15:55 +00:00
|
|
|
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 11:00:49 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2024-03-11 05:48:00 +00:00
|
|
|
BuildRequires: %{python_module tomli}
|
2023-11-27 20:13:51 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2017-11-07 16:19:02 +00:00
|
|
|
BuildRequires: fdupes
|
2018-08-29 11:40:45 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2024-03-11 05:48:00 +00:00
|
|
|
Requires: python-importlib-metadata
|
2023-09-07 11:15:55 +00:00
|
|
|
Requires: python-platformdirs
|
2024-03-11 05:48:00 +00:00
|
|
|
Requires: python-tomli
|
2018-08-29 11:40:45 +00:00
|
|
|
Requires(post): update-alternatives
|
2024-03-11 05:48:00 +00:00
|
|
|
Requires(postun): update-alternatives
|
2017-11-07 16:19:02 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
%ifpython2
|
|
|
|
Recommends: python-futures
|
|
|
|
%endif
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2018-03-04 11:10:46 +00: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 16:19:02 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n yapf-%{version}
|
|
|
|
|
|
|
|
%build
|
2023-11-27 20:13:51 +00:00
|
|
|
%pyproject_wheel
|
2017-11-07 16:19:02 +00:00
|
|
|
|
|
|
|
%install
|
2023-11-27 20:13:51 +00:00
|
|
|
%pyproject_install
|
2017-11-07 16:19:02 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/yapf
|
2021-07-17 06:46:24 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/yapf-diff
|
2019-02-14 08:32:53 +00:00
|
|
|
%python_expand rm -r %{buildroot}%{$python_sitelib}/yapftests
|
2017-11-07 16:19:02 +00: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 11:00:49 +00:00
|
|
|
%pytest --capture=no
|
2017-11-07 16:19:02 +00:00
|
|
|
|
|
|
|
%post
|
2022-06-04 11:48:13 +00:00
|
|
|
%python_install_alternative yapf yapf-diff
|
2017-11-07 16:19:02 +00:00
|
|
|
|
|
|
|
%postun
|
2022-06-04 11:50:10 +00:00
|
|
|
%python_uninstall_alternative yapf
|
2017-11-07 16:19:02 +00:00
|
|
|
|
|
|
|
%files %{python_files}
|
2018-08-29 11:40:45 +00:00
|
|
|
%license LICENSE
|
2023-11-27 20:13:51 +00:00
|
|
|
%doc README.md CHANGELOG.md
|
2017-11-07 16:19:02 +00:00
|
|
|
%python_alternative %{_bindir}/yapf
|
2021-07-17 06:46:24 +00:00
|
|
|
%python_alternative %{_bindir}/yapf-diff
|
2019-02-14 08:32:53 +00:00
|
|
|
%{python_sitelib}/yapf/
|
2023-09-07 11:15:55 +00:00
|
|
|
%{python_sitelib}/yapf_third_party/
|
2023-11-27 20:13:51 +00:00
|
|
|
%{python_sitelib}/yapf-%{version}.dist-info
|
2017-11-07 16:19:02 +00:00
|
|
|
|
|
|
|
%changelog
|