14
0
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:
2022-01-28 08:18:03 +00:00
committed by Git OBS Bridge
parent 40c9ee755b
commit fd961282b7
3 changed files with 47 additions and 6 deletions

26
black-pr2718-unpin.patch Normal file
View File

@@ -0,0 +1,26 @@
From db122581108fe81794acb57b9673ee703b131891 Mon Sep 17 00:00:00 2001
From: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Date: Tue, 21 Dec 2021 08:27:50 -0800
Subject: [PATCH] Drop upper version bounds on dependencies
They mostly cause unnecessary trouble.
---
setup.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index d314bb283..8ff498e4f 100644
--- a/setup.py
+++ b/setup.py
@@ -99,9 +99,9 @@ def find_python_files(base: Path) -> List[Path]:
install_requires=[
"click>=7.1.2",
"platformdirs>=2",
- "tomli>=0.2.6,<2.0.0",
+ "tomli>=1.1.0",
"typed-ast>=1.4.2; python_version < '3.8' and implementation_name == 'cpython'",
- "pathspec>=0.9.0, <1",
+ "pathspec>=0.9.0",
"dataclasses>=0.6; python_version < '3.7'",
"typing_extensions>=3.10.0.0",
# 3.10.0.1 is broken on at least Python 3.10,

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Jan 27 12:04:33 UTC 2022 - Ben Greiner <code@bnavigator.de>
- 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
-------------------------------------------------------------------
Wed Jan 12 03:39:41 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -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