#5 Update to 20.8b1 and apply some packaging changes
Merged 3 years ago by churchyard. Opened 3 years ago by churchyard.
rpms/ churchyard/python-black 20.8b0  into  master

file modified
+2
@@ -6,3 +6,5 @@ 

  /black-18.9b0.tar.gz

  /black-19.3b0.tar.gz

  /black-19.10b0.tar.gz

+ /black-20.8b0.tar.gz

+ /black-20.8b1.tar.gz

@@ -1,37 +0,0 @@ 

- From 9c444f5b9680ed5be75afcf8f728983f9c4be656 Mon Sep 17 00:00:00 2001

- From: Adam Williamson <awilliam@redhat.com>

- Date: Wed, 3 Jun 2020 15:05:54 -0700

- Subject: [PATCH] HACK: nerf beginning_backslash test to pass with Python 3.9b4

- 

- This is a hack, not a real fix. We really want the empty lines

- to be there, but the new parser in Python 3.9 treats an empty

- line after a backslash like this as a syntax error:

- https://bugs.python.org/issue40847

- so the test cannot pass as intended on current Python 3.9. This

- should be removed when Python is fixed.

- 

- Signed-off-by: Adam Williamson <awilliam@redhat.com>

- ---

-  tests/data/beginning_backslash.py | 7 -------

-  1 file changed, 7 deletions(-)

- 

- diff --git a/tests/data/beginning_backslash.py b/tests/data/beginning_backslash.py

- index 66c347d..73a1ba4 100644

- --- a/tests/data/beginning_backslash.py

- +++ b/tests/data/beginning_backslash.py

- @@ -1,12 +1,5 @@

-  \

- -

- -

- -

- -

- -

-  print("hello, world")

-  

-  # output

- -

- -

-  print("hello, world")

- -- 

- 2.26.2

- 

@@ -1,60 +0,0 @@ 

- From 68b118be1e14e22b032fcafc93a0a279888a24fb Mon Sep 17 00:00:00 2001

- From: Adam Williamson <awilliam@redhat.com>

- Date: Wed, 3 Jun 2020 14:43:58 -0700

- Subject: [PATCH] expression tests: adjust starred expression for Python 3.9

-  (#1441)

- 

- As discussed in #1441, Python 3.9's new parser will not parse

- `(*starred)` even using `compile()` with the `PyCF_ONLY_AST`

- flag (as `ast.parse()` does), it raises a `SyntaxError`. This

- breaks the four tests that use this file with Python 3.9.

- Upstream does not consider this to be a bug - see

- https://bugs.python.org/issue40848#msg370643 - so we must

- adjust the expression. As suggested by @JelleZijlstra, this just

- adds a comma, which makes the new parser happy with it (the old

- parser is fine with this form also).

- 

- Signed-off-by: Adam Williamson <awilliam@redhat.com>

- ---

-  tests/data/expression.diff | 2 +-

-  tests/data/expression.py   | 4 ++--

-  2 files changed, 3 insertions(+), 3 deletions(-)

- 

- diff --git a/tests/data/expression.diff b/tests/data/expression.diff

- index 8c9e8a7..f47ee1c 100644

- --- a/tests/data/expression.diff

- +++ b/tests/data/expression.diff

- @@ -179,7 +179,7 @@

-  -((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))

-  +((i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))

-   (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))

- - (*starred)

- + (*starred,)

-  -{"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}

-  +{

-  +    "id": "1",

- diff --git a/tests/data/expression.py b/tests/data/expression.py

- index 3bcf52b..6a04db8 100644

- --- a/tests/data/expression.py

- +++ b/tests/data/expression.py

- @@ -146,7 +146,7 @@ SomeName

-  ((i ** 2) for i in (1, 2, 3))

-  ((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))

-  (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))

- -(*starred)

- +(*starred,)

-  {"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}

-  a = (1,)

-  b = 1,

- @@ -431,7 +431,7 @@ SomeName

-  ((i ** 2) for i in (1, 2, 3))

-  ((i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))

-  (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))

- -(*starred)

- +(*starred,)

-  {

-      "id": "1",

-      "type": "type",

- -- 

- 2.26.2

- 

file modified
+22 -22
@@ -1,26 +1,20 @@ 

  %global pypi_name        black

- %global base_version     19.10

- %global prerel           b0

+ %global base_version     20.8

+ %global prerel           b1

  %global upstream_version %{base_version}%{?prerel}

  Name:           python-%{pypi_name}

  Version:        %{base_version}%{?prerel:~%{prerel}}

- Release:        4%{?dist}

+ Release:        1%{?dist}

  Summary:        The uncompromising code formatter

  License:        MIT

  URL:            https://github.com/psf/black

  Source0:        %{pypi_source %{pypi_name} %{upstream_version}}

  Source1:        black.1

  Source2:        blackd.1

- # Tweak starred expression to work with Python 3.9 parser

- # https://github.com/psf/black/pull/1477

- Patch0:         0001-expression-tests-adjust-starred-expression-for-Pytho.patch

- # FIXME: hack up beginning_backslash test to work around Python 3.9

- # parser bug https://bugs.python.org/issue40847 . Not submitted

- # upstream as this is just a hack, the new upstream Python parser

- # needs to be fixed to not treat this as a syntax error

- Patch1:         0001-HACK-nerf-beginning_backslash-test-to-pass-with-Pyth.patch

+ 

  BuildArch:      noarch

  

+ BuildRequires:  python3-devel

  BuildRequires:  pyproject-rpm-macros

  

  %global _description %{expand:
@@ -61,10 +55,11 @@ 

  

  %install

  %pyproject_install

+ %pyproject_save_files 'black*' '_black*' blib2to3

  

- ln -s ./black %{buildroot}%{_bindir}/black-%{python3_version}

- ln -s ./blackd %{buildroot}%{_bindir}/blackd-%{python3_version}

- # ln -s ./black-{python3_version} {buildroot}{_bindir}/black-3

+ for exe in black blackd black-primer; do

+   ln -sr %{buildroot}%{_bindir}/${exe}{,-%{python3_version}}

+ done

  

  install -D -m 644 %{SOURCE1} %{buildroot}%{_mandir}/man1/black.1

  install -D -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1/blackd.1
@@ -73,10 +68,12 @@ 

  %check

  export PIP_INDEX_URL=http://host.invalid./

  export PIP_NO_DEPS=yes

+ export PYTHONPATH=%{buildroot}%{python3_sitelib}

+ export PATH=%{buildroot}%{_bindir}:$PATH

  %{python3} setup.py test

  

  

- %files -n %{pypi_name}

+ %files -n %{pypi_name} -f %{pyproject_files}

  %license LICENSE

  %doc README.md

  %{_bindir}/black
@@ -85,16 +82,19 @@ 

  %{_bindir}/blackd

  %{_bindir}/blackd-%{python3_version}

  %{_mandir}/man1/blackd.1*

- 

- %{python3_sitelib}/__pycache__/black*

- %{python3_sitelib}/__pycache__/_black*

- %{python3_sitelib}/black*.py

- %{python3_sitelib}/_black*.py

- %{python3_sitelib}/blib2to3/

- %{python3_sitelib}/%{pypi_name}-%{upstream_version}.dist-info/

+ %{_bindir}/black-primer

+ %{_bindir}/black-primer-%{python3_version}

  

  

  %changelog

+ * Wed Aug 26 2020 Miro Hrončok <mhroncok@redhat.com> - 20.8~b1-1

+ - Update to 20.8b1

+ - Fixes rhbz#1872790

+ 

+ * Wed Aug 26 2020 Miro Hrončok <mhroncok@redhat.com> - 20.8~b0-1

+ - Update to 20.8b0

+ - Fixes rhbz#1872743

+ 

  * Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 19.10~b0-4

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (black-19.10b0.tar.gz) = abc6d2623ab50e59bed01fdb7a6ee7434c2d3e0f779a046d9141087aa6ef46b73b3aacc6bf84ac70b9384817bd2c707a3fa262811f11a2f61a99251d2b84dd02

+ SHA512 (black-20.8b1.tar.gz) = f047c2a1ce759a8e19eed2e1869752bb8a63bf17a554aff5d9e834a48cd390b23918b78e01d5c36c0fb7599439d7e422847bde504ff698d53df5c5939a8870d2

no initial comment

1 new commit added

  • Update to 20.8b1
3 years ago

I far as I know from twitter, they are only one issue from a stable release so it might make sense to wait for a while.

But the diff looks good to me and the resulting RPM works very well.

Since we were still in beta I don't think another beta would harm us and since it is there, let's ship it. I'll wait couple more weeks for the final release before considering backports.

Pull-Request has been merged by churchyard

3 years ago