File: README.rst

package info (click to toggle)
emacs-python-environment 0.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 168 kB
  • sloc: lisp: 297; makefile: 173; python: 37
file content (49 lines) | stat: -rw-r--r-- 1,694 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
======================================
 Python virtualenv API for Emacs Lisp
======================================

.. sidebar:: Links:

   * `Repository
     <https://github.com/tkf/emacs-python-environment>`_ (at GitHub)
   * `Issue tracker
     <https://github.com/tkf/emacs-python-environment/issues>`_ (at GitHub)
   * `Travis CI
     <https://travis-ci.org/tkf/emacs-python-environment>`_
   * `MELPA
     <http://melpa.org/#/python-environment>`_
   * `MELPA Stable
     <http://stable.melpa.org/#/python-environment>`_


Emacs integrates well with external tools written in languages other
than Emacs Lisp and thus use of these tools should be encouraged.
However, many people try to avoid using non-Emacs Lisp software tools
since it makes installation of their Emacs plugin hard.
python-environment.el solves this problem (only for the case the tool
is written in Python) by providing virtualenv API in Emacs Lisp so
that you can automate installation of tools written in Python.

Let's say you write Emacs plugin which uses Python script.  Then you
would want to setup Python modules for that script easily from Emacs.
This is how to do that using python-environment.el

.. code :: cl

   (require 'python-environment)

   (defun YOUR-PLUGIN-install-python-dependencies ()
     (interactive)
     (python-environment-run "pip" "install" "epc"))

In your plugin, if you want the path to command installed in the
virtualenv, do something like this

.. code :: cl

   (start-process NAME BUFFER
                  (python-environment-bin "COMMAND")
                  ...)

Path to access COMMAND may be different in \*nix and in Windows, but
python-environment.el finds the right path.