python2: remove from top level, isolate to resholve (#516241)

This commit is contained in:
Doron Behar
2026-05-31 13:26:34 +00:00
committed by GitHub
126 changed files with 345 additions and 669 deletions
+5 -17
View File
@@ -48,7 +48,6 @@ Based on the packages defined in `pkgs/top-level/python-packages.nix` an
attribute set is created for each available Python interpreter. The available
sets are
* `pkgs.python27Packages`
* `pkgs.python3Packages`
* `pkgs.python311Packages`
* `pkgs.python312Packages`
@@ -60,9 +59,7 @@ sets are
and the aliases
* `pkgs.python2Packages` pointing to `pkgs.python27Packages`
* `pkgs.python3Packages` pointing to `pkgs.python313Packages`
* `pkgs.pythonPackages` pointing to `pkgs.python2Packages`
* `pkgs.pypy2Packages` pointing to `pkgs.pypy27Packages`
* `pkgs.pypy3Packages` pointing to `pkgs.pypy310Packages`
* `pkgs.pypyPackages` pointing to `pkgs.pypy2Packages`
@@ -573,9 +570,6 @@ In contrast to [`python.buildEnv`](#python.buildenv-function), [`python.withPack
more advanced options such as `ignoreCollisions = true` or `postBuild`. If you
need them, you have to use [`python.buildEnv`](#python.buildenv-function).
Python 2 namespace packages may provide `__init__.py` that collide. In that case
[`python.buildEnv`](#python.buildenv-function) should be used with `ignoreCollisions = true`.
#### Setup hooks {#setup-hooks}
The following are setup hooks specifically for Python packages. Most of these
@@ -627,10 +621,9 @@ buildPythonPackage.override { stdenv = customStdenv; } {
Several versions of the Python interpreter are available on Nix, as well as a
high amount of packages. The attribute `python3` refers to the default
interpreter, which is currently CPython 3.13. The attribute `python` refers to
CPython 2.7 for backwards compatibility. It is also possible to refer to
specific versions, e.g., `python313` refers to CPython 3.13, and `pypy` refers to
the default PyPy interpreter.
interpreter, which is currently CPython 3.13. It is also possible to refer to
specific versions, e.g., `python313` refers to CPython 3.13, and `pypy` refers
to the default PyPy interpreter.
Python is used a lot, and in different ways. This affects also how it is
packaged. In the case of Python on Nix, an important distinction is made between
@@ -1910,9 +1903,8 @@ pkgs.mkShell rec {
}
```
In case the supplied venvShellHook is insufficient, or when Python 2 support is
needed, you can define your own shell hook and adapt to your needs like in the
following example:
In case the supplied venvShellHook is insufficient, you can define your own
shell hook and adapt to your needs like in the following example:
```nix
with import <nixpkgs> { };
@@ -1925,8 +1917,6 @@ pkgs.mkShell rec {
name = "impurePythonEnv";
buildInputs = [
pythonPackages.python
# Needed when using python 2.7
# pythonPackages.virtualenv
# ...
];
@@ -1939,8 +1929,6 @@ pkgs.mkShell rec {
echo "Skipping venv creation, '${venvDir}' already exists"
else
echo "Creating new venv environment in path: '${venvDir}'"
# Note that the module venv was only introduced in python 3, so for 2.7
# this needs to be replaced with a call to virtualenv
${pythonPackages.python.interpreter} -m venv "${venvDir}"
fi
@@ -18,6 +18,8 @@
- `boot.vesa` has been removed. It was deprecated in 2020 because Xorg now works better with kernel modesetting. If you still need the legacy VESA 800x600 fallback, set `boot.kernelParams = [ "vga=0x317" "nomodeset" ];` directly.
- Python 2 has been removed from the top-level package set, as it is long past end-of-life. The `python2`, `python27`, `python2Full`, `python27Full`, `python2Packages`, and `python27Packages` attributes, along with the legacy `python`, `pythonFull`, and `pythonPackages` aliases, now throw an error directing you to `python3`. The `isPy2` and `isPy27` package flags have been removed accordingly. The only remaining Python 2 interpreter is vendored inside the `resholve` package for its `oil` dependency and is not exposed for general use.
## Other Notable Changes {#sec-release-26.11-notable-changes}
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
-2
View File
@@ -9,8 +9,6 @@ python3Packages.buildPythonApplication (finalAttrs: {
version = "0.4.4";
pyproject = true;
disabled = python3Packages.isPy27;
src = fetchFromGitHub {
owner = "siriobalmelli";
repo = "replacement";
@@ -1,24 +0,0 @@
# This file was generated and will be overwritten by ./generate.sh
{
stdenv,
lib,
fetchurl,
}:
stdenv.mkDerivation {
pname = "python27-docs-html";
version = "2.7.18";
src = fetchurl {
url = "https://www.python.org/ftp/python/doc/2.7.18/python-2.7.18-docs-html.tar.bz2";
sha256 = "03igxwpqc2lvzspnj78zz1prnmfwwj00jbvh1wsxvb0wayd5wi10";
};
installPhase = ''
mkdir -p $out/share/doc/python27
cp -R ./ $out/share/doc/python27/html
'';
meta = {
maintainers = [ ];
};
}
@@ -1,24 +0,0 @@
# This file was generated and will be overwritten by ./generate.sh
{
stdenv,
lib,
fetchurl,
}:
stdenv.mkDerivation {
pname = "python27-docs-pdf-a4";
version = "2.7.18";
src = fetchurl {
url = "https://www.python.org/ftp/python/doc/2.7.18/python-2.7.18-docs-pdf-a4.tar.bz2";
sha256 = "0rxb2fpxwivjpk5wi2pl1fqibr4khf9s0yq6a49k9b4awi9nkb6v";
};
installPhase = ''
mkdir -p $out/share/doc/python27
cp -R ./ $out/share/doc/python27/pdf-a4
'';
meta = {
maintainers = [ ];
};
}
@@ -1,24 +0,0 @@
# This file was generated and will be overwritten by ./generate.sh
{
stdenv,
lib,
fetchurl,
}:
stdenv.mkDerivation {
pname = "python27-docs-pdf-letter";
version = "2.7.18";
src = fetchurl {
url = "https://www.python.org/ftp/python/doc/2.7.18/python-2.7.18-docs-pdf-letter.tar.bz2";
sha256 = "07hbqvrdlq01cb95r1574bxqqhiqbkj4f92wzlq4d6dq1l272nan";
};
installPhase = ''
mkdir -p $out/share/doc/python27
cp -R ./ $out/share/doc/python27/pdf-letter
'';
meta = {
maintainers = [ ];
};
}
@@ -1,24 +0,0 @@
# This file was generated and will be overwritten by ./generate.sh
{
stdenv,
lib,
fetchurl,
}:
stdenv.mkDerivation {
pname = "python27-docs-text";
version = "2.7.18";
src = fetchurl {
url = "https://www.python.org/ftp/python/doc/2.7.18/python-2.7.18-docs-text.tar.bz2";
sha256 = "1wj7mxs52kp5lmn5mvv574sygkfnk00kbz9ya9c03yfq5dd5nvy8";
};
installPhase = ''
mkdir -p $out/share/doc/python27
cp -R ./ $out/share/doc/python27/text
'';
meta = {
maintainers = [ ];
};
}
@@ -8,36 +8,24 @@ let
pythonDocs = {
html = {
recurseForDerivations = true;
python27 = import ./2.7-html.nix {
inherit stdenv fetchurl lib;
};
python310 = import ./3.10-html.nix {
inherit stdenv fetchurl lib;
};
};
pdf_a4 = {
recurseForDerivations = true;
python27 = import ./2.7-pdf-a4.nix {
inherit stdenv fetchurl lib;
};
python310 = import ./3.10-pdf-a4.nix {
inherit stdenv fetchurl lib;
};
};
pdf_letter = {
recurseForDerivations = true;
python27 = import ./2.7-pdf-letter.nix {
inherit stdenv fetchurl lib;
};
python310 = import ./3.10-pdf-letter.nix {
inherit stdenv fetchurl lib;
};
};
text = {
recurseForDerivations = true;
python27 = import ./2.7-text.nix {
inherit stdenv fetchurl lib;
};
python310 = import ./3.10-text.nix {
inherit stdenv fetchurl lib;
};
@@ -30,18 +30,6 @@
in
{
python27 = callPackage ./cpython/2.7 {
self = __splicedPackages.python27;
sourceVersion = {
major = "2";
minor = "7";
patch = "18";
suffix = ".12"; # ActiveState's Python 2 extended support
};
hash = "sha256-RuEgfpags9wJm9Xe0daotqUx4knABEUc7DvtgnQXEfE=";
inherit passthruFun;
};
python311 = callPackage ./cpython {
self = __splicedPackages.python311;
sourceVersion = {
@@ -79,7 +79,7 @@ let
keep = self: hooks self { };
optionalExtensions = cond: as: lib.optionals cond as;
pythonExtension = import ../../../top-level/python-packages.nix;
python2Extension = import ../../../top-level/python2-packages.nix;
python2Extension = import ../../misc/resholve/python2-packages.nix;
extensions = lib.composeManyExtensions (
[
hooks
@@ -109,12 +109,10 @@ let
);
in
rec {
isPy27 = pythonVersion == "2.7";
isPy311 = pythonVersion == "3.11";
isPy312 = pythonVersion == "3.12";
isPy313 = pythonVersion == "3.13";
isPy314 = pythonVersion == "3.14";
isPy2 = lib.strings.substring 0 1 pythonVersion == "2";
isPy3 = lib.strings.substring 0 1 pythonVersion == "3";
isPy3k = isPy3;
isPyPy = lib.hasInfix "pypy" interpreter;
@@ -102,7 +102,11 @@ let
);
mkPythonDerivation =
if python.isPy3k then ./mk-python-derivation.nix else ./python2/mk-python-derivation.nix;
if python.isPy3k then
./mk-python-derivation.nix
else
# Python 2 build infrastructure lives with its only consumers (resholve, pypy27).
../../misc/resholve/python2/mk-python-derivation.nix;
buildPythonPackage = makeOverridablePythonPackage (
overrideStdenvCompat (
@@ -186,7 +190,6 @@ in
{
inherit lib pkgs stdenv;
inherit (python.passthru)
isPy27
isPy311
isPy312
isPy313
@@ -146,7 +146,7 @@ let
# It does break aarch64-darwin, which we do support. See:
# * https://bugs.python.org/issue35523
# * https://github.com/python/cpython/commit/e6b247c8e524
../3.7/no-win64-workaround.patch
./no-win64-workaround.patch
# fix openssl detection by reverting irrelevant change for us, to enable hashlib which is required by pip
(fetchpatch {
@@ -378,7 +378,7 @@ stdenv.mkDerivation (
postFixup = ''
# Include a sitecustomize.py file. Note it causes an error when it's in postInstall with 2.7.
cp ${../../sitecustomize.py} $out/${sitePackages}/sitecustomize.py
cp ${../../../interpreters/python/sitecustomize.py} $out/${sitePackages}/sitecustomize.py
''
+ lib.optionalString strip2to3 ''
rm -R $out/bin/2to3 $out/lib/python*/lib2to3
+1 -30
View File
@@ -12,35 +12,8 @@ let
knownVulnerabilities = [ ];
};
});
# We are removing `meta.knownVulnerabilities` from `python27`,
# and setting it in `resholve` itself.
python27' = (removeKnownVulnerabilities pkgsBuildHost.python27).override {
self = python27';
pkgsBuildHost = pkgsBuildHost // {
python27 = python27';
};
# strip down that python version as much as possible
openssl = null;
bzip2 = null;
readline = null;
ncurses = null;
gdbm = null;
sqlite = null;
rebuildBytecode = false;
stripBytecode = true;
strip2to3 = true;
stripConfig = true;
stripIdlelib = true;
stripTests = true;
enableOptimizations = false;
packageOverrides = final: prev: {
pip = removeKnownVulnerabilities prev.pip;
setuptools = removeKnownVulnerabilities prev.setuptools;
};
};
callPackage = lib.callPackageWith (pkgsBuildHost // { python27 = python27'; });
callPackage = lib.callPackageWith pkgsBuildHost;
source = callPackage ./source.nix { };
deps = callPackage ./deps.nix { };
# not exposed in all-packages
resholveBuildTimeOnly = removeKnownVulnerabilities resholve;
in
@@ -49,8 +22,6 @@ rec {
resholve = (
callPackage ./resholve.nix {
inherit (source) rSrc version;
inherit (deps.oil) oildev;
inherit (deps) configargparse;
inherit resholve-utils;
# used only in tests
resholve = resholveBuildTimeOnly;
-78
View File
@@ -1,78 +0,0 @@
{
lib,
callPackage,
fetchFromGitHub,
python27,
fetchPypi,
...
}:
/*
Notes on specific dependencies:
- if/when python2.7 is removed from nixpkgs, this may need to figure
out how to build oil's vendored python2
*/
rec {
oil = callPackage ./oildev.nix {
inherit python27;
inherit six;
inherit typing;
};
configargparse = python27.pkgs.buildPythonPackage rec {
pname = "configargparse";
version = "1.5.3";
format = "setuptools";
src = fetchFromGitHub {
owner = "bw2";
repo = "ConfigArgParse";
rev = "v${version}";
sha256 = "1dsai4bilkp2biy9swfdx2z0k4akw4lpvx12flmk00r80hzgbglz";
};
doCheck = false;
pythonImportsCheck = [ "configargparse" ];
meta = {
description = "Drop-in replacement for argparse";
homepage = "https://github.com/bw2/ConfigArgParse";
license = lib.licenses.mit;
};
};
six = python27.pkgs.buildPythonPackage rec {
pname = "six";
version = "1.16.0";
src = fetchPypi {
inherit pname version;
sha256 = "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926";
};
doCheck = false;
meta = {
description = "Python 2 and 3 compatibility library";
homepage = "https://pypi.org/project/six/";
license = lib.licenses.mit;
};
};
typing = python27.pkgs.buildPythonPackage rec {
pname = "typing";
version = "3.10.0.0";
src = fetchPypi {
inherit pname version;
sha256 = "13b4ad211f54ddbf93e5901a9967b1e07720c1d1b78d596ac6a439641aa1b130";
};
doCheck = false;
meta = {
description = "Backport of typing module to Python versions older than 3.5";
homepage = "https://docs.python.org/3/library/typing.html";
license = lib.licenses.psfl;
};
};
}
-121
View File
@@ -1,121 +0,0 @@
{
lib,
stdenv,
python27,
callPackage,
fetchFromGitHub,
makeWrapper,
re2c,
# oil deps
glibcLocales,
file,
six,
typing,
}:
{
/*
Upstream isn't interested in packaging this as a library
(or accepting all of the patches we need to do so).
This creates one without disturbing upstream too much.
*/
oildev = python27.pkgs.buildPythonPackage rec {
pname = "oildev-unstable";
version = "2024-02-26";
format = "setuptools";
src = fetchFromGitHub {
owner = "oilshell";
repo = "oil";
# rev == present HEAD of release/0.20.0
rev = "f730c79e2dcde4bc08e85a718951cfa42102bd01";
hash = "sha256-HBj3Izh1gD63EzbgZ/9If5vihR5L2HhnyCyMah6rMg4=";
/*
It's not critical to drop most of these; the primary target is
the vendored fork of Python-2.7.13, which is ~ 55M and over 3200
files, dozens of which get interpreter script patches in fixup.
Note: -f is necessary to keep it from being a pain to update
hash on rev updates. Command will fail w/o and not print hash.
*/
postFetch = ''
rm -rf $out/{Python-2.7.13,metrics,py-yajl,rfc,gold,web,testdata,services,demo}
'';
};
# patch to support a python package, pass tests on macOS, drop deps, etc.
patchSrc = fetchFromGitHub {
owner = "abathur";
repo = "nix-py-dev-oil";
rev = "v0.20.0.0";
hash = "sha256-qoA54rnzAdnFZ3k4kRzQWEdgtEjraCT5+NFw8AWnRDk=";
};
patches = [
"${patchSrc}/0001-add_setup_py.patch"
"${patchSrc}/0002-add_MANIFEST_in.patch"
"${patchSrc}/0006-disable_failing_libc_tests.patch"
"${patchSrc}/0007-namespace_via_init.patch"
"${patchSrc}/0009-avoid_nix_arch64_darwin_toolchain_bug.patch"
"${patchSrc}/0010-disable-line-input.patch"
"${patchSrc}/0011-disable-fanos.patch"
"${patchSrc}/0012-disable-doc-cmark.patch"
"${patchSrc}/0013-fix-pyverify.patch"
"${patchSrc}/0015-fix-compiled-extension-import-paths.patch"
];
configureFlags = [
"--without-readline"
];
nativeBuildInputs = [
re2c
file
makeWrapper
];
propagatedBuildInputs = [
six
typing
];
doCheck = true;
preBuild = ''
build/py.sh all
'';
postPatch = ''
patchShebangs asdl build core doctools frontend pyext oil_lang ysh
rm cpp/stdlib.h # keep modules from finding the wrong stdlib?
# work around hard parse failure documented in oilshell/oil#1468
substituteInPlace osh/cmd_parse.py --replace 'elif self.c_id == Id.Op_LParen' 'elif False'
'';
# See earlier note on glibcLocales TODO: verify needed?
LOCALE_ARCHIVE = lib.optionalString (
stdenv.buildPlatform.libc == "glibc"
) "${glibcLocales}/lib/locale/locale-archive";
# not exhaustive; sample what resholve uses as a sanity check
pythonImportsCheck = [
"oil"
"oil.asdl"
"oil.core"
"oil.frontend"
"oil._devbuild"
"oil._devbuild.gen.id_kind_asdl"
"oil._devbuild.gen.syntax_asdl"
"oil.osh"
"oil.tools.ysh_ify"
];
meta = {
license = with lib.licenses; [
psfl # Includes a portion of the python interpreter and standard library
asl20 # Licence for Oil itself
];
};
};
}
@@ -0,0 +1,28 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
}:
buildPythonPackage rec {
pname = "configargparse";
version = "1.5.3";
format = "setuptools";
src = fetchFromGitHub {
owner = "bw2";
repo = "ConfigArgParse";
rev = "v${version}";
sha256 = "1dsai4bilkp2biy9swfdx2z0k4akw4lpvx12flmk00r80hzgbglz";
};
doCheck = false;
pythonImportsCheck = [ "configargparse" ];
meta = {
description = "Drop-in replacement for argparse";
homepage = "https://github.com/bw2/ConfigArgParse";
license = lib.licenses.mit;
};
}
@@ -0,0 +1,115 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
makeWrapper,
re2c,
glibcLocales,
file,
six,
typing,
}:
# Upstream isn't interested in packaging this as a library
# (or accepting all of the patches we need to do so).
# This creates one without disturbing upstream too much.
buildPythonPackage rec {
pname = "oildev-unstable";
version = "2024-02-26";
format = "setuptools";
src = fetchFromGitHub {
owner = "oilshell";
repo = "oil";
# rev == present HEAD of release/0.20.0
rev = "f730c79e2dcde4bc08e85a718951cfa42102bd01";
hash = "sha256-HBj3Izh1gD63EzbgZ/9If5vihR5L2HhnyCyMah6rMg4=";
/*
It's not critical to drop most of these; the primary target is
the vendored fork of Python-2.7.13, which is ~ 55M and over 3200
files, dozens of which get interpreter script patches in fixup.
Note: -f is necessary to keep it from being a pain to update
hash on rev updates. Command will fail w/o and not print hash.
*/
postFetch = ''
rm -rf $out/{Python-2.7.13,metrics,py-yajl,rfc,gold,web,testdata,services,demo}
'';
};
# patch to support a python package, pass tests on macOS, drop deps, etc.
patchSrc = fetchFromGitHub {
owner = "abathur";
repo = "nix-py-dev-oil";
rev = "v0.20.0.0";
hash = "sha256-qoA54rnzAdnFZ3k4kRzQWEdgtEjraCT5+NFw8AWnRDk=";
};
patches = [
"${patchSrc}/0001-add_setup_py.patch"
"${patchSrc}/0002-add_MANIFEST_in.patch"
"${patchSrc}/0006-disable_failing_libc_tests.patch"
"${patchSrc}/0007-namespace_via_init.patch"
"${patchSrc}/0009-avoid_nix_arch64_darwin_toolchain_bug.patch"
"${patchSrc}/0010-disable-line-input.patch"
"${patchSrc}/0011-disable-fanos.patch"
"${patchSrc}/0012-disable-doc-cmark.patch"
"${patchSrc}/0013-fix-pyverify.patch"
"${patchSrc}/0015-fix-compiled-extension-import-paths.patch"
];
configureFlags = [
"--without-readline"
];
nativeBuildInputs = [
re2c
file
makeWrapper
];
propagatedBuildInputs = [
six
typing
];
doCheck = true;
preBuild = ''
build/py.sh all
'';
postPatch = ''
patchShebangs asdl build core doctools frontend pyext oil_lang ysh
rm cpp/stdlib.h # keep modules from finding the wrong stdlib?
# work around hard parse failure documented in oilshell/oil#1468
substituteInPlace osh/cmd_parse.py --replace 'elif self.c_id == Id.Op_LParen' 'elif False'
'';
# See earlier note on glibcLocales TODO: verify needed?
LOCALE_ARCHIVE = lib.optionalString (
stdenv.buildPlatform.libc == "glibc"
) "${glibcLocales}/lib/locale/locale-archive";
# not exhaustive; sample what resholve uses as a sanity check
pythonImportsCheck = [
"oil"
"oil.asdl"
"oil.core"
"oil.frontend"
"oil._devbuild"
"oil._devbuild.gen.id_kind_asdl"
"oil._devbuild.gen.syntax_asdl"
"oil.osh"
"oil.tools.ysh_ify"
];
meta = {
license = with lib.licenses; [
psfl # Includes a portion of the python interpreter and standard library
asl20 # Licence for Oil itself
];
};
}
@@ -0,0 +1,24 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
}:
buildPythonPackage {
pname = "sedparse";
version = "0.1.2";
format = "setuptools";
src = fetchFromGitHub {
owner = "aureliojargas";
repo = "sedparse";
rev = "0.1.2";
hash = "sha256-Q17A/oJ3GZbdSK55hPaMdw85g43WhTW9tuAuJtDfHHU=";
};
meta = {
description = "Python port of GNU sed's parser";
homepage = "https://github.com/aureliojargas/sedparse";
license = lib.licenses.gpl3Plus;
};
}
@@ -0,0 +1,24 @@
{
lib,
buildPythonPackage,
fetchPypi,
}:
buildPythonPackage rec {
pname = "six";
version = "1.16.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926";
};
doCheck = false;
meta = {
description = "Python 2 and 3 compatibility library";
homepage = "https://pypi.org/project/six/";
license = lib.licenses.mit;
};
}
@@ -0,0 +1,24 @@
{
lib,
buildPythonPackage,
fetchPypi,
}:
buildPythonPackage rec {
pname = "typing";
version = "3.10.0.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "13b4ad211f54ddbf93e5901a9967b1e07720c1d1b78d596ac6a439641aa1b130";
};
doCheck = false;
meta = {
description = "Backport of typing module to Python versions older than 3.5";
homepage = "https://docs.python.org/3/library/typing.html";
license = lib.licenses.psfl;
};
}
@@ -0,0 +1,29 @@
# Python 2 overlay applied to resholve's local python27 package set.
# Provides the bootstrap toolchain (bootstrapped-pip/pip/setuptools/wheel)
# plus resholve's own python2 build dependencies, kept here so all of
# resholve's python2 surface lives in one place.
self: super:
with self;
with super;
{
bootstrapped-pip = toPythonModule (callPackage ./python2-modules/bootstrapped-pip { });
pip = callPackage ./python2-modules/pip { };
setuptools = callPackage ./python2-modules/setuptools { };
wheel = callPackage ./python2-modules/wheel { };
# resholve build deps
configargparse = callPackage ./python2-modules/configargparse { };
six = callPackage ./python2-modules/six { };
typing = callPackage ./python2-modules/typing { };
oildev = callPackage ./python2-modules/oildev { };
sedparse = callPackage ./python2-modules/sedparse { };
}
@@ -0,0 +1,69 @@
{
lib,
pkgsBuildHost,
}:
let
removeKnownVulnerabilities =
pkg:
pkg.overrideAttrs (old: {
meta = (old.meta or { }) // {
knownVulnerabilities = [ ];
};
});
passthruFun = import ../../interpreters/python/passthrufun.nix {
inherit lib;
inherit (pkgsBuildHost)
stdenv
callPackage
pythonPackagesExtensions
config
makeScopeWithSplicing'
;
};
python27Base = pkgsBuildHost.callPackage ./cpython-2.7 {
self = python27;
sourceVersion = {
major = "2";
minor = "7";
patch = "18";
suffix = ".12"; # ActiveState's Python 2 extended support
};
hash = "sha256-RuEgfpags9wJm9Xe0daotqUx4knABEUc7DvtgnQXEfE=";
inherit passthruFun;
};
# We are removing `meta.knownVulnerabilities` from `python27`,
# and setting it in `resholve` itself.
python27 = (removeKnownVulnerabilities python27Base).override {
self = python27;
pkgsBuildHost = pkgsBuildHost // {
inherit python27;
};
# python2-only overrides for bootstrapped-pip/pip/setuptools/wheel
# (no longer applied globally — kept local to resholve)
packageOverrides = lib.composeExtensions (import ./python2-packages.nix) (
_self: super: {
pip = removeKnownVulnerabilities super.pip;
setuptools = removeKnownVulnerabilities super.setuptools;
}
);
# strip down that python version as much as possible
openssl = null;
bzip2 = null;
readline = null;
ncurses = null;
gdbm = null;
sqlite = null;
rebuildBytecode = false;
stripBytecode = true;
strip2to3 = true;
stripConfig = true;
stripIdlelib = true;
stripTests = true;
enableOptimizations = false;
};
in
python27
+2 -18
View File
@@ -1,32 +1,16 @@
{
lib,
callPackage,
python27,
fetchFromGitHub,
installShellFiles,
rSrc,
version,
oildev,
configargparse,
gawk,
binlore,
resholve,
resholve-utils,
}:
let
sedparse = python27.pkgs.buildPythonPackage {
pname = "sedparse";
version = "0.1.2";
format = "setuptools";
src = fetchFromGitHub {
owner = "aureliojargas";
repo = "sedparse";
rev = "0.1.2";
hash = "sha256-Q17A/oJ3GZbdSK55hPaMdw85g43WhTW9tuAuJtDfHHU=";
};
};
python27 = callPackage ./python27.nix { };
in
python27.pkgs.buildPythonApplication {
pname = "resholve";
@@ -35,7 +19,7 @@ python27.pkgs.buildPythonApplication {
nativeBuildInputs = [ installShellFiles ];
propagatedBuildInputs = [
propagatedBuildInputs = with python27.pkgs; [
oildev
configargparse
sedparse
-1
View File
@@ -13,7 +13,6 @@
bats,
libressl,
openssl,
python27,
file,
gettext,
rSrc,
@@ -5,7 +5,6 @@
setuptools,
pytestCheckHook,
pytest-asyncio,
isPy27,
}:
buildPythonPackage rec {
@@ -13,8 +12,6 @@ buildPythonPackage rec {
version = "0.2.2";
pyproject = true;
disabled = isPy27;
src = fetchFromGitHub {
owner = "fantix";
repo = "aiocontextvars";
@@ -4,7 +4,6 @@
aspellDicts,
buildPythonPackage,
fetchPypi,
isPy27,
pytestCheckHook,
setuptools,
}:
@@ -14,8 +13,6 @@ buildPythonPackage rec {
version = "1.15";
pyproject = true;
disabled = isPy27;
src = fetchPypi {
pname = "aspell-python-py3";
inherit version;
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
isPy27,
pytestCheckHook,
autoconf,
automake,
@@ -20,8 +19,6 @@ buildPythonPackage rec {
version = "3.1.1";
pyproject = true;
disabled = isPy27;
src = fetchFromGitHub {
owner = "aws";
repo = "aws-lambda-python-runtime-interface-client";
@@ -4,7 +4,6 @@
fetchPypi,
gcc,
wirelesstools,
isPy27,
isPyPy,
}:
@@ -13,7 +12,7 @@ buildPythonPackage rec {
version = "0.2.2";
format = "setuptools";
disabled = isPy27 || isPyPy;
disabled = isPyPy;
src = fetchPypi {
inherit pname version;
@@ -12,11 +12,8 @@
sqlalchemy,
pycrypto,
cryptography,
isPy27,
pytestCheckHook,
setuptools,
funcsigs ? null,
pycryptopp ? null,
}:
buildPythonPackage rec {
@@ -38,10 +35,6 @@ buildPythonPackage rec {
sqlalchemy
pycrypto
cryptography
]
++ lib.optionals isPy27 [
funcsigs
pycryptopp
];
nativeCheckInputs = [
@@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
isPy27,
fetchPypi,
pytest,
pytestCheckHook,
@@ -12,8 +11,6 @@ buildPythonPackage rec {
format = "setuptools";
pname = "ci-info";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
hash = "sha256-H9UMvUAfKa3/7rGLBIniMtFqwadFisa8MW3qtq5TX7A=";
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchPypi,
isPy27,
# propagates
click,
@@ -15,7 +14,6 @@ buildPythonPackage rec {
pname = "click-completion";
version = "0.5.2";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -2,7 +2,6 @@
buildPythonPackage,
cachetools,
fetchFromGitHub,
isPy27,
lib,
}:
@@ -10,7 +9,6 @@ buildPythonPackage rec {
pname = "coapthon3";
version = "1.0.2";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "Tanganelli";
@@ -3,7 +3,6 @@
python,
buildPythonPackage,
fetchFromGitLab,
isPy27,
jinja2,
pytest,
}:
@@ -22,8 +21,6 @@ buildPythonPackage rec {
sha256 = "1d66nka81mv9c07mki78lp5hdajqv4cq6aq2k7bh3mhkc5hwnwlg";
};
disabled = isPy27;
propagatedBuildInputs = [ jinja2 ];
nativeCheckInputs = [ pytest ];
@@ -1,7 +1,6 @@
{
buildPythonPackage,
fetchPypi,
isPy27,
pyserial,
srp,
lib,
@@ -11,7 +10,6 @@ buildPythonPackage rec {
pname = "digi-xbee";
version = "1.5.0";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
pname = "digi_xbee";
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchPypi,
isPy27,
appdirs,
asn1crypto,
cffi,
@@ -29,7 +28,6 @@ buildPythonPackage rec {
pname = "etesync";
version = "0.12.1";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
isPy27,
fetchPypi,
setuptools,
pytestCheckHook,
@@ -12,8 +11,6 @@ buildPythonPackage rec {
version = "0.9.0";
pyproject = true;
disabled = isPy27;
src = fetchPypi {
inherit pname version;
extension = "zip";
@@ -3,7 +3,6 @@
buildPythonPackage,
fetchFromGitHub,
setuptools,
isPy27,
pythonAtLeast,
coloredlogs,
humanfriendly,
@@ -21,7 +20,7 @@ buildPythonPackage rec {
format = "setuptools";
# pipes is removed in python 3.13
disabled = isPy27 || pythonAtLeast "3.13";
disabled = pythonAtLeast "3.13";
src = fetchFromGitHub {
owner = "xolox";
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
isPy27,
pytestCheckHook,
}:
@@ -10,7 +9,6 @@ buildPythonPackage rec {
pname = "gibberish-detector";
version = "0.1.1";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "domanchi";
@@ -10,13 +10,11 @@
libndtypes,
libxnd,
libgumath,
isPy27,
}:
buildPythonPackage {
pname = "gumath";
format = "setuptools";
disabled = isPy27;
inherit (libgumath) src version meta;
patches = [
@@ -2,7 +2,6 @@
buildPythonPackage,
colorama,
fetchPypi,
isPy27,
lib,
log-symbols,
six,
@@ -14,7 +13,6 @@ buildPythonPackage (finalAttrs: {
pname = "halo";
version = "0.0.31";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit (finalAttrs) pname version;
@@ -2,9 +2,7 @@
lib,
buildPythonPackage,
fetchPypi,
isPy27,
idna,
typing ? null,
}:
buildPythonPackage rec {
@@ -17,7 +15,7 @@ buildPythonPackage rec {
sha256 = "0sx50lkivsfjxx9zr4yh7l9gll2l9kvl0v0w8w4wk2x5v9bzjyj2";
};
propagatedBuildInputs = [ idna ] ++ lib.optionals isPy27 [ typing ];
propagatedBuildInputs = [ idna ];
meta = {
description = "Featureful, correct URL for Python";
@@ -2,7 +2,6 @@
lib,
fetchPypi,
buildPythonPackage,
isPy27,
pytest,
}:
@@ -10,7 +9,6 @@ buildPythonPackage rec {
pname = "inflection";
version = "0.5.1";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchPypi,
isPy27,
pytestCheckHook,
nbval,
jupyter-packaging,
@@ -19,8 +18,6 @@ buildPythonPackage rec {
version = "4.3.5";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
hash = "sha256-OU8kiVdlh8/XVTd6CaBn9GytIggZZQkgIf0avL54Uqg=";
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
isPy27,
setuptools-scm,
more-itertools,
pytestCheckHook,
@@ -13,8 +12,6 @@ buildPythonPackage rec {
version = "3.4.0";
pyproject = true;
disabled = isPy27;
src = fetchFromGitHub {
owner = "jaraco";
repo = "jaraco.classes";
@@ -1,7 +1,6 @@
{
buildPythonPackage,
fetchPypi,
isPy27,
lib,
numpy,
}:
@@ -10,7 +9,6 @@ buildPythonPackage rec {
pname = "javaobj-py3";
version = "0.4.4";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -1,15 +1,10 @@
{
lib,
isPy27,
buildPythonPackage,
fetchPypi,
pytestCheckHook,
mock,
}:
let
pythonEnv = lib.optional isPy27 mock;
in
buildPythonPackage rec {
pname = "json-rpc";
version = "1.15.0";
@@ -20,9 +15,7 @@ buildPythonPackage rec {
hash = "sha256-5kQdVsHc1UJByTfQotzRk73wvcU5tTFlJHE/VUt/hbk=";
};
nativeCheckInputs = pythonEnv ++ [ pytestCheckHook ];
nativeBuildInputs = pythonEnv;
nativeCheckInputs = [ pytestCheckHook ];
meta = {
description = "JSON-RPC 1/2 transport implementation";
@@ -4,7 +4,6 @@
fetchPypi,
fetchpatch,
python,
isPy27,
six,
zope-testing,
}:
@@ -13,7 +12,6 @@ buildPythonPackage rec {
pname = "manuel";
version = "1.13.0";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -8,14 +8,12 @@
pytestCheckHook,
hypothesis,
setuptools-scm,
isPy27,
}:
buildPythonPackage rec {
pname = "matchpy";
version = "0.5.5"; # Don't upgrade to 4.3.1, this tag is very old
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "HPAC";
@@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
isPy27,
fetchFromGitHub,
pytest,
}:
@@ -10,7 +9,6 @@ buildPythonPackage rec {
pname = "mergedeep";
version = "1.3.4";
format = "setuptools";
disabled = isPy27;
# PyPI tarball doesn't include tests directory
src = fetchFromGitHub {
@@ -1,6 +1,5 @@
{
lib,
isPy27,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
@@ -14,7 +13,6 @@ buildPythonPackage rec {
pname = "mlrose";
version = "1.3.0";
pyproject = true;
disabled = isPy27;
src = fetchFromGitHub {
owner = "gkhayes";
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
isPy27,
setuptools,
pytestCheckHook,
scipy,
@@ -18,8 +17,6 @@ buildPythonPackage rec {
version = "0.24.0";
pyproject = true;
disabled = isPy27;
src = fetchFromGitHub {
owner = "rasbt";
repo = "mlxtend";
@@ -1,9 +1,7 @@
{
buildPythonPackage,
fetchFromGitHub,
isPy27,
lib,
mock,
numpy,
pytestCheckHook,
}:
@@ -20,7 +18,7 @@ buildPythonPackage rec {
sha256 = "17r37pbxiv5dw857bmg990x836gq6sgww069w3q5jjg9m3xdm7dh";
};
propagatedBuildInputs = [ numpy ] ++ lib.optional isPy27 mock;
propagatedBuildInputs = [ numpy ];
nativeCheckInputs = [ pytestCheckHook ];
@@ -3,7 +3,6 @@
buildPythonPackage,
fetchFromGitHub,
pymongo,
isPy27,
six,
blinker,
pytestCheckHook,
@@ -15,7 +14,6 @@ buildPythonPackage rec {
pname = "mongoengine";
version = "0.29.1";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "MongoEngine";
@@ -3,7 +3,6 @@
buildPythonPackage,
fetchPypi,
six,
isPy27,
}:
buildPythonPackage rec {
@@ -11,8 +10,6 @@ buildPythonPackage rec {
version = "1.4.3";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "sha256-6QH4buWvfvbtovLCb0vSz+g4DYHxeLfjYH27zc7pcjk=";
@@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
isPy27,
fetchFromGitHub,
pytestCheckHook,
}:
@@ -11,8 +10,6 @@ buildPythonPackage rec {
version = "0.1.1";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "OpenXbox";
repo = "ms_cv";
@@ -5,13 +5,11 @@
python,
numpy,
libndtypes,
isPy27,
}:
buildPythonPackage {
pname = "ndtypes";
format = "setuptools";
disabled = isPy27;
inherit (libndtypes) version src meta;
outputs = [
@@ -5,14 +5,12 @@
jinja2,
setuptools,
rope,
isPy27,
}:
buildPythonPackage rec {
pname = "nixpkgs-pytools";
version = "1.3.0";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -6,7 +6,6 @@
fetchFromGitHub,
flake8,
flask-sqlalchemy,
isPy27,
mock,
peewee,
pytest-django,
@@ -21,7 +20,6 @@ buildPythonPackage rec {
pname = "nplusone";
version = "1.0.0";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "jmcarp";
@@ -2,7 +2,6 @@
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
isPy27,
libopus,
pytestCheckHook,
lib,
@@ -16,8 +15,6 @@ buildPythonPackage {
version = "3.0.3";
pyproject = true;
disabled = isPy27;
src = fetchFromGitHub {
owner = "orion-labs";
repo = "opuslib";
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
isPy27,
pytestCheckHook,
}:
@@ -11,8 +10,6 @@ buildPythonPackage rec {
version = "2.0.3";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "NordicSemiconductor";
repo = "piccata";
@@ -3,14 +3,12 @@
buildPythonPackage,
fetchFromGitHub,
aiohttp,
isPy27,
}:
buildPythonPackage rec {
pname = "plexauth";
version = "0.0.6";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "jjlawren";
@@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
isPy27,
fetchPypi,
setuptools,
setuptools-scm,
@@ -20,8 +19,6 @@ buildPythonPackage rec {
version = "1.8.2";
pyproject = true;
disabled = isPy27;
src = fetchPypi {
inherit pname version;
hash = "sha256-dlYfDeaKAdpN9q846ZVcTJ0aXJDac/fkAnalco7IPRA=";
@@ -2,14 +2,12 @@
lib,
buildPythonPackage,
fetchPypi,
isPy27,
}:
buildPythonPackage rec {
pname = "pq";
version = "1.9.1";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -4,7 +4,6 @@
click,
fetchPypi,
flask,
isPy27,
nixosTests,
prometheus-client,
py-air-control,
@@ -15,7 +14,6 @@ buildPythonPackage rec {
pname = "py-air-control-exporter";
version = "0.3.1";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -2,14 +2,12 @@
lib,
buildPythonPackage,
fetchPypi,
isPy27,
}:
buildPythonPackage rec {
pname = "py-sonic";
version = "1.0.3";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -1,7 +1,6 @@
{
lib,
buildPythonPackage,
isPy27,
fetchFromGitHub,
}:
@@ -10,8 +9,6 @@ buildPythonPackage rec {
version = "0.3.9";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "bannhead";
repo = "pyaehw4a1";
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchPypi,
isPy27,
cffi,
pytest,
}:
@@ -11,7 +10,6 @@ buildPythonPackage rec {
pname = "pycmarkgfm";
version = "1.2.1";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -2,7 +2,6 @@
lib,
stdenv,
buildPythonPackage,
isPy27,
fetchPypi,
enchant_2,
}:
@@ -11,7 +10,6 @@ buildPythonPackage rec {
pname = "pyenchant";
version = "3.3.0";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
isPy27,
pytest,
}:
@@ -10,7 +9,6 @@ buildPythonPackage {
pname = "pypubsub";
version = "4.0.3";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "schollii";
@@ -3,7 +3,6 @@
stdenv,
buildPythonPackage,
setuptools,
isPy27,
fetchPypi,
pkg-config,
dbus,
@@ -30,8 +29,6 @@ buildPythonPackage rec {
version = "5.15.10";
pyproject = true;
disabled = isPy27;
src = fetchPypi {
pname = "PyQt5";
inherit version;
@@ -2,7 +2,6 @@
buildPythonPackage,
fetchPypi,
pytestCheckHook,
isPy27,
lib,
setuptools,
setuptools-declarative-requirements,
@@ -13,7 +12,6 @@ buildPythonPackage rec {
pname = "pytest-helpers-namespace";
version = "2021.12.29";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
isPy27,
pytest,
tornado,
}:
@@ -11,7 +10,6 @@ buildPythonPackage {
pname = "pytest-tornasync";
version = "0.6.0.post2";
format = "setuptools";
disabled = isPy27;
src = fetchFromGitHub {
owner = "eukaryote";

Some files were not shown because too many files have changed in this diff Show More