-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poetry-mode runtime error. env: unknown option --u
#44
Comments
Hi! Same error detected here, relevant bits here:
Working in a fix for this (and learning lisp in the process). Edit: related with this commit: 93c9b24. |
PR #48 is up, test the new code and verify if work correctly in your system. In my case, all is OK. |
@yukiteruamano elisp is difficult, there is little doubt to that. Whew...that was sketchy there for a minute. I haven't had to autoload a package in a while. Still receiving the same error. If it helps, because OpenBSD is a bitch, you have to keep your distribution files pristine or bad things will happen. Also, since there is no package for poetry yet, this mean you have to perform a Where is your poetry bin file located? If it is the same as those mentioned above. Then I will need to work out why it is not finding it. |
Hi! Using OpenBSD 7.3-release here, my Doom Emacs updated and not problem with this change, detect Poetry VIRTUAL_ENV and don't show errors. Tested with waifu2x python version. Edit: screencap. |
@yukiteruamano Well, that sucks. I am cleaning up my configuration after updating to 29.1, and going over any python variables. Will see if anything is uncovered. Have you tried vanilla emacs? |
@yukiteruamano I really really really (that is three) appreciate you taking over maintaining this project. It plays such a vital role in development of python applications. I know enough (or once did) ELisp to walk through the function of locating the poetry binary, which is what I will do, and see if I can get it to talk to me about hangups. In the meantime, I have enabled debugging and will post the debug output below. signal(error ("[erome scraper] Could not find ’poetry’ executable"))
error("[%s] %s" "erome scraper" "Could not find ’poetry’ executable")
poetry-error("Could not find 'poetry' executable")
(or (cond ((eq system-type 'gnu/linux) (concat "env -u VIRTUAL_ENV " (executable-find "poetry"))) ((eq system-type 'berkeley-unix) (executable-find "poetry"))) (poetry-error "Could not find 'poetry' executable"))
(let* ((prog (or (cond ((eq system-type 'gnu/linux) (concat "env -u VIRTUAL_ENV " (executable-find "poetry"))) ((eq system-type 'berkeley-unix) (executable-find "poetry"))) (poetry-error "Could not find 'poetry' executable"))) (args (if (or (string= command "run") (string= command "config") (string= command "env") (string= command "init")) (cl-concatenate 'list (list (symbol-name command)) args) (cl-concatenate 'list (list (symbol-name command) "-n" "--ansi") args)))) (let ((compilation-buffer-name-function #'(lambda (_mode) (poetry-buffer-name))) (compilation-ask-about-save nil) (compilation-save-buffers-predicate #'(lambda nil nil))) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (compile (concat prog " " (string-join args " ")))) (set-window-configuration wconfig))) (save-current-buffer (set-buffer (poetry-buffer-name)) (add-hook 'after-change-functions #'(lambda (beg end _len) (ansi-color-apply-on-region beg end)) nil t) (set (make-local-variable 'compilation-finish-functions) (append compilation-finish-functions (list #'poetry--clean-compilation-buffer #'poetry--indicate-compilation-end #'poetry--run-next-call-from-queue)))) (setq poetry-process (get-buffer-process (get-buffer (poetry-buffer-name)))) (if blocking (progn (while (eq (process-status poetry-process) 'run) (sleep-for 0.1)))) (if output (save-current-buffer (set-buffer (poetry-buffer-name)) (let ((new-name (poetry-buffer-name "output"))) (if (get-buffer new-name) (progn (kill-buffer new-name))) (poetry-display-buffer (rename-buffer new-name)) new-name)) (poetry-buffer-name))))
(let ((default-directory (or project (poetry-find-project-root) default-directory))) (if (member command '(new init config)) nil (poetry-ensure-in-project)) (let* ((prog (or (cond ((eq system-type ...) (concat "env -u VIRTUAL_ENV " ...)) ((eq system-type ...) (executable-find "poetry"))) (poetry-error "Could not find 'poetry' executable"))) (args (if (or (string= command "run") (string= command "config") (string= command "env") (string= command "init")) (cl-concatenate 'list (list (symbol-name command)) args) (cl-concatenate 'list (list (symbol-name command) "-n" "--ansi") args)))) (let ((compilation-buffer-name-function #'(lambda (_mode) (poetry-buffer-name))) (compilation-ask-about-save nil) (compilation-save-buffers-predicate #'(lambda nil nil))) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (compile (concat prog " " ...))) (set-window-configuration wconfig))) (save-current-buffer (set-buffer (poetry-buffer-name)) (add-hook 'after-change-functions #'(lambda (beg end _len) (ansi-color-apply-on-region beg end)) nil t) (set (make-local-variable 'compilation-finish-functions) (append compilation-finish-functions (list #'poetry--clean-compilation-buffer #'poetry--indicate-compilation-end #'poetry--run-next-call-from-queue)))) (setq poetry-process (get-buffer-process (get-buffer (poetry-buffer-name)))) (if blocking (progn (while (eq (process-status poetry-process) 'run) (sleep-for 0.1)))) (if output (save-current-buffer (set-buffer (poetry-buffer-name)) (let ((new-name ...)) (if (get-buffer new-name) (progn ...)) (poetry-display-buffer (rename-buffer new-name)) new-name)) (poetry-buffer-name)))))
poetry-do-call(show nil nil nil t)
(if (poetry--busy-p) (add-to-list 'poetry-call-queue (list command args (or project (poetry-find-project-root)) output blocking) t) (poetry-do-call command args project output blocking))
poetry-call(show nil nil nil t)
(let ((compbufname (poetry-call 'show nil nil nil t))) (save-current-buffer (set-buffer compbufname) (let (packs) (while (re-search-forward "^\\(.+\\)$" nil t) (setq packs (cons (match-string 1) packs))) packs)))
poetry-show-get-packages()
(completing-read "Package: " (poetry-show-get-packages))
(list (completing-read "Package: " (poetry-show-get-packages)))
call-interactively(poetry-show nil nil)
command-execute(poetry-show) |
My knowledge of Elisp is minimal, in fact, I am a new Emacs user, so the experience is not much. However, let me reproduce this on other Emacs installations (Spacemacs, to be precise) |
@yukiteruamano I got it sorted...finally...I think... My It Works! |
The error has returned, and it does not appear the previous method of designating a different means to activate poetry is no longer working. The block of code begins on line 683, and is as follows. (let* ((prog
(or
(cond ((eq system-type 'gnu/linux)
(concat "env -u VIRTUAL_ENV " (executable-find "poetry" t)))
((eq system-type 'berkeley-unix)
(executable-find "poetry" t)))
(poetry-error "Could not find 'poetry' executable")))
(args (if (or (string= command "run")
(string= command "config")
(string= command "env")
(string= command "init"))
(cl-concatenate 'list (list (symbol-name command))
args)
(cl-concatenate 'list (list
(symbol-name command)
"-n" "--ansi")
args))))
) I am not sure if an update kicked out previous errors or what. Let me know how I can assists. |
@anoduck What's your value of You can check in your Emacs with |
Fascinating stuff... (describe-variable 'system-type)
#("system-type is a variable defined in ‘C source code’.
Its value is ‘berkeley-unix’
The value is a symbol indicating the type of operating system you are using.
Special values:
‘gnu’ compiled for a GNU Hurd system.
‘gnu/linux’ compiled for a GNU/Linux system.
‘gnu/kfreebsd’ compiled for a GNU system with a FreeBSD kernel.
‘darwin’ compiled for Darwin (GNU-Darwin, macOS, ...).
‘ms-dos’ compiled as an MS-DOS application.
‘windows-nt’ compiled as a native W32 application.
‘cygwin’ compiled using the Cygwin library.
‘haiku’ compiled for a Haiku system.
Anything else (in Emacs 26, the possibilities are: aix, berkeley-unix,
hpux, usg-unix-v) indicates some sort of Unix system.
Probably introduced at or before Emacs version 19.31.
" 38 51 (help-args (system-type C-source) category help-variable-def-button button (t)) 786 791 (button (t) category help-news-button help-args ("/usr/local/share/emacs/29.1/etc/NEWS.19" 22544))) Emacs is beautiful, isn't it? |
It would be nice if you could define the poetry executable for this package, and/or how it is called. The full output of the error is:
This error arose from OpenBSD not using the gnu implementation of
env
, in which for gnu the-u
flag is valid. Where as for the nongnu derivative ofenv
,-u
is not valid.Adding an alias to my shell and see if that clears up the issue.
The text was updated successfully, but these errors were encountered: