- update to 0.43.0:

* New `DISABLE_SPLIT_LIST_WITH_COMMENT` flag.
   `DISABLE_SPLIT_LIST_WITH_COMMENT` is a new knob that changes the
    behavior of splitting a list when a comment is present inside
    the list.
    Note the behavioral change above; if you set
    `DISABLE_ENDING_COMMA_HEURISTIC=true` and want to keep the old
    behavior, you now also need to set
    `DISABLE_SPLIT_LIST_WITH_COMMENT=true`.
  * Remove dependency on importlib-metadata
  * Remove dependency on tomli when using >= py311
  * Format '.pyi' type sub files.
  * Fix SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED for one-item named
    argument lists by taking precedence over SPLIT_BEFORE_NAMED_ASSIGNS.
  * Fix SPLIT_ALL_COMMA_SEPARATED_VALUES and
    SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES
    being too agressive for lambdas and unpacking.
- Add missing {Build,}Requires on tomli and importlib-metadata.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-yapf?expand=0&rev=33
This commit is contained in:
Dirk Mueller 2024-11-20 17:02:19 +00:00 committed by Git OBS Bridge
commit 2992615c27
6 changed files with 306 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

187
python-yapf.changes Normal file
View File

@ -0,0 +1,187 @@
-------------------------------------------------------------------
Wed Nov 20 16:58:40 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 0.43.0:
* New `DISABLE_SPLIT_LIST_WITH_COMMENT` flag.
`DISABLE_SPLIT_LIST_WITH_COMMENT` is a new knob that changes the
behavior of splitting a list when a comment is present inside
the list.
Note the behavioral change above; if you set
`DISABLE_ENDING_COMMA_HEURISTIC=true` and want to keep the old
behavior, you now also need to set
`DISABLE_SPLIT_LIST_WITH_COMMENT=true`.
* Remove dependency on importlib-metadata
* Remove dependency on tomli when using >= py311
* Format '.pyi' type sub files.
* Fix SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED for one-item named
argument lists by taking precedence over SPLIT_BEFORE_NAMED_ASSIGNS.
* Fix SPLIT_ALL_COMMA_SEPARATED_VALUES and
SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES
being too agressive for lambdas and unpacking.
-------------------------------------------------------------------
Mon Mar 11 05:47:17 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Add missing {Build,}Requires on tomli and importlib-metadata.
-------------------------------------------------------------------
Mon Nov 27 20:10:52 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 0.40.2:
* The verification module has been removed. NOTE: this changes
the public APIs by removing the "verify" parameter.
* Changed FORCE_MULTILINE_DICT to override
SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES.
* Adopt pyproject.toml (PEP 517) for build system
* Do not treat variables named `match` as the match keyword.
* Fix SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED for one-item
argument lists.
* Fix trailing backslash-newline on Windows when using stdin.
-------------------------------------------------------------------
Thu Sep 7 11:12:31 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 0.40.1:
* Corrected bad distribution v0.40.0 package.
* Support for Python 3.11
* Add the `--print-modified` flag to print out file names of
modified files when running in in-place mode.
* Replace the outdated and no-longer-supported lib2to3 with a
fork of blib2to3
* Support for Python versions < 3.7 are no longer supported.
-------------------------------------------------------------------
Thu May 4 19:56:33 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 0.33.0:
* Add a new Python parser to generate logical lines.
* Added support for `# fmt: on` and `# fmt: off` pragmas.
* Moved 'pytree' parsing tools into its own subdirectory.
* Add support for Python 3.10.
* Format generated dicts with respect to same rules as regular
dicts
* Generalized the ending comma heuristic to subscripts.
* Supports "pyproject.toml" by default.
* Split line before all comparison operators.
-------------------------------------------------------------------
Fri Apr 21 12:39:06 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:46:01 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Sat Jun 4 11:45:36 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Update to 0.32.0:
- Look at the 'pyproject.toml' file to see if it contains ignore file information
for YAPF.
- New entry point `yapf_api.FormatTree` for formatting lib2to3 concrete
syntax trees.
- Change tests to support "pytest".
- Reformat so that "flake8" is happy.
- Clean up the FormatToken interface to limit how much it relies upon the
pytree node object.
- Rename "unwrapped_line" module to "logical_line."
- Rename "UnwrappedLine" class to "LogicalLine."
- Added pyproject extra to install toml package as an optional dependency.
- Enable `BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF` knob for "pep8" style, so
method definitions inside a class are surrounded by a single blank line as
prescribed by PEP8.
- Fixed the '...' token to be spaced after a colon.
- Fix update-alternatives use.
-------------------------------------------------------------------
Sat Jul 17 06:43:41 UTC 2021 - Dirk Müller <dmueller@suse.com>
- update to 0.31.0:
- Add 'BLANK_LINES_BETWEEN_TOP_LEVEL_IMPORTS_AND_VARIABLES' to support setting
a custom number of blank lines between top-level imports and variable
definitions.
- Ignore end of line `# copybara:` directives when checking line length.
- Do not scan exlcuded directories. Prior versions would scan an exluded
folder then exclude its contents on a file by file basis. Preventing the
folder being scanned is faster.
-------------------------------------------------------------------
Fri May 29 09:31:01 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- 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
-------------------------------------------------------------------
Tue Feb 4 15:55:15 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- update to 0.29.0
* Add the `--quiet` flag to suppress output. The return code is 1 if there are
changes, similarly to the `--diff` flag.
* Catch and report `UnicodeDecodeError` exceptions.
* Few bugfixes, see CHANGELOG
-------------------------------------------------------------------
Mon Jul 22 11:28:10 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.28.0:
* Bugfix release, see CHANGELOG
-------------------------------------------------------------------
Tue Apr 9 11:51:52 UTC 2019 - Marketa Calabkova <mcalabkova@suse.com>
- update to version 0.27.0
* mostly bugfix release, see CHANGELOG for details
-------------------------------------------------------------------
Thu Feb 14 04:13:37 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Remove optional dependency from BuildRequires as no tests fail
or are skipped when it is missing.
- Remove tests from package
- Update to v0.26.0
* Many changes to behaviour; see CHANGELOG for details
- from v0.25.0
* Added `INDENT_BLANK_LINES` knob
* Support additional file exclude patterns in .yapfignore file
* Correctly determine if a scope is the last in line
-------------------------------------------------------------------
Wed Oct 24 13:23:45 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>
- Version update to 0.24.0:
* Support for python 3.7
-------------------------------------------------------------------
Wed Aug 29 11:37:58 UTC 2018 - tchvatal@suse.com
- Version update to 0.23.0:
* Many changes to behaviour based on CHANGELOG
* Add various documents/license to distributed tarball
-------------------------------------------------------------------
Sun Mar 4 11:06:23 UTC 2018 - jengelh@inai.de
- Trim description and focus on the package, not the process.
-------------------------------------------------------------------
Fri Oct 20 16:19:54 UTC 2017 - toddrme2178@gmail.com
- initial version

89
python-yapf.spec Normal file
View File

@ -0,0 +1,89 @@
#
# spec file for package python-yapf
#
# Copyright (c) 2024 SUSE LLC
#
# 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.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-yapf
Version: 0.43.0
Release: 0
Summary: A formatter for Python code
License: Apache-2.0
URL: https://github.com/google/yapf
Source: https://files.pythonhosted.org/packages/source/y/yapf/yapf-%{version}.tar.gz
BuildRequires: %{python_module devel >= 3.7}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module platformdirs}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module tomli if %python-base < 3.11}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-platformdirs
%if 0%{?python_version_nodots} < 311
Requires: python-tomli
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%ifpython2
Recommends: python-futures
%endif
%python_subpackages
%description
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.
%prep
%setup -q -n yapf-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/yapf
%python_clone -a %{buildroot}%{_bindir}/yapf-diff
%python_expand rm -r %{buildroot}%{$python_sitelib}/yapftests
%check
%pytest --capture=no
%post
%python_install_alternative yapf yapf-diff
%postun
%python_uninstall_alternative yapf
%files %{python_files}
%license LICENSE
%doc README.md CHANGELOG.md
%python_alternative %{_bindir}/yapf
%python_alternative %{_bindir}/yapf-diff
%{python_sitelib}/yapf/
%{python_sitelib}/yapf_third_party/
%{python_sitelib}/yapf-%{version}.dist-info
%changelog

BIN
yapf-0.40.2.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

3
yapf-0.43.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:00d3aa24bfedff9420b2e0d5d9f5ab6d9d4268e72afbf59bb3fa542781d5218e
size 254907