wyuenho / emacs-pet

Tracks down the correct Python tooling executables from your virtualenvs so you can glue the binaries to Emacs and delete code in init.el
GNU General Public License v3.0
105 stars 13 forks source link

Running pet-verify-setup outputs some warnings/messages in *Messages* #3

Closed twmr closed 2 years ago

twmr commented 2 years ago

Description

When I run pet-verify-setup in e.g. the pytest git repo, the following messages are output in my Messages buffer

mapc: Symbol’s value as variable is void: lsp-jedi-executable-command
In "../../../../.pylintrc":
Unrecognized option found: no-space-check [unrecognized-option]

I have a .pylintrc file in my homedir, which probably is not compatible with the pylint executable that was found by pet-find-executable.

jedi is probably not installed anywhere, that's why I gest the symbol's value as var is void message (not 100% sure).

Expected behavior

The symbol's value as var is void message is probably an issue with pet.el, which should be fixed.

Not sure if the path in In "../../../../.pylintrc": is determined by pet.el. If yes, it could be converted to an absolute path before it is output.

The warnings that are output in Messages should be output in the *pet* buffer instead similar to the way this is done in flycheck-verify-setup.

Desktop (please complete the following information):

System tools versions

Additional context

Output of M-x (pet-verify-setup)

exec-path:                              ("/home/thomas/.guix-profile/bin" "/home/thomas/.config/guix/current/bin" "/home/thomas/miniconda/bin" "/home/thomas/miniconda/condabin" "/home/thomas/.cargo/bin" "/snap/bin" "/home/thomas/.cargo/bin" "/home/thomas/.cask/bin" "/opt/emacs-dev/bin" "/home/thomas/bin" "/home/thomas/.fzf/bin" "/home/thomas/.local/bin" "/home/thomas/.bin" "/usr/local/bin" "/bin" "/sbin" "/usr/bin" "/usr/sbin" "/opt/emacs-dev/libexec/emacs/29.0.50/x86_64-pc-linux-gnu")
python-shell-interpreter:               "/home/thomas/miniconda/bin/python"
python-shell-virtualenv-root:           nil
flycheck-flake8rc:                      (".flake8" "setup.cfg" "tox.ini")
flycheck-python-flake8-executable:      "/bin/flake8"
flycheck-pylintrc:                      "/home/thomas/.pylintrc"
flycheck-python-pylint-executable:      "/home/thomas/miniconda/bin/pylint"
flycheck-python-mypy-executable:        nil
flycheck-python-mypy-config:            ("mypy.ini" ".mypy.ini" "pyproject.toml" "setup.cfg" "/home/thomas/.config/mypy/config")
flycheck-python-mypy-python-executable: "/home/thomas/miniconda/bin/python"
flycheck-python-pyright-executable:     nil
flycheck-python-pycompile-executable:   "/home/thomas/miniconda/bin/python"
lsp-jedi-executable-command:        

pet config

(use-package pet
  ;; https://github.com/wyuenho/emacs-pet
  ;; M-x pet-verify-setup 
  :quelpa (pet :fetcher github :repo "wyuenho/emacs-pet")
  ;; :hook (python-mode)
  :custom
  (pet-toml-to-json-program "tomljson")
  (pet-yaml-to-json-program "yq")
  :config
  (add-hook 'python-mode-hook
            (lambda ()
              (setq-local python-shell-interpreter (pet-executable-find "python")
                          python-shell-virtualenv-root (pet-virtualenv-root))

              (pet-flycheck-setup)
              (flycheck-mode 1)

              ;; (setq-local lsp-jedi-executable-command
              ;;             (pet-executable-find "jedi-language-server"))

              ;; (setq-local lsp-pyright-python-executable-cmd python-shell-interpreter
              ;;             lsp-pyright-venv-path python-shell-virtualenv-root)

              ;; (lsp)

              ;; (setq-local dap-python-executable python-shell-interpreter)

              (setq-local python-pytest-executable (pet-executable-find "pytest"))

              ;; (when-let ((black-executable (pet-executable-find "black")))
              ;;   (setq-local python-black-command black-executable)
              ;;   (python-black-on-save-mode 1))

              (when-let ((isort-executable (pet-executable-find "isort")))
                (setq-local python-isort-command isort-executable)
                (python-isort-on-save-mode 1)))))
wyuenho commented 2 years ago

I can't help you if I can't reproduce it and you've deleted all the things I've asked for in the issue template lol

lsp-jedi-executable-command is declared and defined buffer-locally if you just use pet-mode as a major mode hook to python-mode, even if jedi-language-server can't be found.

Not sure if the path in In "../../../../.pylintrc": is determined by pet.el. If yes, it could be converted to an absolute path before it is output.

That's pylint's error output. Nothing I can do here/

Which Emacs version are you running? What's your configuration? How is your project set up? Where are your virtualenv executables located? All vital information for any actionable bug report.

twmr commented 2 years ago

I can't help you if I can't reproduce it and you've deleted all the things I've asked for in the issue template lol

Sry about that. I thought that the info that I provided in the description of the issue is sufficent. I've just update the description. Let me now if anything is still missing.

lsp-jedi-executable-command is declared and defined buffer-locally if you just use pet-mode as a major mode hook to python-mode, even if jedi-language-server can't be found.

I don't use pet-mode but the advanced config mentioned in the readme (see description of the github issue).

That's pylint's error output. Nothing I can do here/

You are right. This error is visible even when pet is not configured. It is output by flycheck.

So the only remaining issue that I have is this one.

mapc: Symbol’s value as variable is void: lsp-jedi-executable-command
wyuenho commented 2 years ago

Did you try the latest version?

twmr commented 2 years ago

Now, I've just tested the latest version and the issue is gone now. Thx!