GNU bug report logs - #53640
Python-black 22.1.0 update

Previous Next

Package: guix-patches;

Reported by: Leo Famulari <leo <at> famulari.name>

Date: Sun, 30 Jan 2022 20:21:02 UTC

Severity: normal

Done: 宋文武 <iyzsong <at> envs.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53640 in the body.
You can then email your comments to 53640 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#53640; Package guix-patches. (Sun, 30 Jan 2022 20:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Famulari <leo <at> famulari.name>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 30 Jan 2022 20:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: guix-patches <at> gnu.org
Cc: monego <at> posteo.net, marius <at> gnu.org
Subject: Python-black 22.1.0 update
Date: Sun, 30 Jan 2022 15:20:02 -0500
These patches update python-black to 22.1.0, so it's no longer a beta.

I rebuilt all packages reported by `guix refresh -l python-black`, and
the only new failure is of python-pyls-black. Basically, all of its
tests fail like this:

------
filename = '/tmp/guix-build-python-pyls-black-0.4.7.drv-0/source/tests/fixtures/example.py'

    def load_config(filename: str) -> Dict:
        defaults = {
            "line_length": 88,
            "fast": False,
            "pyi": filename.endswith(".pyi"),
            "skip_string_normalization": False,
            "target_version": set(),
        }
    
        root = black.find_project_root((filename,))
    
>       pyproject_filename = root / "pyproject.toml"
E       TypeError: unsupported operand type(s) for /: 'tuple' and 'str'

pyls_black/plugin.py:76: TypeError
=========================== short test summary info ============================
FAILED tests/test_plugin.py::test_pylsp_format_document - TypeError: unsuppor...
FAILED tests/test_plugin.py::test_pyls_format_pyi_document - TypeError: unsup...
FAILED tests/test_plugin.py::test_pylsp_format_document_unchanged - TypeError...
FAILED tests/test_plugin.py::test_pyls_format_pyi_document_unchanged - TypeEr...
FAILED tests/test_plugin.py::test_pylsp_format_document_syntax_error - TypeEr...
FAILED tests/test_plugin.py::test_pylsp_format_document_with_config - TypeErr...
FAILED tests/test_plugin.py::test_pylsp_format_range[0-0-a = "hello"\n] - Typ...
FAILED tests/test_plugin.py::test_pylsp_format_range[1-1-b = 42\n] - TypeErro...
FAILED tests/test_plugin.py::test_pylsp_format_range[0-1-a = "hello"\nb = 42\n]
FAILED tests/test_plugin.py::test_pylsp_format_range_unchanged - TypeError: u...
FAILED tests/test_plugin.py::test_pylsp_format_range_syntax_error - TypeError...
FAILED tests/test_plugin.py::test_load_config - TypeError: unsupported operan...
FAILED tests/test_plugin.py::test_load_config_target_version - TypeError: uns...
FAILED tests/test_plugin.py::test_load_config_py36 - TypeError: unsupported o...
FAILED tests/test_plugin.py::test_load_config_defaults - TypeError: unsupport...
========================= 15 failed, 1 passed in 0.47s =========================
------

Any ideas? I've CC-ed the people who have touched the python-pyls-black
package.




Information forwarded to guix-patches <at> gnu.org:
bug#53640; Package guix-patches. (Sun, 30 Jan 2022 20:23:02 GMT) Full text and rfc822 format available.

Message #8 received at 53640 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: 53640 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add python-click 8.0.3.
Date: Sun, 30 Jan 2022 15:22:22 -0500
* gnu/packages/python-xyz.scm (python-click-8): New variable.
---
 gnu/packages/python-xyz.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4f77fae8d0..4875d7dd64 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3420,6 +3420,17 @@ (define-public python-click
 (define-public python2-click
   (package-with-python2 python-click))
 
+(define-public python-click-8
+  (package (inherit python-click)
+    (version "8.0.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "click" version))
+       (sha256
+        (base32
+         "0nybbsgaff8ihfh74nhmng6qj74pfpg99njc7ivysphg0lmr63j1"))))))
+
 (define-public python-click-5
   (package (inherit python-click)
     (name "python-click")
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53640; Package guix-patches. (Sun, 30 Jan 2022 20:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 53640 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: 53640 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: python-black: Update to 22.1.0.
Date: Sun, 30 Jan 2022 15:22:23 -0500
* gnu/packages/python-xyz.scm (python-black): Update to 22.1.0.
[propagated-inputs]: Replace python-click with python-click-8.
[arguments]: Remove obsolete 'relax-version-requirements' build phase.
---
 gnu/packages/python-xyz.scm | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4875d7dd64..028ec7dc8a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5237,25 +5237,18 @@ (define-public python-pathspec
 (define-public python-black
   (package
     (name "python-black")
-    (version "21.12b0")
+    (version "22.1.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "black" version))
        (sha256
         (base32
-         "1czjwr1bx9ax5l64xfi54sxb1ycdy4s9ciaqg592x7jn79lhzf3p"))))
+         "1ddgh0da9kqdmzypkvi9srfjxs8mg75pbrab2z0nypv36lnikh57"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         ;; XXX Remove this when updating this package:
-         ;; https://github.com/psf/black/issues/2703#issuecomment-1004752142
-         (add-after 'unpack 'relax-version-requirements
-           (lambda _
-             (substitute* "setup.py"
-               (("tomli[^\"]*\",")
-                "tomli\","))))
          (add-after 'patch-source-shebangs 'use-absolute-file-names
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
              (let* ((inpts (or native-inputs inputs))
@@ -5293,7 +5286,7 @@ (define-public python-black
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests? (invoke "pytest" "-vv")))))))
     (propagated-inputs
-     (list python-click
+     (list python-click-8
            python-attrs
            python-appdirs
            python-pathspec
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53640; Package guix-patches. (Mon, 31 Jan 2022 00:43:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: Leo Famulari <leo <at> famulari.name>, guix-patches <at> gnu.org
Cc: marius <at> gnu.org
Subject: Re: Python-black 22.1.0 update
Date: Mon, 31 Jan 2022 00:41:46 +0000
Black changed the return type for find_project_root in this version. It
now returns a tuple instead of a Path object. See [1] and [2] to
compare the latest stable with the version in Guix.

That is, lsp-black is not compatible with this version. If that is the
only error then I guess [3] (or two lines below) can be patched via
substitution to extract the first element of the tuple, corresponding
to the Path, but I haven't tried this.

[1]
https://github.com/psf/black/blob/d038a24ca200da9dacc1dcb05090c9e5b45b7869/src/black/files.py#L33

[2]
https://github.com/psf/black/blob/f1d4e742c91dd5179d742b0db9293c4472b765f8/src/black/files.py#L33

[3]
https://github.com/rupert/pyls-black/blob/0f2e9ed8c0fb20f7f88fe47e11b723e311b568d6/pyls_black/plugin.py#L74

Em dom, 2022-01-30 às 15:20 -0500, Leo Famulari escreveu:
> These patches update python-black to 22.1.0, so it's no longer a
> beta.
> 
> I rebuilt all packages reported by `guix refresh -l python-black`,
> and
> the only new failure is of python-pyls-black. Basically, all of its
> tests fail like this:
> 
> ------
> filename = '/tmp/guix-build-python-pyls-black-0.4.7.drv-
> 0/source/tests/fixtures/example.py'
> 
>     def load_config(filename: str) -> Dict:
>         defaults = {
>             "line_length": 88,
>             "fast": False,
>             "pyi": filename.endswith(".pyi"),
>             "skip_string_normalization": False,
>             "target_version": set(),
>         }
>     
>         root = black.find_project_root((filename,))
>     
> >       pyproject_filename = root / "pyproject.toml"
> E       TypeError: unsupported operand type(s) for /: 'tuple' and
> 'str'
> 
> pyls_black/plugin.py:76: TypeError
> =========================== short test summary info
> ============================
> FAILED tests/test_plugin.py::test_pylsp_format_document - TypeError:
> unsuppor...
> FAILED tests/test_plugin.py::test_pyls_format_pyi_document -
> TypeError: unsup...
> FAILED tests/test_plugin.py::test_pylsp_format_document_unchanged -
> TypeError...
> FAILED tests/test_plugin.py::test_pyls_format_pyi_document_unchanged
> - TypeEr...
> FAILED tests/test_plugin.py::test_pylsp_format_document_syntax_error
> - TypeEr...
> FAILED tests/test_plugin.py::test_pylsp_format_document_with_config -
> TypeErr...
> FAILED tests/test_plugin.py::test_pylsp_format_range[0-0-a =
> "hello"\n] - Typ...
> FAILED tests/test_plugin.py::test_pylsp_format_range[1-1-b = 42\n] -
> TypeErro...
> FAILED tests/test_plugin.py::test_pylsp_format_range[0-1-a =
> "hello"\nb = 42\n]
> FAILED tests/test_plugin.py::test_pylsp_format_range_unchanged -
> TypeError: u...
> FAILED tests/test_plugin.py::test_pylsp_format_range_syntax_error -
> TypeError...
> FAILED tests/test_plugin.py::test_load_config - TypeError:
> unsupported operan...
> FAILED tests/test_plugin.py::test_load_config_target_version -
> TypeError: uns...
> FAILED tests/test_plugin.py::test_load_config_py36 - TypeError:
> unsupported o...
> FAILED tests/test_plugin.py::test_load_config_defaults - TypeError:
> unsupport...
> ========================= 15 failed, 1 passed in 0.47s
> =========================
> ------
> 
> Any ideas? I've CC-ed the people who have touched the python-pyls-
> black
> package.






Information forwarded to guix-patches <at> gnu.org:
bug#53640; Package guix-patches. (Mon, 31 Jan 2022 21:07:01 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Vinicius Monego <monego <at> posteo.net>
Cc: guix-patches <at> gnu.org, marius <at> gnu.org
Subject: Re: Python-black 22.1.0 update
Date: Mon, 31 Jan 2022 16:06:02 -0500
On Mon, Jan 31, 2022 at 12:41:46AM +0000, Vinicius Monego wrote:
> That is, lsp-black is not compatible with this version. If that is the
> only error then I guess [3] (or two lines below) can be patched via
> substitution to extract the first element of the tuple, corresponding
> to the Path, but I haven't tried this.

Thanks, reported upstream:

https://github.com/rupert/pyls-black/issues/40




Reply sent to 宋文武 <iyzsong <at> envs.net>:
You have taken responsibility. (Fri, 05 Aug 2022 01:28:01 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Fri, 05 Aug 2022 01:28:02 GMT) Full text and rfc822 format available.

Message #22 received at 53640-done <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> envs.net>
To: Leo Famulari <leo <at> famulari.name>
Cc: 53640-done <at> debbugs.gnu.org, monego <at> posteo.net, marius <at> gnu.org
Subject: Re: bug#53640: Python-black 22.1.0 update
Date: Fri, 05 Aug 2022 09:27:09 +0800
Leo Famulari <leo <at> famulari.name> writes:

> These patches update python-black to 22.1.0, so it's no longer a beta.

We already have python-black 22.3.0, while the latest version is 22.6.0,
feel free to update it in another issue.  Close this now :)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 02 Sep 2022 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.