285.5. spyder-6.1.7
The scientific Python IDE: editor, IPython console, variable explorer and plots
The build-state snapshot was taken from 6.1.7-2; this recipe is 6.1.7-3, so the size, time and contents below describe the earlier build.
| Version | 6.1.7, release 3 |
| Shelf | editors — Text editors, IDEs, notebooks and REPLs |
| Phase | 44_apps (Applications), 80 of 422 in build order |
| Licence | MIT |
| Homepage | https://www.spyder-ide.org/ |
| Build time | 4.6 SBU |
| Installed size | 80.3 MiB in 4492 files |
| Recipe | ports/core/editors/spyder/kpkgbuild |
About
Spyder is the scientific Python IDE: an editor with code analysis through python3-lsp-server, an IPython console, a variable explorer, a plots pane and a help pane that renders docstrings with python3-sphinx. It is a PyQt6 program, built from one vendor bundle holding the Python packages that only Spyder uses.
Sources
spyder-6.1.7.tar.gz(12.9 MiB)
sha256c7a4f7278198dac44fe0cb680d7b8b124014d49c87c0b760421744d7f0329d32
upstream: https://files.pythonhosted.org/packages/source/s/spyder/spyder-6.1.7.tar.gz
archive copy: sources-2/editors--spyder-6.1.7.tar.gzspyder-vendor-6.1.7.tar.xz(26.9 MiB)
sha256935da37e6e1cfeef2874743af81127989f4e33db0d51897099dfd7d394c87bac
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-2/editors--spyder-vendor-6.1.7.tar.xzpbr-7.1.3.tar.gz(136.8 KiB)
sha2569a4a85b84e906337708009af0b5f5cdabeeb72d4dc213c9e97974da54fd9acc5
upstream: https://files.pythonhosted.org/packages/source/p/pbr/pbr-7.1.3.tar.gz
archive copy: sources-2/editors--pbr-7.1.3.tar.gz
Dependencies
Depends on: python3, python3-pip, python3-setuptools, python3-setuptools-scm, python3-wheel, python3-hatchling, python3-hatch-vcs, python3-poetry-core, python3-flit-core, python3-calver, python3-trove-classifiers, python3-pkgconfig, python3-cffi, python3-pycparser, python3-jinja2, python3-markupsafe, python3-tomlkit, python3-pyqt6, python3-pyqt6-webengine, qt6-qtwayland, python3-qtpy, ipython, python3-ipykernel, python3-jupyter-client, python3-jupyter-core, python3-nbconvert, python3-lsp-server, python3-lsp-ruff, ruff, python3-debugpy, python3-keyring, python3-cloudpickle, python3-jellyfish, python3-bcrypt, python3-cryptography, python3-pyzmq, python3-tornado, python3-psutil, python3-pygments, python3-packaging, python3-pyxdg, python3-requests, python3-yaml, python3-rich, python3-markdown-it-py, python3-docutils, python3-sphinx, python3-dateutil, python3-attrs, python3-idna, python3-typing-extensions, python3-urllib3, libsodium, libspatialindex, librsvg.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
no-update-check.patch— Changes the default ofcheck_updates_on_startupinspyder/config/main.pyfromTruetoFalse. The update manager asks GitHub and PyPI at every start, and there is no build switch for it. The check stays available in Preferences and the Help menu.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install spyder'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/editors/spyder.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/editors/spyder
echo 'c7a4f7278198dac44fe0cb680d7b8b124014d49c87c0b760421744d7f0329d32 spyder-6.1.7.tar.gz' | sha256sum -c -
echo '935da37e6e1cfeef2874743af81127989f4e33db0d51897099dfd7d394c87bac spyder-vendor-6.1.7.tar.xz' | sha256sum -c -
echo '9a4a85b84e906337708009af0b5f5cdabeeb72d4dc213c9e97974da54fd9acc5 pbr-7.1.3.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/spyder
SRC=$SRC_ROOT/spyder-6.1.7
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf spyder-6.1.7.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf pbr-7.1.3.tar.gz -C "$SRC_ROOT"
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _pbr, pyrequirements, pyruntime and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/no-update-check.patch"
mkdir -p vendor
tar -xf $PORT_SRC/$name-vendor-$version.tar.xz --strip-components=1 -C vendor
_back="$SRC_ROOT/backends"
pip3 install --no-deps --no-index --find-links=vendor --no-build-isolation \
--target "$_back" expandvars coherent-licensed dunamai uv-dynamic-versioning \
"$SRC_ROOT/pbr-$_pbr"
export PYTHONPATH="$_back${PYTHONPATH:+:$PYTHONPATH}"
pip3 install --ignore-installed --no-deps --no-index --find-links=vendor --no-build-isolation \
--root=$PKG --prefix=/usr spyder-kernels wurlitzer pyls-spyder
_home=/usr/lib/spyder
export SPYDER_QT_BINDING=pyqt6
export SODIUM_INSTALL=system
pip3 install --no-deps --no-index --find-links=vendor --no-build-isolation \
--ignore-installed --root=$PKG --prefix=$_home \
aiohappyeyeballs aiohttp aiosignal frozenlist multidict propcache yarl \
arrow asyncssh binaryornot chardet cookiecutter diff-match-patch \
importlib-metadata inflection intervaltree numpydoc pickleshare pygithub \
pyjwt pylint-venv pynacl python-slugify pyuca qdarkstyle qstylizer \
qtawesome qtconsole rtree sortedcontainers superqt text-unidecode \
textdistance three-merge watchdog zipp .
_site=$(python3 -c 'import sys, sysconfig; print(sysconfig.get_path("purelib", vars={"base": sys.argv[1]}))' "$PKG$_home")
test -x "$PKG$_home/bin/spyder"
test -d "$_site/spyder"
find "$_site/spyder/locale" -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} +
rm -rf "$PKG$_home/share"
ln -s /usr/bin/python3 "$PKG$_home/bin/python"
printf 'home = /usr/bin\ninclude-system-site-packages = true\n' > "$PKG$_home/pyvenv.cfg"
python3 -c 'import sys, sysconfig; print(sysconfig.get_path("purelib", vars={"base": sys.argv[1]}))' \
/usr/lib/python3-sphinx > "$_site/python3-sphinx.pth"
install -d "$PKG/usr/bin"
cat > "$PKG/usr/bin/spyder" <<'KDOS_SH'
#!/bin/sh
QT_API=pyqt6
SPATIALINDEX_C_LIBRARY=/usr/lib/libspatialindex_c.so
export QT_API SPATIALINDEX_C_LIBRARY
exec /usr/lib/spyder/bin/python /usr/lib/spyder/bin/spyder "$@"
KDOS_SH
chmod 755 "$PKG/usr/bin/spyder"
for s in 48 64 128 256; do
install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
rsvg-convert -w $s -h $s spyder/images/spyder.svg \
-o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/spyder.png"
done
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/spyder.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Spyder
GenericName=Scientific Python IDE
Comment=Edit, run, debug and explore data in Python
TryExec=spyder
Exec=spyder %F
Icon=spyder
Terminal=false
StartupNotify=true
StartupWMClass=spyder
Categories=Development;Science;IDE;Qt;
Keywords=python;ide;science;data;ipython;variable;explorer;spyder;
DESKTOP
chmod 644 "$PKG/usr/share/applications/spyder.desktop"
The switches, and why each is set:
SPYDER_QT_BINDING=pyqt6— Makesetup.pydeclare PyQt6 and its WebEngine binding as Spyder’s Qt requirements, the ones python3-pyqt6 and python3-pyqt6-webengine provide. Unset, it declares PyQt5 and PyQtWebEngine 5.15, which are not independs. pip installs--no-deps, so the variable decides only the requirements written into the installed package’s metadata.SODIUM_INSTALL=system— Build PyNaCl against the libsodium port instead of the copy of libsodium in its source.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/spyder, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf spyder-6.1.7-3.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/spyder, and runs the triggers its paths call for.
Contents
Installed programs: spyder.
Installed directories: /usr/lib/python3.14/site-packages/pyls_spyder, /usr/lib/python3.14/site-packages/pyls_spyder-0.4.0.dist-info, /usr/lib/python3.14/site-packages/spyder_kernels, /usr/lib/python3.14/site-packages/spyder_kernels-3.1.6.dist-info, /usr/lib/python3.14/site-packages/wurlitzer-3.1.1.dist-info, /usr/lib/spyder, /usr/share/licenses/spyder.
Notes
The bundle comes from vendoring = python with an explicit pypackages list (see The three Python keys). The build backends that are not ports go into $SRC_ROOT/backends, on PYTHONPATH for this build only: expandvars, coherent-licensed, dunamai and uv-dynamic-versioning from the bundle, and pbr, the recipe’s second source. qstylizer’s setup.py is pbr’s (setup_requires=['pbr']); without pbr, setuptools ignores its setup.cfg and reports version 0.0.0, which pip refuses.
The installed files go to two places:
spyder-kernels,wurlitzerandpyls-spydergo into the systemsite-packages. Spyder removesPYTHONPATHfrom the environment of every kernel and language server it starts, so what those processes import must be importable by plainpython3. Spyder is their only user.- Everything else goes under
/usr/lib/spyder. Several of these modules are also in other ports’ bundles (aiohttpin vdirsyncer’s,arrowin jupyterlab’s), and two packages owning one path insite-packagesis a conflictkpkgaddrefuses.
/usr/lib/spyder is made a virtual environment over the system Python: a pyvenv.cfg that includes the system site-packages, and bin/python linked to python3. Its own site-packages is then a site directory of the interpreter rather than a PYTHONPATH entry, which Spyder would remove from sys.path as it starts. sys.executable is bin/python, so a restart and the kernels Spyder starts see the same paths. Sphinx’s private directory, /usr/lib/python3-sphinx, joins through a .pth file in that site-packages. /usr/bin/spyder is a wrapper that sets QT_API=pyqt6 and points SPATIALINDEX_C_LIBRARY at libspatialindex for the Rtree binding, then runs the program with that interpreter.
The translation directories under spyder/locale are removed, but the locale directory itself stays, because Spyder lists it to offer languages.
setup.py’s data files (a menu entry, a PNG icon and AppStream metadata) are installed under the /usr/lib/spyder prefix, in share, where no desktop search path reaches; build.sh removes that directory and writes its own spyder.desktop and PNG icons rasterised from spyder/images/spyder.svg under /usr/share.
runtime = python3-sphinx: Spyder’s configuration imports its Help pane’s renderer, spyder/plugins/help/utils/sphinxify.py, which imports sphinx, on every start. Sphinx lives in its own prefix and reaches Spyder through the .pth file build.sh writes, so the run-time needs record holds no edge to it, and python3-sphinx is a build-only port: without the word a prebuilt install would leave it out and spyder would stop at start with No module named 'sphinx'.