Releases: shakfu/py-js
Python 3.13.0 externals for Max/MSP
This 0.3.0 release includes py and pyjs externals for macOS based on the recently released Python 3.13.0 engine.
One positive outcome of this Python version change is that externals are measurably smaller than the prior release due to the removal of a number of deprecated modules.
As usual, many arm64 and x86_64 external build variants are provided in this release. All are fully codesigned and notarized, which makes them also usable in your own projects and standalones. Please refer to the project's README for an extended overview of the specific differences between these variants, but basically the '-ext' suffix in the name means a self-contained Max external, the '-pkg' suffix means a Max package where the externals in the 'externals' folder depend on the python library in the 'support' folder:
shared-ext: self-contained external, fully loaded, dynamically linked.shared-ext-tiny: self-contained external, size-minimized, dynamically linked.static-ext: self-contained external, fully loaded, statically linked.static-ext-tiny: self-contained external, size-minimized, statically linked.framework-ext: self-contained external, fully loaded, built as a framework (dynamically linked).framework-pkg: package-structure, Python.framework is in the support folder of the package with the py and pyjs externals linked to it.homebrew-ext: self-contained external, fully loaded, built as a framework, (dynamically linked) but smaller than framework-ext.homebrew-pkg: package-structure, Python.framework is in the support folder of the package with the py and pyjs externals linked to it (smaller than framework-pkg).
Variants which embed numpy have the -np suffix in their name:
In this case, the provided example of using numpy to read/write Max buffer~ objects will likely be useful:
py-js/patchers/tests/test_api/test_api_buffer_np.maxpatChangelog
Coming relatively soon after the prior 0.2.6 release, it only includes the following bug fixes, changes and enhancements:
-
Added support for Python 3.13.x
-
Added
make install-numpyfor automatically building and adding a shrunk version of numpy to the previously built external or package
Python 3.12.4 externals for Max/MSP
This 0.2.6 release provides the py and pyjs externals for macOS based on the recently released Python 3.12.4 engine and focuses on stability, bug fixes, and incremental usability enhancements across a number of categories.
As usual, many arm64 and x86_64 external build variants are provided in this release. All are fully codesigned and notarized, which makes them also usable in your own projects and standalones. Please refer to the project's README for an overview of the specific differences between these variants.
Also provided is a couple ofpy external variants which embed numpy. These have the -np suffix in their name:
py-js-shared-tiny-ext-darwin-arm64-3.12.4-np.dmgpy-js-shared-tiny-ext-darwin-x86_64-3.12.4-np.dmg
In this case, the provided example of using numpy to read/write Max buffer~ objects will likely be useful:
py-js/patchers/tests/test_api/test_api_buffer_np.maxpat.
Changelog
The release includes the followings bug fixes, changes and enhancements:
Bug Fixes
-
Fixed a bug which caused Max to crash if more than one
pyinstance was created. -
Fixed codesigning bug in
homebrew-extandhomebrew-pkg, both are now codesigned by default -
Fixed error caused by removal of
distutilsin 3.12 -
Fix for broken
xz-utilsdependency due to its main repo being taken offline due to a well-known security issue.xz-5.2.5, which is known to be safe, is now only downloaded from the cpython dependencies repo instead. -
Fixed broken
static-extbuild with improved setup config -
Fixed a bug where
python-staticwas not building its dependencies
UI Enhancements
-
Added
py_texteditbpatcher to handle python code in the patcher. -
Added
fold, which wrapsfunctools.reduce -
Added mechanism to remove
\\escape sequences to enable commas, double quotes and multi-argument functions to work correctly. -
Added
py_prelude.pywhich is converted topy_prelude.h, essentially another way of extending thepyexternal by embedding a python module which is loaded into allpyinstances. -
Added another simpler method of retrieving the
t_py *xobject pointer inapimodule viauintptr_tround-trip conversion. -
Add bpatcher for editing with external editor with filewatching and reloading on save
-
Added
patchers/py_external_editor.maxpatprototype of using external editor withfilewatcherandpy_load <path>message. -
pipeis now much more versatile and can handle multiple arguments and multiple functions. -
Changed
py_callto a more versatile pure python function which can handle keyword arguments. Nowcallmessage can be [call fn x1 x2 y1=z1 y2=z2]
Scripting / API Enhancements
-
Added patcher scripting methods to
api.Patcher -
Added generic
api.MaxObjectobject for improved scripting options. -
Added tests and tested methods for
api.Binbufobject. -
Added buffer protocol support to
api.Bufferwith numpy test -
Combined buffer tests (except numpy and array tests) into
test_buffer.pyandtest_buffer.maxpat -
Added additional message method support for
api.Buffer -
Added auto-resizing to
api.Buffer.set_samplesand methods to set duration, samplerate as well as methods for generic message sending to a buffer for examples "fill" operations. -
Added
api.Patcherobject to facilitate patcher-scripting from python. -
Added additional capabilities and tests to Buffer extension in the
apimodule. This includes retrieval by buffer name, buffer creation, setting / getting samples from python code using either python's builtin array module or numpy, and a set of demonstrative set of tests:pure python tests:
examples/tests/test_buffer.pyexamples/tests/test_buffer_np.pyexamples/tests/test_buffer_array.py
patcher tests:
patchers/tests/test_buffer_np.maxpatpatchers/tests/test_buffer_array.maxpatexamples/tests/test_buffer_resize.maxpat
Builder Enhancements
-
Added
make releasefor automatic packaging, codesigning, notarizing of pyjs externals. -
Improved
shared-ext,static-ext,shared-tiny-ext,static-tiny-extvariants for python 3.12 -
Added unstable proof-of-concept for building python via cmake. Next step will be to integrate this into the
buildersystem. This capability is provided courtesy of the python-cmake-buildsystem project, but the python tests fails so this is a work-in-progress -
Added
builder.factory.FactoryManagerto encapsulate dispatch functions. -
Made it easier to build specific python versions (3.7 - 3.12) by providing an optional environment parameter. If provided, the specific version will be downloaded from python.org and used as follows:
# build both python variant and external make shared-ext PYTHON_VERSION=3.7.17 # or to build python variant only make python-shared-ext PYTHON_VERSION=3.7.17 # and then use that to build the external make build-shared-ext PYTHON_VERSION=3.7.17
-
Added
patch/3.8/setup-static-min6.localto enable tiny variants in python 3.8 -
Added
shared-tiny-extMakefile target which is the shared lib counterpart tostatic-tiny-ext. -
Added
log-<variant>Makefile targets for timed and file logged builds -
Slight Reduction of
builder-based externals' size by removing deprecated modules includingdistutils.
Python 3.11.6+numpy externals for Max (pre-release)
This pre-release contains two pairs of codesigned and notarized Python 3.11.6 externals (py and pyjs) based on the minimal shared-tiny-ext variant.
Notably,
-
The first pair includes a tiny (9.1 MB) version of
pywhich contains a greatly enhanced builtinapimodule that wraps a decent subset of the Max c-api.The revised
apimodule now includes a bunch of cython extension classes which correspond to Max objects and data-structures:MaxObject,Atom,Table,Buffer,Dictionary,Database,Binbuf,Atombuf,Patcher, andPyExternal.The
Bufferclass in particular, thanks to feedback from @jamesb93 now enables array-based modules such as the builtinarraymodule andnumpyto efficiently read from and write tobuffer~objects.A group of pure python tests for the
apimodule are included in theexamples/testsfolder with related test patchers in thepatchers/testsfolder. -
The
numpyversion of thepyexternal contains everything in (1) but also includes a recent version ofnumpyas well (but without the BLAS and LAPACK linear algebra libraries), and is around 20.9 MB in size. -
In addition, the latest version of the
pyjsjavascript extension is included to enable a bridge between python3 and the javascript Max api inside the[js]object (but without theapimodule ornumpy) at around 8.1 MB in size.
Enjoy!
Python 3.11.2+ externals for Max
This release provides updated py and pyjs externals for macOS running Python 3.11.2 and also a handful of alternative builds with Python 3.8.x, Python 3.7.15 and Python 3.11.4 to demonstrate size variation across versions and build variants.
-
The externals come in a number of build variants (for both x86_64 and arm64 architectures) and are all signed and notarized (i.e can be used in Max Packages and Standalones).
-
A new addition to the build variants is the
static-tiny-extexternal which is designed to be as small and as functional as possible. -
All externals include an updated
apibuiltin module based on a cython wrapper of a subset of the max api. -
All (x86_64 macOS Intel) externals are now compiled, packaged, signed and notarized using a GitHub workflow which should make it easier for future releases. Hopefully in the future it will be possible to also produce (arm64 Apple Silicon) versions using the same process.
-
An improved release infrastructure was developed to make it easier to sign, package, notarize and staple external distributions using the Makefile frontend. This was used to release the arm64 externals below.
-
A new variant, and a late addition to the release:
shared-tiny-extis the shared lib sibling ofstatic-tiny-ext.