All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Fix #104, do not mess up the loading of additional binary modules after
pymport
- Builtin Python updated to 3.10.13
- Node.js 20 support
- Builtin Python updated to 3.10.11
- Fix [#78], a single
Buffer
argument is interpreted askwargs
- The new minimum supported versions of Node.js are now v12.22.0, v14.17.0, v16.0.0
- Allow limiting the depth of the recursion of
toJS()
- Allow disabling of the generic Buffer protocol transformation to
toJS()
- Add
PyObject.prototype.map
method compatible withArray.prototype.map
- Proxified functions are now also
Proxy
objects, resolves #58 PyObject.item()
now returnsundefined
instead of throwing an exception when an element cannot be retrieved by[]
- Allow enabling of debug output via the environment (
PYMPORT_DEBUG_sys
vars) - Improved bootstrap and shutdown allowing to load and unload the addon in
worker_threads
, partially resolves #69
- Fix #66, race condition can result in an abort when using
pymport
withworker_threads
- Fix #40, patch
_sysconfigdata
after installation - Fix #70, random crash in a
worker_thread
- Fix #69,
pymport
leaks TLS memory when used in aworker_thread
- Fix #63, restore the executable bit of
pympip3
- Fix #40, revert and lock
setuptools
for the builtin interpreter to 65.1.1 due to setuptools#3589 - Fix #60, proxified objects are not GCed
- Fix #48, do not consider falsy properties as being undefined
- Fix #50, proxified
.toString()
is not identical toPyObject.toString()
- Builtin Python 3.10.9
- Multithreading safety
callAsync
method allowing asynchronous calling of Python functions- On Linux and macOS, the builtin Python interpreter includes static versions of OpenSSL and libffi, this ensures better compatibility at the price of disabling the OpenSSL extensions supporting dedicated crypto hardware - this restriction does not apply if
pymport
is rebuilt from source - Named ES6 exports
- Add
PyObject.with
implementing Pythonwith
- Return the Python exception object and its constructor in
PythonError.pythonValue
andPythonError.pythonType
- Fix #27, a function as a single argument is considered a kwargs object
- Fix #33,
PyObject.prototype.constr
has wrong TypeScript type
- Automatically proxified methods in
pymport/proxified
- Proxified objects also proxify the input arguments of passed JS callbacks
- (BREAKING) Conversion of arguments in JS callbacks of Python code is now automatic only if it can be correctly deduced from the context,
toJS()
must be called in all other cases - Implement Python type coercion
- Support Python sets
- Fix #25, type-ahead provokes a crash in Node.js 14.x REPL
- Fix #14,
toJS()
converts Pythonbool
to JSnumber
- Restore the JS function when converting a
pymport.js_function
back to JS - Fix #17,
PYTHONHOME
is ignored - In the version reporting, replace the
"undefined"
suffix with a""
when there is no version suffix
- Converting JS functions to Python callables
- Expiring of function objects
- Converting of
bytes
andbytearray
toBuffer
andBuffer
tobytearray
- Converting between
TypedArray
andarray
- Convert Python iterators and generators to JavaScript
Symbol.iterator
- Basic tracking of the memory held by Python objects referenced in JS by the V8 GC
proxify
ed object do not intercept and redirect calls toPyObject
methods if the Python object has a method with the same name - ie. callingitem()
on a non-proxified PyObject invokesPyObject.item()
but if the underlying Python object of a proxified object also has anitem()
function, callingitem()
on the proxified object will invoke the Python methodprofixy
always return the same reference if called with a previously seenPyObject
reference- Support
BigInt
PyObject.slice
accepts named arguments- Return the Python traceback in
pythonTrace
and add aPythonError
TypeScript type - Do not allow
PYTHONPATH
to overridePYTHONHOME
when using the builtin - Ignore the last argument of a Python function call if it is
undefined
- this allows to pass a last argument as a dictionary by callingfn(obj, undefined)
instead offn(obj)
which will transformobj
into named kw arguments - Support
PyObject.keys
andPyObject.values
onprofixy
ed objects - Support building against a prebuilt Python tree in a non-standard location
- (internals) New automatic reference counting
- Fix #6, proxified objects are wrongly caching values returned by getters
- Fix #8,
Infinity
is not recognized as a float by the automatic conversion - Fix #11,
npm install --build-from-source
fails
- Enable TypeScript strict mode
- Fix #1, always consume Python exceptions
- First release