forked from pool/python-black
Accepting request 949437 from home:bnavigator:branches:devel:languages:python
- Unpin tomli and pathspec * black-pr2718-unpin.patch -- gh#psf/black#2718 * gh#psf/black#2703 - Remove obsolete python36 flavor expression - Update requirements for Python 3.6 distros OBS-URL: https://build.opensuse.org/request/show/949437 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-black?expand=0&rev=27
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%{?!python_module:%define python_module() python3-%{**}}
|
||||
%define skip_python2 1
|
||||
Name: python-black
|
||||
Version: 21.12b0
|
||||
@@ -25,6 +25,8 @@ 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
|
||||
# PATCH-FIX-UPSTREAM black-pr2718-unpin.patch -- gh#psf/black#2718 + gh#psf/black#2408 + gh#pypa/pip#10238; gh#psf/black#2703
|
||||
Patch1: black-pr2718-unpin.patch
|
||||
BuildRequires: %{python_module aiohttp >= 3.3.2}
|
||||
BuildRequires: %{python_module aiohttp_cors}
|
||||
BuildRequires: %{python_module attrs >= 18.1.0}
|
||||
@@ -41,7 +43,7 @@ BuildRequires: %{python_module typing_extensions}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: (python3-dataclasses if python3-base < 3.7)
|
||||
BuildRequires: (python36-dataclasses if python36-base)
|
||||
BuildRequires: (python3-typed-ast >= 1.4.2 if python3-base < 3.8)
|
||||
Requires: python-aiohttp >= 3.3.2
|
||||
Requires: python-aiohttp_cors
|
||||
Requires: python-attrs >= 18.1.0
|
||||
@@ -51,9 +53,12 @@ Requires: python-pathspec >= 0.9.0
|
||||
Requires: python-platformdirs >= 2
|
||||
Requires: python-tomli >= 1.1.0
|
||||
Requires: python-typing_extensions
|
||||
%if 0%{?python_version_nodots} == 36
|
||||
%if 0%{?python_version_nodots} < 37
|
||||
Requires: python-dataclasses
|
||||
%endif
|
||||
%if 0%{?python_version_nodots} < 38
|
||||
Requires: python-typed-ast >= 1.4.2
|
||||
%endif
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun):update-alternatives
|
||||
BuildArch: noarch
|
||||
@@ -71,7 +76,7 @@ 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}
|
||||
%autosetup -p1 -n black-%{version}
|
||||
sed -i '1{/#!/d}' src/black_primer/cli.py src/black_primer/lib.py
|
||||
|
||||
%build
|
||||
@@ -93,7 +98,8 @@ 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 or py2"
|
||||
# test_bpo_2142_workaround fails on arm
|
||||
skiptests="test_expression_diff or py2 or test_bpo_2142_workaround"
|
||||
%pytest -k "not ($skiptests)"
|
||||
|
||||
%post
|
||||
@@ -113,7 +119,7 @@ skiptests="test_expression_diff or py2"
|
||||
%{python_sitelib}/black/
|
||||
%{python_sitelib}/blackd/
|
||||
%{python_sitelib}/blib2to3/
|
||||
%{python_sitelib}/black-%{version}-py*.egg-info
|
||||
%{python_sitelib}/black-%{version}*-info
|
||||
%pycache_only %{python_sitelib}/__pycache__/*
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user