|
20 | 20 |
|
21 | 21 |
|
22 | 22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
23 | | -;; Travis |
| 23 | +;; CI |
24 | 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
25 | | -;; Travis is using virtualenvs to test specific version of python |
26 | | -;; we need to use it as the system environment |
27 | | -(advice-add 'elpy-rpc-get-virtualenv-path |
28 | | - :around (lambda (fun &rest args) |
29 | | - (if (and (getenv "TRAVIS") |
30 | | - (or (eq elpy-rpc-virtualenv-path 'global) ;; for backward compatibility |
31 | | - (eq elpy-rpc-virtualenv-path 'system))) |
32 | | - (expand-file-name |
33 | | - (concat |
34 | | - "~/virtualenv/" |
35 | | - "python" |
36 | | - (getenv "TRAVIS_PYTHON_VERSION"))) |
37 | | - (apply fun args)))) |
38 | | - |
39 | | -;; Travis regularly has some lag for some reason. |
40 | | -(setq elpy-rpc-timeout 10) |
41 | | -;; Print elpy configuration |
42 | | -(when (getenv "TRAVIS") |
| 25 | +(when (getenv "GITHUB_RUN_ID") |
| 26 | + ;; Make sure we use the proper python version to create the virtualenv |
| 27 | + ;; This is necessary as multiple python binaries will be present on |
| 28 | + ;; the virtual machine |
| 29 | + (advice-add 'elpy-rpc--create-virtualenv |
| 30 | + :around (lambda (orig-fun &rest args) |
| 31 | + (let ((elpy-rpc-python-command (executable-find "python"))) |
| 32 | + (apply orig-fun args)))) |
| 33 | + ;; CI regularly has some lag for some reason. |
| 34 | + (setq elpy-rpc-timeout 10) |
| 35 | + ;; Print elpy configuration |
43 | 36 | (elpy-config) |
44 | 37 | (with-current-buffer "*Elpy Config*" |
45 | 38 | (message (buffer-substring-no-properties (point-min) (point-max))))) |
|
61 | 54 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
62 | 55 | ;; Test helper |
63 | 56 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 57 | +(defun elpy-get-python-version () |
| 58 | + (with-temp-buffer |
| 59 | + (call-process elpy-rpc-python-command |
| 60 | + nil '(t t) nil "--version") |
| 61 | + (goto-char (point-min)) |
| 62 | + (re-search-forward "\\([0-9.]+\\)" nil t) |
| 63 | + (or (match-string 1) ""))) |
| 64 | + |
64 | 65 | (defmacro mletf* (bindings &rest body) |
65 | 66 | "Liket `cl-letf*', just with a slightly more concise function syntax. |
66 | 67 |
|
|
0 commit comments