unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Matthias Meulien <orontee@gmail.com>
Cc: 64406-done@debbugs.gnu.org
Subject: bug#64406: [PATCH] Improve commands to manage Python imports
Date: Thu, 06 Jul 2023 10:28:14 +0300	[thread overview]
Message-ID: <83leftijn5.fsf@gnu.org> (raw)
In-Reply-To: <874jmnbd5v.fsf@gmail.com> (message from Matthias Meulien on Sat,  01 Jul 2023 22:16:28 +0200)

> From: Matthias Meulien <orontee@gmail.com>
> Date: Sat, 01 Jul 2023 22:16:28 +0200
> 
> Commands python-add-import, python-remove-imports and
> python-sort-imports run a short Python script stored in variable
> python--list-imports; That script starts with:
> 
>     from isort import find_imports_in_stream, find_imports_in_paths
> 
> But find_imports_in_stream and find_imports_in_paths were introduced in
> version 5.7.0 of the isort library.
> 
> Debian bookworm has isort version 5.6.4 in its package repositories.
> Thus on such system commands python-add-import, python-remove-import
> and python-sort-imports fail with error message:
> 
>     python exited with status 1 (maybe isort is missing?)
> 
> This is misleading when the isort library is installed.
> 
> I suggest to extend the Python script in order to catch the import
> errors and return status 1 if the isort library is not found and status
> 2 if the expected symbols aren't found.  The error message can then be
> specialized.  This is what I implemented in the attached patch.

Thanks, installed on the master branch and closing the bug.





  reply	other threads:[~2023-07-06  7:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01 20:16 bug#64406: [PATCH] Improve commands to manage Python imports Matthias Meulien
2023-07-06  7:28 ` Eli Zaretskii [this message]
2023-07-07 17:02 ` Augusto Stoffel
2023-07-07 17:46   ` Matthias Meulien
2023-07-09  6:09     ` Matthias Meulien
2023-07-09  6:32       ` Matthias Meulien
2023-07-09  7:28         ` Eli Zaretskii
2023-07-09  7:54           ` Matthias Meulien
2023-07-13  6:07       ` Eli Zaretskii
2023-07-13 21:07         ` Matthias Meulien
2023-07-15  8:25           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83leftijn5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64406-done@debbugs.gnu.org \
    --cc=orontee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).