commit e4a2c18617c5b8ad6e843e15a3b177c3ba5abc2fc2ca1458ac007460d16ad74e Author: Matej Cepl Date: Sun Jan 17 21:22:03 2021 +0000 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-blue?expand=0&rev=2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/black-20.8b1.tar.gz b/black-20.8b1.tar.gz new file mode 100644 index 0000000..5a9ed3c --- /dev/null +++ b/black-20.8b1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea +size 1096433 diff --git a/python-black.changes b/python-black.changes new file mode 100644 index 0000000..fc0be1e --- /dev/null +++ b/python-black.changes @@ -0,0 +1,124 @@ +------------------------------------------------------------------- +Sat Dec 5 23:44:07 UTC 2020 - Benjamin Greiner + +- Fix Python 3.6 for Leap 15.2 and for the upcoming python36 flavor + in Tumbleweed: Requires python-dataclasses + gh#openSUSE/python-rpm-macros#66 + +------------------------------------------------------------------- +Fri Sep 4 12:19:10 UTC 2020 - John Vandenberg + +- Include change log and docs in package +- Update to v20.8b1 + * Explicitly depend on Click 7.1.2 or newer as `Black` no longer + works with versions older than 7.0 +- from v20.8b0 + * Re-implemented support for explicit trailing commas: now it + works consistently within any bracket pair, including nested + structures + * Reindents docstrings when reindenting code around it + * Show colored diffs + * Supports Python 3.8 code, e.g. star expressions in return statements + * No longer normalizes capital R-string prefixes as those have a + community-accepted meaning + * Uses exit code 2 when specified configuration file doesn't exit + * Works on AWS Lambda + * Added `--force-exclude` argument + * Removed deprecated `--py36` option + * Fixed `--diff` output when EOF is encountered + * Fixed `# fmt: off` handling around decorators + * Fixed unstable formatting with some `# type: ignore` comments + * Fixed invalid removal on organizing brackets followed by indexing + * Introduced `black-primer`, a CI tool that allows us to run + regression tests against existing open source users of Black + * Introduced property-based fuzzing to our test suite based on + Hypothesis and Hypothersmith + * Implemented experimental and disabled by default long string + rewrapping hidden under a `--experimental-string-processing` + flag while it's being worked on; this is an undocumented and + unsupported feature + * Vim plugin prefer virtualenv packages over global packages + +------------------------------------------------------------------- +Mon Aug 24 21:56:53 UTC 2020 - Benjamin Greiner + +- update URL +- python-aiohttp_cors is now available --> install blackd +- skip python2 test on big endian platforms gh#psf/black#1109 +- drop fix-tests.patch + +------------------------------------------------------------------- +Wed May 27 09:36:28 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + +------------------------------------------------------------------- +Wed Nov 13 11:25:32 UTC 2019 - Ondřej Súkup + +- Add missing Requires + +------------------------------------------------------------------- +Mon Nov 11 14:14:38 UTC 2019 - Ondřej Súkup + +- update to 19.10b0 +- add fix-tests.patch to avoid problem during test collection +- dont distribute 'blackd' as missing deps + * no obvious changelog + +------------------------------------------------------------------- +Tue Jun 4 13:53:31 UTC 2019 - Tomáš Chvátal + +- Skip randomly failing test (only in OBS) + +------------------------------------------------------------------- +Thu Mar 21 15:44:47 UTC 2019 - Tomáš Chvátal + +- Update to 19.3b0: + * No obvious changelog + +------------------------------------------------------------------- +Wed Oct 3 12:40:28 UTC 2018 - Ondřej Súkup + +- update to 18.9b0 + * numeric literals are now formatted by Black + * numeric literals are normalized to include _ separators on Python 3.6+ code + * added --skip-numeric-underscore-normalization to disable the above behavior + and leave numeric underscores as they were in the input + * code with _ in numeric literals is recognized as Python 3.6+ + * most letters in numeric literals are lowercased (e.g., in 1e10, 0x01) + * hexadecimal digits are always uppercased (e.g. 0xBADC0DE) + * added blackd, see its documentation for more info + * adjacent string literals are now correctly split into multiple lines + * trailing comma is now added to single imports that don't fit on a line + * cache is now populated when --check is successful for a file which + speeds up consecutive checks of properly formatted unmodified files + * whitespace at the beginning of the file is now removed + * fixed mangling pweave and Spyder IDE special comments + * fixed unstable formatting when unpacking big tuples + * fixed parsing of __future__ imports with renames + * fixed scope of # fmt: off when directly preceding yield and other nodes + * fixed formatting of lambda expressions with default arguments + * fixed async for statements: Black no longer breaks them into separate lines + * note: the Vim plugin stopped registering ,= as a default chord + as it turned out to be a bad idea + +------------------------------------------------------------------- +Wed Aug 29 10:31:11 UTC 2018 - tchvatal@suse.com + +- Raise minimal py required to be 3.6 + +------------------------------------------------------------------- +Tue Aug 28 21:27:40 UTC 2018 - jengelh@inai.de + +- Replace all the marketing in the description with something + substantial. + +------------------------------------------------------------------- +Mon Aug 27 19:27:43 UTC 2018 - mimi.vx@gmail.com + +- disable testsuite for py older than 3.7 + +------------------------------------------------------------------- +Mon Aug 27 09:08:50 UTC 2018 - tchvatal@suse.com + +- Code formatter used by pytest/etc diff --git a/python-black.spec b/python-black.spec new file mode 100644 index 0000000..faecea7 --- /dev/null +++ b/python-black.spec @@ -0,0 +1,127 @@ +# +# spec file for package python-black +# +# Copyright (c) 2020 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/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 +Name: python-black +Version: 20.8b1 +Release: 0 +Summary: A code formatter written in, and written for Python +License: MIT +URL: https://github.com/psf/black +Source: https://files.pythonhosted.org/packages/source/b/black/black-%{version}.tar.gz +BuildRequires: %{python_module aiohttp >= 3.3.2} +BuildRequires: %{python_module aiohttp_cors} +BuildRequires: %{python_module appdirs} +BuildRequires: %{python_module attrs >= 18.1.0} +BuildRequires: %{python_module base >= 3.6} +BuildRequires: %{python_module click >= 7.1.2} +BuildRequires: %{python_module mypy_extensions >= 0.4.3} +BuildRequires: %{python_module pathspec >= 0.6} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module regex >= 2020.1.8} +BuildRequires: %{python_module setuptools_scm} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module toml >= 0.10.1} +BuildRequires: %{python_module typed-ast >= 1.4.0} +BuildRequires: %{python_module typing_extensions} +BuildRequires: (python36-dataclasses if python36-base) +BuildRequires: (python3-dataclasses if python3-base < 3.7) +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-aiohttp >= 3.3.2 +Requires: python-aiohttp_cors +Requires: python-appdirs +Requires: python-attrs >= 18.1.0 +Requires: python-click >= 7.1.2 +Requires: python-mypy_extensions >= 0.4.3 +Requires: python-pathspec >= 0.6 +Requires: python-regex >= 2020.1.8 +Requires: python-toml >= 0.10.1 +Requires: python-typed-ast >= 1.4.0 +Requires: python-typing_extensions +%if 0%{?python_version_nodots} == 36 +Requires: python-dataclasses +%endif +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch +%python_subpackages + +%description +Black is a code formatter written in Python, and reformats Python 2.x +and 3.x code. + +Black reformats entire files in place. It is not configurable. It +does not take previous formatting into account. The coding style +enforced is a PEP-8 subset, adheres to PEP-257, and otherwise passes +the rules of the "pycodestyle" checker. Black skips over blocks that +start and end with "# fmt: off" and "# fmt: on", respectively. It +also recognizes YAPF's block comments to the same effect. + +%prep +%setup -q -n black-%{version} +sed -i '1{/#!/d}' src/black_primer/cli.py src/black_primer/lib.py + +%build +%python_build + +%install +%python_install +%python_clone -a %{buildroot}%{_bindir}/black +%python_clone -a %{buildroot}%{_bindir}/blackd +%python_clone -a %{buildroot}%{_bindir}/black-primer +%{python_expand cp src/black_primer/primer.json %{buildroot}%{$python_sitelib}/black_primer/ +%fdupes %{buildroot}%{$python_sitelib} +} + +%check +# Copy one of the executable scripts into the PATH +mkdir ~/bin +cp $(ls %{buildroot}%{_bindir}/black-* | head -1) ~/bin/black +export PATH=$PATH:~/bin + +# test_expression_diff - sometimes fails on async timing in OBS +skiptests="test_expression_diff" +# https://github.com/psf/black/issues/1109 +if [ $(python3 -c 'import sys; print(sys.byteorder)') == 'big' ]; then +skiptests+=" or test_python2" +fi +%pytest -k "not ($skiptests)" + +%post +%python_install_alternative black blackd black-primer + +%postun +%python_uninstall_alternative black + +%files %{python_files} +%doc README.md CHANGES.md docs/*.md docs/reference +%license LICENSE +%python_alternative %{_bindir}/black +%python_alternative %{_bindir}/blackd +%python_alternative %{_bindir}/black-primer +%{python_sitelib}/_black_version.py* +%{python_sitelib}/black_primer/ +%{python_sitelib}/black/ +%{python_sitelib}/blackd/ +%{python_sitelib}/blib2to3/ +%{python_sitelib}/black-%{version}-py*.egg-info +%pycache_only %{python_sitelib}/__pycache__/* + +%changelog