unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#53640] Python-black 22.1.0 update
@ 2022-01-30 20:20 Leo Famulari
  2022-01-30 20:22 ` [bug#53640] [PATCH 1/2] gnu: Add python-click 8.0.3 Leo Famulari
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Leo Famulari @ 2022-01-30 20:20 UTC (permalink / raw)
  To: 53640; +Cc: monego, marius

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.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#53640] [PATCH 1/2] gnu: Add python-click 8.0.3.
  2022-01-30 20:20 [bug#53640] Python-black 22.1.0 update Leo Famulari
@ 2022-01-30 20:22 ` Leo Famulari
  2022-01-30 20:22   ` [bug#53640] [PATCH 2/2] gnu: python-black: Update to 22.1.0 Leo Famulari
  2022-01-31  0:41 ` [bug#53640] Python-black 22.1.0 update Vinicius Monego
  2022-08-05  1:27 ` bug#53640: " 宋文武 via Guix-patches via
  2 siblings, 1 reply; 6+ messages in thread
From: Leo Famulari @ 2022-01-30 20:22 UTC (permalink / raw)
  To: 53640

* 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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#53640] [PATCH 2/2] gnu: python-black: Update to 22.1.0.
  2022-01-30 20:22 ` [bug#53640] [PATCH 1/2] gnu: Add python-click 8.0.3 Leo Famulari
@ 2022-01-30 20:22   ` Leo Famulari
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2022-01-30 20:22 UTC (permalink / raw)
  To: 53640

* 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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#53640] Python-black 22.1.0 update
  2022-01-30 20:20 [bug#53640] Python-black 22.1.0 update Leo Famulari
  2022-01-30 20:22 ` [bug#53640] [PATCH 1/2] gnu: Add python-click 8.0.3 Leo Famulari
@ 2022-01-31  0:41 ` Vinicius Monego
  2022-01-31 21:06   ` Leo Famulari
  2022-08-05  1:27 ` bug#53640: " 宋文武 via Guix-patches via
  2 siblings, 1 reply; 6+ messages in thread
From: Vinicius Monego @ 2022-01-31  0:41 UTC (permalink / raw)
  To: leo, 53640; +Cc: marius

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.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#53640] Python-black 22.1.0 update
  2022-01-31  0:41 ` [bug#53640] Python-black 22.1.0 update Vinicius Monego
@ 2022-01-31 21:06   ` Leo Famulari
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2022-01-31 21:06 UTC (permalink / raw)
  To: Vinicius Monego; +Cc: 53640, marius

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53640: Python-black 22.1.0 update
  2022-01-30 20:20 [bug#53640] Python-black 22.1.0 update Leo Famulari
  2022-01-30 20:22 ` [bug#53640] [PATCH 1/2] gnu: Add python-click 8.0.3 Leo Famulari
  2022-01-31  0:41 ` [bug#53640] Python-black 22.1.0 update Vinicius Monego
@ 2022-08-05  1:27 ` 宋文武 via Guix-patches via
  2 siblings, 0 replies; 6+ messages in thread
From: 宋文武 via Guix-patches via @ 2022-08-05  1:27 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 53640-done, monego, marius

Leo Famulari <leo@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 :)




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-05  1:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-30 20:20 [bug#53640] Python-black 22.1.0 update Leo Famulari
2022-01-30 20:22 ` [bug#53640] [PATCH 1/2] gnu: Add python-click 8.0.3 Leo Famulari
2022-01-30 20:22   ` [bug#53640] [PATCH 2/2] gnu: python-black: Update to 22.1.0 Leo Famulari
2022-01-31  0:41 ` [bug#53640] Python-black 22.1.0 update Vinicius Monego
2022-01-31 21:06   ` Leo Famulari
2022-08-05  1:27 ` bug#53640: " 宋文武 via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).