Skip to content

Commit

Permalink
feat: lookup python3 instead of python
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoarine authored Jun 29, 2023
2 parents b0eda92 + 1496797 commit 5e8c382
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ Add the following to your =init.el=:

#+begin_src elisp
(straight-use-package '(org-similarity :type git :host github :repo
"brunoarine/org-similarity" :branch "main" :files ("*.el" "*.txt"
"orgsimilarity")))
"brunoarine/org-similarity" :branch "main"))
#+end_src

*Doom Emacs*
Expand All @@ -52,7 +51,7 @@ Add the following to =packages.el=:

#+begin_src elisp
(package! org-similarity :recipe (:host github :repo "brunoarine/org-similarity"
:branch "main" :files ("*.el" "*.txt" "orgsimilarity")))
:branch "main"))
#+end_src

*Manual installation*
Expand Down
10 changes: 5 additions & 5 deletions org-similarity.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Bruno Arine <[email protected]>
;; URL: https://github.com/brunoarine/org-similarity

;; Version: 2.0.0
;; Version: 2.1.0
;; Package-Requires: ((emacs "26.1"))
;; Keywords: matching, outlines, wp, org

Expand Down Expand Up @@ -44,7 +44,7 @@
:link '(url-link :tag "GitHub" "https://github.com/brunoarine/org-similarity")
:link '(emacs-commentary-link :tag "Commentary" "org-similarity"))

(defconst org-similarity-version "2.0.0"
(defconst org-similarity-version "2.1.0"
"The current version of ORG-SIMILARITY.")

(defcustom org-similarity-language
Expand Down Expand Up @@ -135,7 +135,7 @@ If nul, org-similarity will use a venv inside `emacs-local-directory'."
(defun org-similarity--get-python-interpreter ()
"Return the path to the most appropriate Python interpreter."
(or org-similarity-custom-python-interpreter
(concat org-similarity--package-path "venv/bin/python")))
(concat org-similarity--package-path "venv/bin/python3")))

(defvar org-similarity--deps-install-buffer-name
" *Install org-similarity Python dependencies* "
Expand All @@ -147,7 +147,7 @@ If nul, org-similarity will use a venv inside `emacs-local-directory'."

(defun org-similarity--system-python-available-p ()
"Return t if Python is available in the system."
(unless (executable-find "python")
(unless (executable-find "python3")
(error "Org-similarity needs Python to run. Please, install Python"))
t)

Expand All @@ -163,7 +163,7 @@ If nul, org-similarity will use a venv inside `emacs-local-directory'."
(defun org-similarity-create-local-venv ()
"Create environment and install Python dependencies."
(when (org-similarity--system-python-available-p)
(let* ((install-commands (concat (executable-find "python") " -m venv " org-similarity--package-path "venv"))
(let* ((install-commands (concat (executable-find "python3") " -m venv " org-similarity--package-path "venv"))
(buffer (get-buffer-create org-similarity--deps-install-buffer-name)))
(pop-to-buffer buffer)
(compilation-mode)
Expand Down

0 comments on commit 5e8c382

Please sign in to comment.