[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/buffer-env 9ccfbd07c4 2/2: Note about pyproject.toml in
From: |
ELPA Syncer |
Subject: |
[elpa] externals/buffer-env 9ccfbd07c4 2/2: Note about pyproject.toml integration |
Date: |
Thu, 11 Aug 2022 08:57:25 -0400 (EDT) |
branch: externals/buffer-env
commit 9ccfbd07c4b2e2af38fe315ce7e3d905298d2fdd
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Note about pyproject.toml integration
---
README.org | 23 ++++++++++++++++-------
buffer-env.el | 2 +-
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/README.org b/README.org
index f0989b1ccb..068e8fa194 100644
--- a/README.org
+++ b/README.org
@@ -63,16 +63,23 @@ certain script names are treated specially. These are:
lists of =VARIABLE=value= pairs. They are still executed as shell
scripts (which dictates when and how quotes are to be used, for
instance), but no =export= statements are needed.
-- =guix.scm=: The development environment of the Guix package is
- loaded and exported to Emacs. Make sure you have entered =guix
- shell= at least once before to install the dependencies, otherwise
- you may block Emacs for a long time.
+- =guix.scm= and =manifest.scm=: The development environment of the
+ Guix package is loaded and exported to Emacs. Make sure you have
+ entered =guix shell= at least once before to install the
+ dependencies, otherwise you may block Emacs for a long time.
For instructions on how to extend this list, see the documentation of
the variable =buffer-env-commands=.
** Integration with other environment management mechanisms
+*** pyproject.toml
+
+If you are using a fully featured Python project manager such as
+[[https://python-poetry.org/][Poetry]], [[https://hatch.pypa.io/][Hatch]] or
[[https://pdm.fming.dev][PDM]], buffer-env can be configured to infer the
+project environment directly from the =pyproject.toml= file. See
[[https://github.com/astoff/buffer-env/issues/13][this
+note]] for instructions.
+
*** Python virtualenvs
In most cases, the easiest way to interface with Python virtualenvs is
to create an =.envrc= file with the following contents:
@@ -90,11 +97,13 @@ root of each project, you can say
#+begin_src emacs-lisp
(setq buffer-env-script-name ".venv/bin/activate")
+ ;; alternatively, try to find a .envrc file first
+ (setq buffer-env-script-name '(".envrc" ".venv/bin/activate"))
#+end_src
-or a variation thereof. Note that it is also possible to provide an
-absolute path for =buffer-env-script-name=, and it is possible to specify it
-as a buffer- or directory-local variable.
+Note that it is also possible to provide an absolute path for
+=buffer-env-script-name=, and it is possible to specify it as a
+buffer- or directory-local variable.
*** .env files
To load the environment defined by a =.env= file, you can select it
diff --git a/buffer-env.el b/buffer-env.el
index 422717331a..9f77a64e21 100644
--- a/buffer-env.el
+++ b/buffer-env.el
@@ -68,7 +68,7 @@
("guix.scm" . "guix shell -D -f \"$0\" -- env -0")
("*" . ">&2 . \"$0\" && env -0"))
"Alist of commands used to produce environment variables.
-For each entry, the car is glob pattern and the cdr is a shell
+For each entry, the car is a glob pattern and the cdr is a shell
command. The command specifies how to execute a script and
collect the environment variables it defines.