doomemacs/modules/lang/python/autoload/uv.el
Henrik Lissner 51154d1d50
fix(python): define +python-uv-mode-set-auto-h
Derped hard by forgetting to stage this file. Don't code at 5am, kids.

Fix: #8619
Amend: b851bcd3a0
2025-12-31 08:08:27 -05:00

24 lines
844 B
EmacsLisp

;;; lang/python/autoload/uv.el -*- lexical-binding: t; -*-
;;;###if (modulep! +uv)
;;;###autoload
(defvar +python--uv-project nil)
;;;###autoload
(defvar +python--uv-version nil)
;;;###autoload
(defun +python-uv-mode-set-auto-h ()
"Set pyenv-mode version from buffer-local variable."
(when (derived-mode-p 'python-mode 'python-ts-mode)
(unless (local-variable-p '+python--uv-project)
(setq-local +python--uv-project
(uv-mode-full-path (uv-mode-root))))
(if (and +python--uv-project
(file-exists-p +python--uv-project))
(unless (eq +python--uv-project (getenv "VIRTUAL_ENV"))
(setq-local +python--uv-version (uv-mode-version))
(uv-mode-set))
(kill-local-variable '+python--uv-project)
(kill-local-variable '+python--uv-version)
(uv-mode-unset))))