       (let ((content
              (condition-case err
                  (with-temp-buffer
-                   (funcall 'call-process "dasel" nil t nil "select" "-f" (python-pre-commit-config-path) "-w" "json")
+                   (funcall 'call-process "dasel" nil t nil "select" "-f" config-path "-w" "json")
                    (goto-char (point-min))
                    (json-parse-buffer :object-type 'alist :array-type 'list))
                (error (error-message-string err) nil))))

      (flatten-list
       (cl-loop for req in requirements
                collect (if (string-match
                             "\\(?:-\\(?:-\\(?:\\(?:constrai\\|requireme\\)nt\\)\\|[cr]\\)\\)[[:space:]]+\\(.+\\)"
                             req)
                            (let ((file-path (match-string 1 req)))
                              (python-resolve-requirements

;; https://pip.pypa.io/en/stable/cli/pip_install/#requirements-file-format
(defun python-parse-requirement-spec (req)
  (save-match-data
    (cond ((string-match (rx (or "http" "file" "git" "git+ssh") "://") req) ;; URL
           ;; https://datatracker.ietf.org/doc/html/rfc3987#section-2.2
           (rx-let ((ucschar (in "\uA000-\uD7FF"
                                 "\uF900-\uFDCF"
                                 "\uFDF0-\uFFEF"
                                 "\u10000-\u1FFFD"
                                 "\u20000-\u2FFFD"
                                 "\u30000-\u3FFFD"
                                 "\u40000-\u4FFFD"
                                 "\u50000-\u5FFFD"
                                 "\u60000-\u6FFFD"
                                 "\u70000-\u7FFFD"
                                 "\u80000-\u8FFFD"
                                 "\u90000-\u9FFFD"
                                 "\uA0000-\uAFFFD"
                                 "\uB0000-\uBFFFD"
                                 "\uC0000-\uCFFFD"
                                 "\uD0000-\uDFFFD"
                                 "\uE0000-\uEFFFD"))
                    (iprivate (in "\uE000-\uF8FF"
                                  "\uF0000-\uFFFFD"
                                  "\u100000-\u10FFFD"))
                    (pct-encoded (seq "%" (repeat 0 2 hex)))
                    (gen-delims (in "#/:?@[]"))
                    (sub-delims (in "!$&-,;="))
                    (reserved (or gen-delims sub-delims))
                    (unreserved (or alnum (in "-._~") ucschar))
                    (scheme (seq (+ alpha) (* (in alnum "+-."))))
                    (userinfo (* (or unreserved pct-encoded sub-delims ":")))
                    (ipvfuture (seq "v" (+ hex) "." (+ (or unreserved sub-delims ":"))))
                    (dec-octet (or digit
                                   (seq (in "1-9") digit)
                                   (seq "1" digit digit)
                                   (seq "2" (in "0-5") (in "0-5"))))
                    (ipv4address (seq dec-octet "." dec-octet "." dec-octet "." dec-octet))
                    (h16 (repeat 1 4 hex))
                    (ls32 (or (group  h16 ":" h16) ipv4address))
                    (ipv6address (or (seq (repeat 6 (seq  h16 ":")) ls32)
                                     (seq "::" (repeat 5 (seq h16 ":")) ls32)
                                     (seq (? h16) "::" (repeat 4 (seq h16 ":")) ls32)
                                     (seq (? (repeat 0 1 h16)) "::" (repeat 3 (seq h16 ":")) ls32)
                                     (seq (? (repeat 0 2 h16)) "::" (repeat 2 (seq h16 ":")) ls32)
                                     (seq (? (repeat 0 3 h16)) "::" h16 ":" ls32)
                                     (seq (? (repeat 0 4 h16)) "::" ls32)
                                     (seq (? (repeat 0 5 h16)) "::" h16)
                                     (seq (? (repeat 0 6 h16)) "::")))
                    (ip-literal (seq "[" (or ipv6address ipvfuture) "]"))
                    (reg-name (* (or unreserved pct-encoded sub-delims)))
                    (host (or ip-literal ipv4address reg-name))
                    (port (* digit))
                    (authority (seq (? userinfo "@") host (? ":" port)))
                    (pchar (or unreserved pct-encoded sub-delims ":" "@"))
                    (segment (* pchar))
                    (segment-nz (+ pchar))
                    (segment-nz-nc (+ (or unreserved pct-encoded sub-delims "@")))
                    (path-rootless (seq segment-nz (* "/" segment)))
                    (path-noscheme (seq segment-nz-nc (* "/" segment)))
                    (path-absolute (seq "/" (? path-rootless)))
                    (path-abempty (* "/" segment))
                    (path (or path-abempty path-absolute path-noscheme path-rootless))
                    (query (* (or pchar "/" "?" iprivate)))
                    (fragment query)
                    (url (seq scheme authority (? path) (? "?" query) (? "#" fragment))))

             (and (string-match (rx url) req) (match-string 0 req))))
          ;; Path
          ((string-match (rx line-start (in "." "/")) req)
           (when-let ((requirement-spec (car (split-string req (rx (or ";" "@" "--")))))
                      (requirement-spec (string-trim requirement-spec)))
             (when (not (string-empty-p requirement-spec))
               requirement-spec)))
          ;; TODO: fetch the package and read the setup.cfg or setup.py files to
          ;; extract dependencies
          ((string-match (rx (or "-e" "--editable") (+ space) (group (+ nonl)) eol) req)
           nil)
          ;; Options
          ((string-match (rx "--" (+ (in alnum "-" "_"))) req)
           nil)
          ;; Requirement specifiers
          (t (let* ((requirement-spec (split-string req (rx (or ";" "@" "--"))))
                    (package-version-spec (string-trim (car requirement-spec)))
                    (package
                     (car
                      (split-string
                       package-version-spec
                       (rx (or "==" "!=" "<=" ">=" "~=" "===" "<" ">"))))))
               (when package
                 (string-trim-right package (rx "[" (+ (in alnum "-" "_")) "]"))))))))

(defvar python-project-requirements-cache nil)
(defun python-project-requirements ()
