 ;; Linting
 (defun python-pre-commit-config-path ()
   (when-let ((dir (locate-dominating-file default-directory ".pre-commit-config.yaml")))
-    (concat dir ".pre-commit-config.yaml")))
+    (expand-file-name (concat dir ".pre-commit-config.yaml"))))
 
 (defvar python-pre-commit-config-cache nil)
 (defun python-pre-commit-config ()

    (if (equal (alist-get 'modification-time cache-value) modification-time)
        (alist-get 'content cache-value)
      (let ((content
             (with-temp-buffer
               (funcall 'call-process "dasel" nil t nil "select" "-f" (expand-file-name (python-pyproject-path)) "-w" "json")
               (goto-char (point-min))
               (json-parse-buffer :object-type 'alist :array-type 'list))))
        (assoc-delete-all pyproject-path python-pyproject-cache)
        (push `(,pyproject-path . ((modification-time . , modification-time)
                                   (content . ,content)))
              python-pyproject-cache)
        content))))

(defun python-use-pre-commit-p (requirements)

    (if (equal (alist-get 'modification-time cache-value) modification-time)
        (alist-get 'content cache-value)
      (let ((content
             (condition-case err
                 (with-temp-buffer
                   (funcall 'call-process "dasel" nil t nil "select" "-f" (python-pre-commit-config-path) "-w" "json")
                   (goto-char (point-min))
                   (json-parse-buffer :object-type 'alist :array-type 'list))
               (error (error-message-string err) nil))))
        (assoc-delete-all config-path python-pre-commit-config-cache)
        (when content
          (push `(,config-path . ((modification-time . ,modification-time)
                                  (content . ,content)))
                python-pre-commit-config-cache))
        content))))

(defun python-pyproject-path ()
  (when-let ((dir (locate-dominating-file default-directory "pyproject.toml")))
    (expand-file-name (concat dir "pyproject.toml"))))

(defun python-use-poetry-p ()
  (and (python-pyproject-path)
