Displaying 20 results from an estimated 23 matches for "py_config".
Did you mean:
pg_config
2024 Jul 15
2
reticulate + virtual environments
...s (e.g., py_install("pandas",
"mmstat4.hu.data")) are not found. I believe this happens because
reticulate is using r-reticulate instead of mmstat4.hu.data. How can I
force reticulate to use my virtual environment?
Thanks Sigbert
> library("reticulate")
> py_config()
python: /home/sk/.virtualenvs/r-reticulate/bin/python
libpython:
/usr/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.so
pythonhome:
/home/sk/.virtualenvs/r-reticulate:/home/sk/.virtualenvs/r-reticulate
version: 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0]
nu...
2024 Jul 15
1
reticulate + virtual environments
...> "mmstat4.hu.data")) are not found. I believe this happens because
> reticulate is using r-reticulate instead of mmstat4.hu.data. How can I
> force reticulate to use my virtual environment?
>
> Thanks Sigbert
>
> > library("reticulate")
>
> > py_config()
>
> python: /home/sk/.virtualenvs/r-reticulate/bin/python
>
> libpython:
> /usr/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.so
>
> pythonhome:
> /home/sk/.virtualenvs/r-reticulate:/home/sk/.virtualenvs/r-reticulate
>
> version: 3.10.12 (m...
2018 Apr 06
6
[nbdkit PATCH 0/2] Python cleanups
I noticed these while working on adding fua support into python,
these are independent enough to push now (and I'll have to rebase
my 'optional may_trim' patch on top of this).
Eric Blake (2):
python: Use Py_XDEFREF()
python: Simplify calling into plugin
plugins/python/python.c | 106 ++++++++----------------------------------------
1 file changed, 18 insertions(+), 88
2018 Apr 06
0
[nbdkit PATCH 2/2] python: Simplify calling into plugin
...ful, but awkward - we have to wrap
all arguments into a temporary tuple before using it.
Let python do more of the work by using PyObject_CallFunction
anywhere that all arguments can be described by a Py_BuildValue()
format string, instead of creating one-shot arguments ourselves.
In fact, for our py_config(), this makes it easier to not worry
about python 2 String vs. python 3 Unicode.
Similarly, PyObject_CallFunctionObjArgs is nicer when we
already have PyObjects for all parameters (including in py_open(),
where we can't use a Py_BuildValue() string for converting a
C int into Py_True or Py_Fal...
2020 Sep 01
0
[nbdkit PATCH 1/2] python: Implement .list_exports and friends
...ython",
+ .version = PACKAGE_VERSION,
- .load = py_load,
- .unload = py_unload,
- .dump_plugin = py_dump_plugin,
+ .load = py_load,
+ .unload = py_unload,
+ .dump_plugin = py_dump_plugin,
- .config = py_config,
- .config_complete = py_config_complete,
- .config_help = py_config_help,
+ .config = py_config,
+ .config_complete = py_config_complete,
+ .config_help = py_config_help,
- .thread_model = py_thread_model,
- .get_ready = py_get_ready,
+ .thread_m...
2019 Nov 23
0
[PATCH nbdkit v3 2/7] python: Implement nbdkit API version 2.
...own version: %ld. "
+ "This plugin supports API versions between 1 and %d.",
+ script, value, NBDKIT_API_VERSION);
+ return -1;
+ }
+
+ nbdkit_debug ("module requested API_VERSION %ld", value);
+ return (int) value;
+}
+
static int
py_config (const char *key, const char *value)
{
@@ -359,6 +391,11 @@ py_config (const char *key, const char *value)
"nbdkit requires these callbacks.", script);
return -1;
}
+
+ /* Get the API version. */
+ py_api_version = get_py_api_version ();
+ if (py...
2020 Aug 05
5
[PATCH nbdkit 3/4] python: Allow thread model to be set from Python plugins.
This is working for me now, although possibly only on Python 3.9.
Dan suggested PyEval_InitThreads but that was deprecated in
Python 3.7.
Rich.
2019 Sep 11
0
[PATCH nbdkit] python: Drop support for Python 2.
...printf ("python_version=%s\n", PY_VERSION);
-#endif
-
-#ifdef PYTHON_ABI_VERSION
printf ("python_pep_384_abi_version=%d\n", PYTHON_ABI_VERSION);
-#endif
if (script && callback_defined ("dump_plugin", &fn)) {
PyErr_Clear ();
@@ -337,11 +312,7 @@ py_config (const char *key, const char *value)
/* Note that because closeit flag == 1, fp is now closed. */
/* The script should define a module called __main__. */
-#ifdef HAVE_PYSTRING_FROMSTRING
- modname = PyString_FromString ("__main__");
-#else
modname = PyUnicode_FromStri...
2016 Sep 26
2
Re: Memory corruption when testing nbdkit python plugin with nbd-tester-client?
...dkit -n -f /software/nbdkit/plugins/python/.libs/nbdkit-python-plugin.so script=/software/nbdkit/plugins/python/ssd-ftl-wearleveling.py disksize=52428800
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, py_config (key=0x7fffffffe2e0 "script", value=0x7fffffffe2e7 "/software/nbdkit/plugins/python/ssd-ftl-wearleveling.py") at python.c:107
107 {
(gdb) info shared
>From To Syms Read Shared Object Library
0x00007ffff7ddaae0 0x00007ffff7df5490 Yes...
2020 Sep 01
4
[nbdkit PATCH 0/2] More language bindings for .list_exports
This picks up python and ocaml. Some of our languages are lacking a
number of bindings (for example, lua and perl lack .extents, so I
didn't have anything to copy from), and I felt less comfortable with
golang and rust. But for python and ocaml, I was able to test a
working implementation.
Eric Blake (2):
python: Implement .list_exports and friends
ocaml: Implement .list_exports and
2019 Sep 11
3
[PATCH nbdkit] python: Drop support for Python 2.
This patch proposes to drop support for Python 2 in nbdkit.
Rather than abruptly drop it everywhere, my proposal is that we point
people to nbdkit 1.14 (the current stable version) if they want to
continue with Python 2 plugins, while gently reminding them of the
upcoming Python 2.7 end of life announcement.
Libnbd never supported Python 2. Libguestfs in theory supports
Python 2 but I dropped
2016 Sep 26
0
Re: Memory corruption when testing nbdkit python plugin with nbd-tester-client?
...e/nbdkit/plugins/python/.libs/nbdkit-python-plugin.so script=/software/nbdkit/plugins/python/ssd-ftl-wearleveling.py disksize=52428800
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>
> Breakpoint 1, py_config (key=0x7fffffffe2e0 "script", value=0x7fffffffe2e7 "/software/nbdkit/plugins/python/ssd-ftl-wearleveling.py") at python.c:107
> 107 {
> (gdb) info shared
> >From To Syms Read Shared Object Library
> 0x00007ffff7ddaae0 0x00007...
2016 Sep 26
2
Memory corruption when testing nbdkit python plugin with nbd-tester-client?
Hi,
has anyone ever run "make check" from nbd against nbdkit with a python
plugin? I usually get segfaults during such a run, and sometimes various
other errors happen before the segfault, suggesting that some memory
corruption is underway.
AFAICS a pure python plugin should not be able to cause memory corruption.
Examples of nbdkit logs for running "make check" or subsets of
2018 Apr 11
0
[nbdkit PATCH v2 4/5] python: Expose FUA support
...python.c
+++ b/plugins/python/python.c
@@ -64,6 +64,9 @@ static const char *script;
static PyObject *module;
static int last_error;
+static int pwrite_has_fua;
+static int zero_has_fua;
+static int trim_has_fua;
static PyObject *
set_error (PyObject *self, PyObject *args)
@@ -320,6 +323,32 @@ py_config (const char *key, const char *value)
nbdkit_error ("%s: one of the required callbacks 'open', 'get_size' or 'pread' is not defined by this Python script. nbdkit requires these callbacks.", script);
return -1;
}
+
+ /* One-time setup to learn...
2019 Nov 22
0
[PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...ZE_T_CLEAN 1
#include <Python.h>
+#define NBDKIT_API_VERSION 2
+
#include <nbdkit-plugin.h>
#include "cleanup.h"
@@ -60,6 +62,7 @@
*/
static const char *script;
static PyObject *module;
+static int py_api_version = 1;
static int last_error;
@@ -356,6 +359,26 @@ py_config (const char *key, const char *value)
"nbdkit requires these callbacks.", script);
return -1;
}
+
+ /* Get the API version. */
+ if (callback_defined ("api_version", &fn)) {
+ PyErr_Clear ();
+
+ r = PyObject_CallObject (fn, NU...
2019 Nov 25
7
[PATCH nbdkit v2 0/7] Implement nbdkit API v2 for Python plugins.
v3 was here:
https://www.redhat.com/archives/libguestfs/2019-November/msg00209.html
In v4:
- Rebase on top of current master. Includes various fixes and
updates required because of Nir's patches that went into master.
- Fix api_version() -> API_VERSION in patch 2 noted previously on the
mailing list.
Rich.
2019 Nov 23
8
[PATCH nbdkit v3 0/7] Implement nbdkit API v2 for Python plugins.
v2 was here:
https://www.redhat.com/archives/libguestfs/2019-November/msg00163.html
I pushed patch 1 (with spelling fix), patch 4 and patch 5 since those
were previously ACKed on the list.
Differences in v3:
- Add error checking to PyModule_AddIntConstant.
- Use API_VERSION constant instead of function.
- Add max API version supported to --dump-plugin output.
- Print API_VERSION selected by
2019 Nov 21
10
[PATCH nbdkit 0/8] Implement nbdkit API v2 for Python plugins.
And fill out most of the missing bits of the API.
Rich.
2019 Nov 25
6
[nbdkit PATCH 0/5] Counterproposal for python v2 interfaces
As mentioned in my reviews, I wonder if we should make our python
callbacks look a bit more Pythonic by having kwargs added for each
new flag that we want to expose. The idea was first floated here:
https://www.redhat.com/archives/libguestfs/2018-April/msg00108.html
Note that with my proposal, there is no need for a python script to
expose a global API_VERSION variable; new flags are added
2019 Aug 02
23
[nbdkit PATCH v2 00/17] fd leak safety
This is a major rewrite compared to my v1 series, where I've tried
a lot harder to ensure that we still accommodate building on Haiku
(although I have not actually yet fired up a Haiku VM to try it
for myself). I also managed to make the sh plugin fully parallel,
on capable platforms.
See also my question on patch 10 on whether I've picked the best
naming convention.
Eric Blake (17):