Sandro 🐧 | diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index 5d60226aeb9c..8e38fe089aa9 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -145,6 +145,54 @@
pname = "python3-minimal";
});
+ # Minimal versions of Python (built without optional dependencies)
+ python3Smol =
+ (callPackage ./cpython (
+ {
+ self = __splicedPackages.python3Smol;
+ inherit passthruFun;
+ pythonAttr = "python3Smol";
+ # strip down that python version as much as possible
+ openssl = null;
+ readline = null;
+ ncurses = null;
+ gdbm = null;
+ sqlite = null;
+ tzdata = null;
+ libuuid = null;
+ bzip2 = null;
+ libxcrypt = null;
+ xz = null;
+ stripConfig = true;
+ stripIdlelib = true;
+ stripTests = true;
+ stripTkinter = true;
+ rebuildBytecode = false;
+ stripBytecode = true;
+ includeSiteCustomize = false;
+ enableOptimizations = false;
+ enableLTO = false;
+ mimetypesSupport = false;
+ withExpat = false;
+ withMpdecimal = false;
+ /*
+ The actual 'allowedReferences' attribute is set inside the cpython derivation.
+ This is necessary in order to survive overrides of dependencies.
+ */
+ allowedReferenceNames = [
+ "bashNonInteractive"
+ "libffi"
+ "zlib"
+ ];
+ }
+ // sources.python313
+ )).overrideAttrs
+ (old: {
+ # TODO(@Artturin): Add this to the main cpython expr
+ strictDeps = true;
+ pname = "python3-smol";
+ });
+
pypy27 = callPackage ./pypy {
self = __splicedPackages.pypy27;
sourceVersion = {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c0e953a8d19e..14cb4c3e1ef1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6578,6 +6578,7 @@
python313
python314
python3Minimal
+ python3Smol
pypy27
pypy310
pypy311
| 16:25:48 |