diff mbox series

[bug#55814] Updated python-flake8 and inputs to reenable build.

Message ID 20220606014315.280227-1-yewscion@gmail.com
State Accepted
Headers show
Series [bug#55814] Updated python-flake8 and inputs to reenable build. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Christopher Rodriguez June 6, 2022, 1:43 a.m. UTC
---

Hey all,

I noticed today that `python-flake8` was failing to build, as one of its inputs
(`python-pyflakes`) had been bumped too high for the older version's `check`
phase. Tried to take the initiative and threw together this patch; It builds in
my local tree, and had been linted/styled/tested/etc. I believe I have done
everything by the book, but if I need to fix anything, let me know (I'm still
new to contributing)!

Thanks for Your time!


 gnu/packages/python-xyz.scm | 54 ++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 28 deletions(-)

Comments

Liliana Marie Prikler June 6, 2022, 6:13 a.m. UTC | #1
Am Sonntag, dem 05.06.2022 um 21:43 -0400 schrieb Christopher
Rodriguez:
> It builds in my local tree, and had been linted/styled/tested/etc.
Did you also check that all the packages referring to it build?  The
upgrade to python-pyflakes ignored this important check as well as the
call not to update packages with more than 300 dependents on master.

>  gnu/packages/python-xyz.scm | 54 ++++++++++++++++++-----------------
> --
>  1 file changed, 26 insertions(+), 28 deletions(-)
> 
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-
> xyz.scm
> index 0dfc6ca7e0..77f2c88235 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -6443,23 +6443,21 @@ (define-public python-socksipychain
>  (define-public python-pycodestyle
>    (package
>      (name "python-pycodestyle")
> -    (version "2.7.0")
> -    (source
> -     (origin
> -       (method url-fetch)
> -       (uri (pypi-uri "pycodestyle" version))
> -       (sha256
> -        (base32
> -         "1vqwmzmjdv331kmfq3q9j3as2x7r2r49lf83r9w4147pdg8c32f3"))))
> +    (version "2.8.0")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (pypi-uri "pycodestyle" version))
> +              (sha256
> +               (base32
> +               
> "0zxyrg8029lzjhima6l5nk6y0z6lm5wfp9qchz3s33j3xx3mipgd"))))
Factor out into a single patch.

>      (build-system python-build-system)
>      (arguments
> -     `(#:phases
> -       (modify-phases %standard-phases
> -         (replace 'check
> -           (lambda _
> -             (invoke "pytest" "-vv"))))))
> +     `(#:phases (modify-phases %standard-phases
> +                  (replace 'check
> +                    (lambda (#:keys input output tests? #:allow-
> other-keys)
> +                      (if tests?
> +                          (invoke "pytest" "-vv")))))))
IIUC this is fixing an already existing problem; thus factor out into
its own patch.

> -    (native-inputs
> -     (list python-pytest)) 
> +    (native-inputs (list python-pytest))
I'd recommend not mixing updates and semantic fixes with style fixes.

>      (home-page "https://pycodestyle.readthedocs.io/")
>      (synopsis "Python style guide checker")
>      (description "@code{pycodestyle} (formerly pep8) is a tool to
> check
> @@ -10143,18 +10141,17 @@ (define-public python-pyflakes
>    (package
>      (name "python-pyflakes")
>      (version "2.4.0")
> -    (source
> -      (origin
> -        (method url-fetch)
> -        (uri (pypi-uri "pyflakes" version))
> -        (sha256
> -         (base32
> -          "0k5jn8jpxni264wxf6cc3xcd1qckc0pww30bsd77mwzdf8l5ra05"))))
> +    (source (origin
> +              (method url-fetch)
> +              (uri (pypi-uri "pyflakes" version))
> +              (sha256
> +               (base32
> +               
> "0k5jn8jpxni264wxf6cc3xcd1qckc0pww30bsd77mwzdf8l5ra05"))))
>      (build-system python-build-system)
>      (home-page "https://github.com/PyCQA/pyflakes")
>      (synopsis "Passive checker of Python programs")
>      (description
> -      "Pyflakes statically checks Python source code for common
> errors.")
> +     "Pyflakes statically checks Python source code for common
> errors.")
>      (license license:expat)))
Nothing to do here.

>  (define-public python-pyflakes-2.2
> @@ -10193,20 +10190,21 @@ (define-public python-mccabe
>  (define-public python-flake8
>    (package
>      (name "python-flake8")
> -    (version "3.9.2")
> +    (version "4.0.1")
Note that 4.0.1 is a semver break from 3.9 – also, we still supply 3.8.
Thus, you might want to keep python-flake8-3.9 as a variant.

>      (source (origin
>                (method url-fetch)
>                (uri (pypi-uri "flake8" version))
>                (sha256
>                 (base32
> -               
> "0sspgh2ph7bb5fmf49mrdhi7n5m421kfkxk1n0vn4akgg20q6lh7"))))
> +               
> "03c7mnk34wfz7a0m5zq0273y94awz69fy5iww8alh4a4v96h6vl0"))))
>      (build-system python-build-system)
>      (arguments
>       `(#:phases (modify-phases %standard-phases
>                    (replace 'check
> -                    (lambda* (#:key inputs outputs #:allow-other-
> keys)
> -                      (add-installed-pythonpath inputs outputs)
> -                      (invoke "pytest" "-v"))))))
> +                    (lambda* (#:key inputs outputs tests? #:allow-
> other-keys)
> +                      (if tests?
> +                          (add-installed-pythonpath inputs outputs)
> +                          (invoke "pytest" "-v")))))))
Again, should be its own patch.

Cheers
M June 6, 2022, 9:31 a.m. UTC | #2
Christopher Rodriguez schreef op zo 05-06-2022 om 21:43 [-0400]:
> +                      (if tests?
> +                          (add-installed-pythonpath inputs outputs)
> +                          (invoke "pytest" "-v")))))))

This does the following:

  * if tests?=#true, do (add-installed-pythonpath ...
  * if tests?=#false, do (invoke ...)

You'll probably need

 (when tests?
    (add-installed-pythonpath ...)
    (invoke ...))

instead.

Greetings,
Maxime.
Christopher Rodriguez June 7, 2022, 1:12 a.m. UTC | #3
Hey all,

I've just submitted an 8 patch set. I think I've managed to isolate each change.

I'm currently ~65% of the way through rebuilding the following 178 packages in
my local guix repository after the changes. No issues yet; If I encounter any I
will update with a patch to fix it.

Worth mentioning, this list of 178 was what `guix refresh --list-dependent
python-flake8 python-pyflakes python-pycodestyle` said would trigger a rebuild
of all 370 packages that depend on the above 3.

Including the list of packages I am explicitly building here for transparency.

--

Christopher Rodriguez
magic-wormhole@0.12.0 python-autoflake@1.3.1 python-pytest-pycodestyle@2.2.0
tractor@3.13 nyx@2.1.0 onionshare@2.4 python-flake8-todo@0.7 python-fpylll@0.5.2
python-biom-format@2.1.10 python-databases@0.5.5 python-tortoise-orm@0.17.8
docker-compose@1.29.2 repo2docker@2021.08.0 python-celery@5.2.6
emacs-elpy@1.35.0-1.1746e70 python-mt-940@4.23.0 piper@0.6
python-markdownify@0.10.1 cozy@1.2.0 emacs-emms-mode-line-cycle@0.2.5
emacs-helm-emms@1.3-3.37e5aa0 emacs-org-emms@0.1-1.07a8917 gpodder@3.10.21
quodlibet@4.5.0 beets-bandcamp@0.1.4 picard@2.4.4 anki@2.1.16 ytfzf@2.3
curseradio@0-1.1bd4bd0 gfeeds@0.16.2 celluloid@0.23 mpv-mpris@0.6
smplayer@21.10.0 pipe-viewer@0.2.0 python-tweepy@4.4.0 python-hic2cool@0.8.3
python-hicexplorer@2.1.4 c-vise@2.4.0 python-pytest-csv@3.0.0 hangups@0.4.18
python-behave-web-api@1.0.6 python-pyvips@2.2.0 python-jaraco-packaging@6.1
python-woob@3.0 python-mastodon-py@1.5.1 python-flasgger@0.6.3 python-furl@2.1.3
tgcli@0.3.1 scvelo@0.2.4 python-minikanren@1.0.1 conda@4.10.3 fdroidserver@1.1.9
python-photutils@1.3.0 python-astropy-healpix@0.6 python-regions@0.5
python-gwcs@0.18.0 python-iml@0.6.2 python-slurm-magic@0.0-0.73dd1a2
python-pytest-exploratory@0.5 python-ipdb@0.13.9 autokey@0.95.10
python-pyfuse3@3.2.1 python-telethon@1.17.5 emacs-calibredb@2.10.0
python-astroquery@0.4.6 vorta@0.8.3 cura@4.13.1 jrnl@1.9.7 python-harmony@0.7.1
caja-extensions@1.24.1 python-swiftclient@2.6.0 dbxfs@1.0.51 linuxdcpp@1.1.0
ikiwiki@3.20200202.3 breezy@3.2.2 poetry@1.1.12 openconnect-sso@0.7.3
snakemake@7.7.0 electrum@4.2.1 python-trio-websocket@0.9.2
python-bash-kernel@0.7.2 xeus@2.4.1 r-torch@0.7.2 python-pari-jupyter@1.4.1
python-hyperopt@0.2.5 python-ipython-cluster-helper@0.6.4 pgcli@3.2.0
rfcat@1.9.5-1.725bf79 ruby-iruby@0.3 nanosv@1.2.4 tombo@1.5.1
python-pytest-perf@0.12.0 python-nb-clean@2.1.0 pigx-sars-cov-2@0.0.7 pigx@0.0.3
snakemake@6.15.5 tuir@1.29.0 rtv@1.27.0 python-django-taggit@1.3.0
emacs-py-isort@2016.1 abjad-ext-nauert@3.4 abjad-ext-rmakers@3.4 komikku@0.38.0
vdirsyncer@0.18.0 orange@3.31.1 python-mailman-hyperkitty@1.2.0
python-falcon-cors@1.1.7 ibus-theme-tools@4.2.0 postorius@1.3.3
emacs-flycheck-cpplint@0.1-1.1d8a090 giara@0.3 python-scrapy@2.6.1 offlate@0.5
ledger-agent@0.9.0 keepkey-agent@0.9.0 trezor-agent@0.11.0-1
python-psycopg@3.0.8 synapse@1.29.0 python-pyvista@0.34.0 python-pygmsh@7.1.11
r-destiny@3.10.0 python-pytest-check-links@0.3.0 python-nbdime@3.1.1
python-sparqlkernel@1.3.0 python-plotly@5.6.0 python-ipydatawidgets@4.2.0
python-ipympl@0.9.1 python-matplotlib-documentation@3.5.2 scregseg@0.1.1
r-irkernel@1.3 abjad-ext-ipython@3.3 guix-jupyter@0.2.2 python-nbsphinx@0.8.8
python-jupyter-sphinx@0.3.2 python-qstylizer@0.1.10 weasyprint@54.3
python-ajsonrpc@1.2.0 python-flake8-isort@4.1.1 python-textdistance@4.2.1
python-libcst@0.3.8 python-arpeggio@2.0.0 audio-to-midi@2020.7 gdc-client@1.6.0
python-transient@0.12 mdpo@0.3.6 ccwl@0.2.0 python-pygenometracks@3.3
gourmet@0.17.4-0.8af29c8 389-ds-base@1.4.4.17 python-yq@2.11.1 python-tldr@3.1.0
sshoot@1.5.1 python-pyls-black@0.4.7 python-flake8-continuation@1.0.5
weechat-matrix@0.3.0 pantalaimon@0.10.3 python-flask-restx@0.5.1
python-minio@6.0.0 nototools@0.2.16 python-ipython-documentation@8.2.0
python-numpy-documentation@1.21.6 python-hyperkitty@1.3.5 archivebox@0.6.2
mbed-tools@7.53.0 python-flask-combo-jsonapi@1.1.0 electron-cash@4.2.7
python-pystitcher@1.0.4 python-argopt@0.7.0 python-jinja2-cli@0.7.0
python-xenon@0.7.0 python-codespell@2.1.0 python-flake8-pyi@20.10.0
python-flake8-quotes@3.2.0 nikola@8.1.3 python-dolfin-adjoint@2019.1.0
qmpbackup@0.23 sshuttle@0.78.5 qtile@0.18.1
Maxim Cournoyer June 7, 2022, 1:22 p.m. UTC | #4
Hi Christopher,

Christopher Rodriguez <yewscion@gmail.com> writes:

> ---
>
> Hey all,
>
> I noticed today that `python-flake8` was failing to build, as one of its inputs
> (`python-pyflakes`) had been bumped too high for the older version's `check`
> phase. Tried to take the initiative and threw together this patch; It builds in
> my local tree, and had been linted/styled/tested/etc. I believe I have done
> everything by the book, but if I need to fix anything, let me know (I'm still
> new to contributing)!

Hehe, it seems at least 3 people noticed and tried fixing the problem,
which is nice!

python-pycodestyle ended up being updated by Petr Hodina in 2660f99b57
and python-flake8 to 4.0.1 in 5022cf8e04 by myself.  I've tested the
dependent packages (those reported by 'guix refresh --list
python-pycodestyle python-flake8' could still build, fixing a few
failing ones).

So I believe we've got that flake8 situation covered :-).

Thank you!

Closing.

Maxim
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0dfc6ca7e0..77f2c88235 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6443,23 +6443,21 @@  (define-public python-socksipychain
 (define-public python-pycodestyle
   (package
     (name "python-pycodestyle")
-    (version "2.7.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (pypi-uri "pycodestyle" version))
-       (sha256
-        (base32
-         "1vqwmzmjdv331kmfq3q9j3as2x7r2r49lf83r9w4147pdg8c32f3"))))
+    (version "2.8.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "pycodestyle" version))
+              (sha256
+               (base32
+                "0zxyrg8029lzjhima6l5nk6y0z6lm5wfp9qchz3s33j3xx3mipgd"))))
     (build-system python-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (invoke "pytest" "-vv"))))))
-    (native-inputs
-     (list python-pytest))
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda (#:keys input output tests? #:allow-other-keys)
+                      (if tests?
+                          (invoke "pytest" "-vv")))))))
+    (native-inputs (list python-pytest))
     (home-page "https://pycodestyle.readthedocs.io/")
     (synopsis "Python style guide checker")
     (description "@code{pycodestyle} (formerly pep8) is a tool to check
@@ -10143,18 +10141,17 @@  (define-public python-pyflakes
   (package
     (name "python-pyflakes")
     (version "2.4.0")
-    (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "pyflakes" version))
-        (sha256
-         (base32
-          "0k5jn8jpxni264wxf6cc3xcd1qckc0pww30bsd77mwzdf8l5ra05"))))
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "pyflakes" version))
+              (sha256
+               (base32
+                "0k5jn8jpxni264wxf6cc3xcd1qckc0pww30bsd77mwzdf8l5ra05"))))
     (build-system python-build-system)
     (home-page "https://github.com/PyCQA/pyflakes")
     (synopsis "Passive checker of Python programs")
     (description
-      "Pyflakes statically checks Python source code for common errors.")
+     "Pyflakes statically checks Python source code for common errors.")
     (license license:expat)))
 
 (define-public python-pyflakes-2.2
@@ -10193,20 +10190,21 @@  (define-public python-mccabe
 (define-public python-flake8
   (package
     (name "python-flake8")
-    (version "3.9.2")
+    (version "4.0.1")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "flake8" version))
               (sha256
                (base32
-                "0sspgh2ph7bb5fmf49mrdhi7n5m421kfkxk1n0vn4akgg20q6lh7"))))
+                "03c7mnk34wfz7a0m5zq0273y94awz69fy5iww8alh4a4v96h6vl0"))))
     (build-system python-build-system)
     (arguments
      `(#:phases (modify-phases %standard-phases
                   (replace 'check
-                    (lambda* (#:key inputs outputs #:allow-other-keys)
-                      (add-installed-pythonpath inputs outputs)
-                      (invoke "pytest" "-v"))))))
+                    (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+                      (if tests?
+                          (add-installed-pythonpath inputs outputs)
+                          (invoke "pytest" "-v")))))))
     (propagated-inputs (list python-pycodestyle python-entrypoints
                              python-pyflakes python-mccabe))
     (native-inputs (list python-mock python-pytest))