PythonBuildStandalone¶
Provides distributions from the Python Standalone Builds project.
All science platforms are supported for Python 3 minor versions >= 8.
Note
Windows ARM64 uses the x86-64 binaries since there are currently no Windows ARM64 releases from Python Standalone Builds. This means slow execution when the Windows Prism emulation system has to warm up its instruction caches.
For all platforms, a python
placeholder (#{<id>:python}
) is supported and will be
substituted with the selected distribution’s Python binary path.
On the Linux and macOS platforms a pip
placeholder (#{<id>:pip}
) is supported and will be
substituted with the selected distribution’s pip script path.
Danger
Mutating the
distribution with pip install
or pip uninstall
is almost always a bad idea. The Python
Standalone Builds distributions are unpacked in the shared scie file cache atomically, but any
mutations after the initial unpacking are not guarded; as such, you risk concurrency bugs not to
mention all the problems associated with mutating a shared Python distribution’s site-packages:
namely, you can silently break other users of the shared Python distribution. If you have a need
to use pip install
, you probably want to use the --prefix
or --target
options or else
instead create a venv using the venv module (-m venv
) and then mutate that private venv using
its pip
script.
Note that Python Standalone Builds distributions come with some quirks that you should probably familiarize yourself with to make sure your application runs correctly under them.
Warning
One known quirk revolves around the statically linked OpenSSL Python Standalone Builds
distributions ship with. These are compiled from official OpenSSL releases which can be a
problem when run on machines that have their own patched version of OpenSSL that reads custom
OpenSSL configuration data (e.g.: from /etc/ssl/openssl.cnf
). Normally, OpenSSL errors for
configuration options it does not understand, but, due to a quirk in the CPython ssl
module,
most Python applications will have OpenSSL configuration errors masked and continue to run with
partially applied OpenSSL config. This may have security implications for your application.
For more on this see: https://github.com/indygreg/python-build-standalone/issues/207#issuecomment-1936500903
version¶
type: String
The CPython version to select.
Can be either in <major>.<minor>
form; e.g.: ‘3.11’, or else fully specified as
<major>.<minor>.<patch>
; e.g.: ‘3.11.3’.
Caution
Python Standalone Builds does not provide all patch versions; so you should check their releases if you wish to pin down to the patch level.
release¶
type: String (Optional)
Python Standalone Builds release to use.
Currently releases are dates of the form YYYYMMDD
, e.g.: ‘20230507’.
See the GitHub releases page to discover available releases.
If left unspecified the latest release is used.
Note
The latest lookup is cached for 5 days. To force a fresh lookup you can remove
the cache at <USER CACHE DIR>/science/downloads
.
flavor¶
type: String
default: 'install_only'
The flavor of the Python Standalone Builds release to use.
Currently only accepts ‘install_only’ and ‘install_only_stripped’.