about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python2-modules
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
committerAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
commit99fcaeccb89621dd492203ce1f2d551c06f228ed (patch)
tree41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/development/python2-modules
parent59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff)
parent75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff)
downloadnixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/config/console.nix
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/nixos/modules/services/networking/ssh/sshd.nix
	nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix
	nixpkgs/pkgs/applications/networking/irc/weechat/default.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/interpreters/python/default.nix
	nixpkgs/pkgs/development/node-packages/overrides.nix
	nixpkgs/pkgs/development/tools/b4/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix
	nixpkgs/pkgs/servers/mail/public-inbox/default.nix
	nixpkgs/pkgs/tools/security/pinentry/default.nix
	nixpkgs/pkgs/tools/text/unoconv/default.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/python2-modules')
-rw-r--r--nixpkgs/pkgs/development/python2-modules/Pygments/default.nix37
-rw-r--r--nixpkgs/pkgs/development/python2-modules/TurboCheetah/default.nix26
-rw-r--r--nixpkgs/pkgs/development/python2-modules/boto3/default.nix50
-rw-r--r--nixpkgs/pkgs/development/python2-modules/botocore/default.nix46
-rw-r--r--nixpkgs/pkgs/development/python2-modules/certifi/default.nix34
-rw-r--r--nixpkgs/pkgs/development/python2-modules/cffi/default.nix45
-rw-r--r--nixpkgs/pkgs/development/python2-modules/chardet/default.nix29
-rw-r--r--nixpkgs/pkgs/development/python2-modules/cheetah/default.nix33
-rw-r--r--nixpkgs/pkgs/development/python2-modules/construct/default.nix39
-rw-r--r--nixpkgs/pkgs/development/python2-modules/contextlib2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/python2-modules/coverage/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/google-apputils/default.nix41
-rw-r--r--nixpkgs/pkgs/development/python2-modules/gtkme/default.nix36
-rw-r--r--nixpkgs/pkgs/development/python2-modules/httpretty/default.nix52
-rw-r--r--nixpkgs/pkgs/development/python2-modules/hypothesis/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/idna/default.nix23
-rw-r--r--nixpkgs/pkgs/development/python2-modules/jinja2/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/marisa/default.nix29
-rw-r--r--nixpkgs/pkgs/development/python2-modules/markdown/default.nix33
-rw-r--r--nixpkgs/pkgs/development/python2-modules/mock/default.nix9
-rw-r--r--nixpkgs/pkgs/development/python2-modules/more-itertools/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/mutagen/default.nix34
-rw-r--r--nixpkgs/pkgs/development/python2-modules/numpy/default.nix99
-rw-r--r--nixpkgs/pkgs/development/python2-modules/numpy/numpy-distutils-C++.patch30
-rw-r--r--nixpkgs/pkgs/development/python2-modules/packaging/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pillow/default.nix47
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pillow/generic.nix77
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pip/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/prettytable/default.nix37
-rw-r--r--nixpkgs/pkgs/development/python2-modules/protobuf/default.nix59
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pygobject/default.nix47
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pygobject/pygobject-2.0-fix-darwin.patch88
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pygtk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pyparsing/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pyroma/default.nix26
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pysqlite/default.nix57
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pytest-runner/default.nix30
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pytest-xdist/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pytest/default.nix2
-rw-r--r--nixpkgs/pkgs/development/python2-modules/pyyaml/default.nix38
-rw-r--r--nixpkgs/pkgs/development/python2-modules/qpid-python/default.nix26
-rw-r--r--nixpkgs/pkgs/development/python2-modules/s3transfer/default.nix52
-rw-r--r--nixpkgs/pkgs/development/python2-modules/scandir/add-aarch64-darwin-dirent.patch28
-rw-r--r--nixpkgs/pkgs/development/python2-modules/scandir/default.nix6
-rw-r--r--nixpkgs/pkgs/development/python2-modules/sphinx/default.nix82
-rw-r--r--nixpkgs/pkgs/development/python2-modules/sphinx/python2-lexer.patch22
-rw-r--r--nixpkgs/pkgs/development/python2-modules/sphinxcontrib-websupport/default.nix25
-rw-r--r--nixpkgs/pkgs/development/python2-modules/typing/default.nix9
-rw-r--r--nixpkgs/pkgs/development/python2-modules/wheel/0001-tests-Rename-a-a-o-_-.py-_-.py.patch37
-rw-r--r--nixpkgs/pkgs/development/python2-modules/wheel/default.nix57
-rw-r--r--nixpkgs/pkgs/development/python2-modules/zipp/default.nix2
51 files changed, 313 insertions, 1290 deletions
diff --git a/nixpkgs/pkgs/development/python2-modules/Pygments/default.nix b/nixpkgs/pkgs/development/python2-modules/Pygments/default.nix
deleted file mode 100644
index aa59c370d2e7..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/Pygments/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, fetchpatch
-, docutils
-}:
-
-buildPythonPackage rec {
-  pname = "Pygments";
-  version = "2.5.2";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe";
-  };
-
-  patches = [
-    (fetchpatch {
-      name = "CVE-2021-27291.patch";
-      url = "https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14.patch";
-      sha256 = "0ap7jgkmvkkzijabsgnfrwl376cjsxa4jmzvqysrkwpjq3q4rxpa";
-      excludes = ["CHANGES"];
-    })
-  ];
-
-  propagatedBuildInputs = [ docutils ];
-
-  # Circular dependency with sphinx
-  doCheck = false;
-
-  meta = {
-    homepage = "https://pygments.org/";
-    description = "A generic syntax highlighter";
-    license = lib.licenses.bsd2;
-    maintainers = with lib.maintainers; [ ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/TurboCheetah/default.nix b/nixpkgs/pkgs/development/python2-modules/TurboCheetah/default.nix
deleted file mode 100644
index 717b2b5f2780..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/TurboCheetah/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, cheetah
-, nose
-}:
-
-buildPythonPackage rec {
-  pname = "TurboCheetah";
-  version = "1.0";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "9e4c7ecb0d061bfb58281363ee1b09337083f013a8b4d0355326a5d8668f450c";
-  };
-
-  propagatedBuildInputs = [ cheetah ];
-
-  checkInputs = [ nose ];
-
-  meta = {
-    description = "TurboGears plugin to support use of Cheetah templates";
-    homepage = "http://docs.turbogears.org/TurboCheetah";
-    license = lib.licenses.mit;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/boto3/default.nix b/nixpkgs/pkgs/development/python2-modules/boto3/default.nix
deleted file mode 100644
index c8b8210f6503..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/boto3/default.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, botocore
-, jmespath
-, s3transfer
-, futures ? null
-, docutils
-, nose
-, mock
-, isPy3k
-}:
-
-buildPythonPackage rec {
-  pname = "boto3";
-  version = "1.17.97"; # N.B: if you change this, change botocore and awscli to a matching version
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "0ab5afc51461c30f27aebef944211d16f47697b98ff8d2e2f6e49e59584853bb";
-  };
-
-  propagatedBuildInputs = [ botocore jmespath s3transfer ] ++ lib.optionals (!isPy3k) [ futures ];
-  checkInputs = [ docutils nose mock ];
-
-  checkPhase = ''
-    runHook preCheck
-    # This method is not in mock. It might have appeared in some versions.
-    sed -i 's/action.assert_called_once()/self.assertEqual(action.call_count, 1)/' \
-      tests/unit/resources/test_factory.py
-    nosetests -d tests/unit --verbose
-    runHook postCheck
-  '';
-
-  # Network access
-  doCheck = false;
-
-  pythonImportsCheck = [ "boto3" ];
-
-  meta = {
-    homepage = "https://github.com/boto/boto3";
-    license = lib.licenses.asl20;
-    description = "AWS SDK for Python";
-    longDescription = ''
-      Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for
-      Python, which allows Python developers to write software that makes use of
-      services like Amazon S3 and Amazon EC2.
-    '';
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/botocore/default.nix b/nixpkgs/pkgs/development/python2-modules/botocore/default.nix
deleted file mode 100644
index f23a10579c6e..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/botocore/default.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, python-dateutil
-, jmespath
-, docutils
-, simplejson
-, mock
-, nose
-, urllib3
-}:
-
-buildPythonPackage rec {
-  pname = "botocore";
-  version = "1.20.97"; # N.B: if you change this, change boto3 and awscli to a matching version
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "f7e119cf3e0f4a36100f0e983583afa91a84fb27c479a1716820aee4f2e190ab";
-  };
-
-  propagatedBuildInputs = [
-    python-dateutil
-    jmespath
-    docutils
-    simplejson
-    urllib3
-  ];
-
-  checkInputs = [ mock nose ];
-
-  checkPhase = ''
-    nosetests -v
-  '';
-
-  # Network access
-  doCheck = false;
-
-  pythonImportsCheck = [ "botocore" ];
-
-  meta = with lib; {
-    homepage = "https://github.com/boto/botocore";
-    license = licenses.asl20;
-    description = "A low-level interface to a growing number of Amazon Web Services";
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/certifi/default.nix b/nixpkgs/pkgs/development/python2-modules/certifi/default.nix
deleted file mode 100644
index 529d5b1fb996..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/certifi/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib
-, fetchPypi
-, buildPythonPackage
-, python3
-}:
-
-let
-  inherit (python3.pkgs) certifi;
-
-in buildPythonPackage rec {
-  pname = "certifi";
-  version = "2019.11.28";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f";
-  };
-
-  postPatch = ''
-    cp ${certifi.src}/certifi/cacert.pem certifi/cacert.pem
-  '';
-
-  pythonImportsCheck = [ "certifi" ];
-
-  # no tests implemented
-  doCheck = false;
-
-  meta = with lib; {
-    homepage = "https://github.com/certifi/python-certifi";
-    description = "Python package for providing Mozilla's CA Bundle";
-    license = licenses.isc;
-    maintainers = with maintainers; [ ]; # NixOps team
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/cffi/default.nix b/nixpkgs/pkgs/development/python2-modules/cffi/default.nix
new file mode 100644
index 000000000000..adeda6e90d22
--- /dev/null
+++ b/nixpkgs/pkgs/development/python2-modules/cffi/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, cffi }:
+
+if cffi == null then null else cffi.overridePythonAttrs {
+  disabledTests = lib.optionals stdenv.isDarwin [
+    # cannot load library 'c'
+    "test_FILE"
+    "test_FILE_object"
+    "test_FILE_only_for_FILE_arg"
+    "test_load_and_call_function"
+    "test_load_library"
+
+    # cannot load library 'dl'
+    "test_dlopen_handle"
+
+    # cannot load library 'm'
+    "test_dir_on_dlopen_lib"
+    "test_dlclose"
+    "test_dlopen"
+    "test_dlopen_constant"
+    "test_dlopen_flags"
+    "test_function_typedef"
+    "test_line_continuation_in_defines"
+    "test_missing_function"
+    "test_remove_comments"
+    "test_remove_line_continuation_comments"
+    "test_simple"
+    "test_sin"
+    "test_sinf"
+    "test_stdcall_only_on_windows"
+    "test_wraps_from_stdlib"
+
+    # MemoryError
+    "test_callback_as_function_argument"
+    "test_callback_crash"
+    "test_callback_decorator"
+    "test_callback_large_struct"
+    "test_callback_returning_void"
+    "test_cast_functionptr_and_int"
+    "test_function_pointer"
+    "test_functionptr_intptr_return"
+    "test_functionptr_simple"
+    "test_functionptr_void_return"
+    "test_functionptr_voidptr_return"
+  ];
+}
diff --git a/nixpkgs/pkgs/development/python2-modules/chardet/default.nix b/nixpkgs/pkgs/development/python2-modules/chardet/default.nix
deleted file mode 100644
index 5f6fe0a672a7..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/chardet/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ lib, buildPythonPackage, fetchPypi, fetchpatch
-, pytest, pytest-runner, hypothesis }:
-
-buildPythonPackage rec {
-  pname = "chardet";
-  version = "3.0.4";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "1bpalpia6r5x1kknbk11p1fzph56fmmnp405ds8icksd3knr5aw4";
-  };
-
-  patches = [
-    # Add pytest 4 support. See: https://github.com/chardet/chardet/pull/174
-    (fetchpatch {
-      url = "https://github.com/chardet/chardet/commit/0561ddcedcd12ea1f98b7ddedb93686ed8a5ffa4.patch";
-      sha256 = "1y1xhjf32rdhq9sfz58pghwv794f3w2f2qcn8p6hp4pc8jsdrn2q";
-    })
-  ];
-
-  checkInputs = [ pytest pytest-runner hypothesis ];
-
-  meta = with lib; {
-    homepage = "https://github.com/chardet/chardet";
-    description = "Universal encoding detector";
-    license = licenses.lgpl2;
-    maintainers = with maintainers; [ domenkozar ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/cheetah/default.nix b/nixpkgs/pkgs/development/python2-modules/cheetah/default.nix
deleted file mode 100644
index 1cee46fa7252..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/cheetah/default.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, markdown
-, isPy3k
-, TurboCheetah
-}:
-
-buildPythonPackage rec {
-  pname = "cheetah";
-  version = "2.4.4";
-
-  disabled = isPy3k;
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "be308229f0c1e5e5af4f27d7ee06d90bb19e6af3059794e5fd536a6f29a9b550";
-  };
-
-  propagatedBuildInputs = [ markdown ];
-
-  doCheck = false; # Circular dependency
-
-  checkInputs = [
-    TurboCheetah
-  ];
-
-  meta = {
-    homepage = "http://www.cheetahtemplate.org/";
-    description = "A template engine and code generation tool";
-    license = lib.licenses.mit;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/construct/default.nix b/nixpkgs/pkgs/development/python2-modules/construct/default.nix
deleted file mode 100644
index 5bbbd1501453..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/construct/default.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ lib, stdenv, buildPythonPackage, fetchFromGitHub
-, pytestCheckHook, pytest-benchmark, enum34, numpy, arrow, ruamel-yaml
-}:
-
-buildPythonPackage rec {
-  pname   = "construct";
-  version = "2.10.54";
-
-  # no tests in PyPI tarball
-  src = fetchFromGitHub {
-    owner  = pname;
-    repo   = pname;
-    rev    = "v${version}";
-    sha256 = "1mqspsn6bf3ibvih1zna2glkg8iw7vy5zg9gzg0d1m8zcndk2c48";
-  };
-
-  checkInputs = [ pytestCheckHook enum34 numpy ];
-
-  # these have dependencies that are broken on Python 2
-  disabledTestPaths = [
-    "tests/gallery/test_gallery.py"
-    "tests/test_benchmarks.py"
-    "tests/test_compiler.py"
-  ];
-
-  disabledTests = [
-    "test_benchmarks"
-    "test_timestamp"
-  ] ++ lib.optionals stdenv.isDarwin [
-    "test_multiprocessing"
-  ];
-
-  meta = with lib; {
-    description = "Powerful declarative parser (and builder) for binary data";
-    homepage = "https://construct.readthedocs.org/";
-    license = licenses.mit;
-    maintainers = with maintainers; [ dotlambda ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/contextlib2/default.nix b/nixpkgs/pkgs/development/python2-modules/contextlib2/default.nix
index 38d9fb696e28..063039448fea 100644
--- a/nixpkgs/pkgs/development/python2-modules/contextlib2/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/contextlib2/default.nix
@@ -1,7 +1,6 @@
 { lib
 , buildPythonPackage
 , fetchPypi
-, unittest2
 }:
 
 buildPythonPackage rec {
@@ -13,7 +12,8 @@ buildPythonPackage rec {
     sha256 = "01f490098c18b19d2bd5bb5dc445b2054d2fa97f09a4280ba2c5f3c394c8162e";
   };
 
-  checkInputs = [ unittest2 ];
+  # requires unittest2, which has been removed
+  doCheck = false;
 
   meta = {
     description = "Backports and enhancements for the contextlib module";
diff --git a/nixpkgs/pkgs/development/python2-modules/coverage/default.nix b/nixpkgs/pkgs/development/python2-modules/coverage/default.nix
index f93d32d392f7..94da2f4c7b43 100644
--- a/nixpkgs/pkgs/development/python2-modules/coverage/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/coverage/default.nix
@@ -15,7 +15,7 @@ buildPythonPackage rec {
 
   # No tests in archive
   doCheck = false;
-  checkInputs = [ mock ];
+  nativeCheckInputs = [ mock ];
 
   meta = {
     description = "Code coverage measurement for python";
diff --git a/nixpkgs/pkgs/development/python2-modules/google-apputils/default.nix b/nixpkgs/pkgs/development/python2-modules/google-apputils/default.nix
deleted file mode 100644
index 225adf348d1a..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/google-apputils/default.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, isPy3k
-, pytz
-, gflags
-, python-dateutil
-, mox
-, python
-}:
-
-buildPythonPackage rec {
-  pname = "google-apputils";
-  version = "0.4.2";
-  disabled = isPy3k;
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "0afw0gxmh0yw5g7xsmw49gs8bbp0zyhbh6fr1b0h48f3a439v5a7";
-  };
-
-  preConfigure = ''
-    sed -i '/ez_setup/d' setup.py
-  '';
-
-  propagatedBuildInputs = [ pytz gflags python-dateutil mox ];
-
-  checkPhase = ''
-    ${python.executable} setup.py google_test
-  '';
-
-  # ERROR:root:Trying to access flag test_tmpdir before flags were parsed.
-  doCheck = false;
-
-  meta = with lib; {
-    description = "Google Application Utilities for Python";
-    homepage = "https://github.com/google/google-apputils";
-    license = licenses.asl20;
-    maintainers = with maintainers; [ SuperSandro2000 ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/gtkme/default.nix b/nixpkgs/pkgs/development/python2-modules/gtkme/default.nix
deleted file mode 100644
index bc23854d95c8..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/gtkme/default.nix
+++ /dev/null
@@ -1,36 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, pkg-config
-, gobject-introspection
-, pygobject3
-, gtk3
-, glib
-}:
-
-buildPythonPackage rec {
-  pname = "gtkme";
-  version = "1.5.3";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "sha256-NIUgnbfcHjbPfsH3CF2Bywo8owrdsi1wqDoMxOa+2U4=";
-  };
-
-  nativeBuildInputs = [ pkg-config gobject-introspection gtk3 ];
-  buildInputs = [ pygobject3 glib ];
-  propagatedBuildInputs = [ gtk3 ];
-
-  pythonImportsCheck = [
-    "gtkme"
-  ];
-
-  meta = with lib; {
-    description = "Manages an Application with Gtk windows, forms, lists and other complex items easily";
-    homepage = "https://gitlab.com/doctormo/gtkme";
-    license = licenses.gpl3Plus;
-    maintainers = with maintainers; [
-      revol-xut
-    ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/httpretty/default.nix b/nixpkgs/pkgs/development/python2-modules/httpretty/default.nix
deleted file mode 100644
index 92ed5c6616e0..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/httpretty/default.nix
+++ /dev/null
@@ -1,52 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, tornado
-, requests
-, httplib2
-, sure
-, nose
-, nose-exclude
-, coverage
-, rednose
-, nose-randomly
-, six
-, mock
-}:
-
-buildPythonPackage rec {
-  pname = "httpretty";
-  version = "0.9.7";
-
-  # drop this for version > 0.9.7
-  # Flaky tests: https://github.com/gabrielfalcao/HTTPretty/pull/394
-  doCheck = lib.versionAtLeast version "0.9.8";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "66216f26b9d2c52e81808f3e674a6fb65d4bf719721394a1a9be926177e55fbe";
-  };
-
-  propagatedBuildInputs = [ six ];
-
-  checkInputs = [ nose sure coverage mock rednose
-    # Following not declared in setup.py
-    nose-randomly requests tornado httplib2 nose-exclude
-  ];
-
-  __darwinAllowLocalNetworking = true;
-
-  # Those flaky tests are failing intermittently on all platforms
-  NOSE_EXCLUDE = lib.concatStringsSep "," [
-    "tests.functional.test_httplib2.test_callback_response"
-    "tests.functional.test_requests.test_streaming_responses"
-    "tests.functional.test_httplib2.test_callback_response"
-    "tests.functional.test_requests.test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2"
-  ];
-
-  meta = with lib; {
-    homepage = "https://httpretty.readthedocs.org/";
-    description = "HTTP client request mocking tool";
-    license = licenses.mit;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/hypothesis/default.nix b/nixpkgs/pkgs/development/python2-modules/hypothesis/default.nix
index 47bc8860bc54..f1eb403d8109 100644
--- a/nixpkgs/pkgs/development/python2-modules/hypothesis/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/hypothesis/default.nix
@@ -29,7 +29,7 @@ buildPythonPackage rec {
     sortedcontainers
   ] ++ lib.optional (!isPy3k) enum34;
 
-  checkInputs = [ pytest pytest-xdist flaky mock pexpect ];
+  nativeCheckInputs = [ pytest pytest-xdist flaky mock pexpect ];
   inherit doCheck;
 
   checkPhase = ''
diff --git a/nixpkgs/pkgs/development/python2-modules/idna/default.nix b/nixpkgs/pkgs/development/python2-modules/idna/default.nix
deleted file mode 100644
index 9a1c1dc271f1..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/idna/default.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, pytestCheckHook
-}:
-
-buildPythonPackage rec {
-  pname = "idna";
-  version = "2.10";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6";
-  };
-
-  checkInputs = [ pytestCheckHook ];
-
-  meta = {
-    homepage = "https://github.com/kjd/idna/";
-    description = "Internationalized Domain Names in Applications (IDNA)";
-    license = lib.licenses.bsd3;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/jinja2/default.nix b/nixpkgs/pkgs/development/python2-modules/jinja2/default.nix
index 0be970d49946..3b593338763f 100644
--- a/nixpkgs/pkgs/development/python2-modules/jinja2/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/jinja2/default.nix
@@ -16,7 +16,7 @@ buildPythonPackage rec {
     sha256 = "a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6";
   };
 
-  checkInputs = [ pytest ];
+  nativeCheckInputs = [ pytest ];
   propagatedBuildInputs = [ markupsafe setuptools ];
 
   # Multiple tests run out of stack space on 32bit systems with python2.
diff --git a/nixpkgs/pkgs/development/python2-modules/marisa/default.nix b/nixpkgs/pkgs/development/python2-modules/marisa/default.nix
deleted file mode 100644
index 93a4ccb959f7..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/marisa/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ lib, buildPythonPackage, fetchFromGitHub, marisa, swig
-, isPy3k
-}:
-
-buildPythonPackage rec {
-  pname = "marisa";
-  version = "1.3.40";
-
-  disabled = isPy3k;
-
-  src = fetchFromGitHub {
-    owner = "s-yata";
-    repo  = "marisa-trie";
-    rev   = "8dba9850b89d7828ebf33b8ab84df2b54d31260b";
-    sha256 = "0pkp9fggk53lxlicfwrskgx33qplc4v6njbavlnz4x4z63zd4933";
-  };
-
-  nativeBuildInputs = [ swig marisa ];
-  buildInputs = [ marisa ];
-
-  sourceRoot = "${src.name}/bindings/python";
-
-  meta = with lib; {
-    description = "Python binding for marisa package (do not confuse with marisa-trie python bindings)";
-    homepage    = "https://github.com/s-yata/marisa-trie";
-    license     = with licenses; [ bsd2 lgpl2 ];
-    maintainers = with maintainers; [ vanzef ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/markdown/default.nix b/nixpkgs/pkgs/development/python2-modules/markdown/default.nix
deleted file mode 100644
index 13ed2f1744a2..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/markdown/default.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, setuptools
-, nose
-, pyyaml
-, pythonOlder
-, importlib-metadata
-}:
-
-buildPythonPackage rec {
-  pname = "Markdown";
-  version = "3.1.1";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a";
-  };
-
-  propagatedBuildInputs = [
-    setuptools
-  ] ++ lib.optionals (pythonOlder "3.8") [
-    importlib-metadata
-  ];
-
-  checkInputs = [ nose pyyaml ];
-
-  meta = {
-    description = "A Python implementation of John Gruber's Markdown with Extension support";
-    homepage = "https://github.com/Python-Markdown/markdown";
-    license = lib.licenses.bsd3;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/mock/default.nix b/nixpkgs/pkgs/development/python2-modules/mock/default.nix
index 190297b41a2d..a343acfffaa1 100644
--- a/nixpkgs/pkgs/development/python2-modules/mock/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/mock/default.nix
@@ -5,7 +5,7 @@
 , funcsigs
 , six
 , pbr
-, python
+, unittestCheckHook
 , pytest
 }:
 
@@ -27,11 +27,8 @@ buildPythonPackage rec {
   #doCheck = !(python.isPyPy && python.isPy27);
   doCheck = false; # Infinite recursion pytest
 
-  checkPhase = ''
-    ${python.interpreter} -m unittest discover
-  '';
-
-  checkInputs = [
+  nativeCheckInputs = [
+    unittestCheckHook
     pytest
   ];
 
diff --git a/nixpkgs/pkgs/development/python2-modules/more-itertools/default.nix b/nixpkgs/pkgs/development/python2-modules/more-itertools/default.nix
index f9a6ac732e2e..615b1d00d204 100644
--- a/nixpkgs/pkgs/development/python2-modules/more-itertools/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/more-itertools/default.nix
@@ -16,7 +16,7 @@ buildPythonPackage rec {
     sha256 = "38a936c0a6d98a38bcc2d03fdaaedaba9f412879461dd2ceff8d37564d6522e4";
   };
 
-  checkInputs = [ nose ];
+  nativeCheckInputs = [ nose ];
   propagatedBuildInputs = [ six ];
 
   # iterable = range(10 ** 10)  # Is efficiently reversible
diff --git a/nixpkgs/pkgs/development/python2-modules/mutagen/default.nix b/nixpkgs/pkgs/development/python2-modules/mutagen/default.nix
deleted file mode 100644
index 7f2e9f452b4d..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/mutagen/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, hypothesis
-, pycodestyle
-, pyflakes
-, pytest
-, setuptools
-, pkgs
-}:
-
-buildPythonPackage rec {
-  pname = "mutagen";
-  version = "1.43.1";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "d873baeb7815311d3420aab0a1d83f050f628228cbc2d6045a14a16460411bc9";
-  };
-
-  propagatedBuildInputs = [ setuptools ];
-  checkInputs = [
-    pkgs.faad2 pkgs.flac pkgs.vorbis-tools pkgs.liboggz
-    pkgs.glibcLocales pycodestyle pyflakes pytest hypothesis
-  ];
-  LC_ALL = "en_US.UTF-8";
-
-  meta = with lib; {
-    description = "Python multimedia tagging library";
-    homepage = "https://mutagen.readthedocs.io";
-    license = licenses.lgpl2Plus;
-    platforms = platforms.all;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/numpy/default.nix b/nixpkgs/pkgs/development/python2-modules/numpy/default.nix
deleted file mode 100644
index b1d71bd66f36..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/numpy/default.nix
+++ /dev/null
@@ -1,99 +0,0 @@
-{ lib
-, fetchPypi
-, python
-, buildPythonPackage
-, gfortran
-, pytest
-, blas
-, lapack
-, writeTextFile
-, isPyPy
-, cython
-, setuptoolsBuildHook
- }:
-
-assert (!blas.isILP64) && (!lapack.isILP64);
-
-let
-  cfg = writeTextFile {
-    name = "site.cfg";
-    text = (lib.generators.toINI {} {
-      ${blas.implementation} = {
-        include_dirs = "${lib.getDev blas}/include:${lib.getDev lapack}/include";
-        library_dirs = "${blas}/lib:${lapack}/lib";
-        runtime_library_dirs = "${blas}/lib:${lapack}/lib";
-        libraries = "lapack,lapacke,blas,cblas";
-      };
-      lapack = {
-        include_dirs = "${lib.getDev lapack}/include";
-        library_dirs = "${lapack}/lib";
-        runtime_library_dirs = "${lapack}/lib";
-      };
-      blas = {
-        include_dirs = "${lib.getDev blas}/include";
-        library_dirs = "${blas}/lib";
-        runtime_library_dirs = "${blas}/lib";
-      };
-    });
-  };
-in buildPythonPackage rec {
-  pname = "numpy";
-  version = "1.16.6";
-  format = "pyproject.toml";
-
-  src = fetchPypi {
-    inherit pname version;
-    extension = "zip";
-    sha256 = "e5cf3fdf13401885e8eea8170624ec96225e2174eb0c611c6f26dd33b489e3ff";
-  };
-
-  nativeBuildInputs = [ gfortran pytest cython setuptoolsBuildHook ];
-  buildInputs = [ blas lapack ];
-
-  patches = lib.optionals python.hasDistutilsCxxPatch [
-    # We patch cpython/distutils to fix https://bugs.python.org/issue1222585
-    # Patching of numpy.distutils is needed to prevent it from undoing the
-    # patch to distutils.
-    ./numpy-distutils-C++.patch
-  ];
-
-  preConfigure = ''
-    sed -i 's/-faltivec//' numpy/distutils/system_info.py
-    export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
-    export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES))
-  '';
-
-  preBuild = ''
-    ln -s ${cfg} site.cfg
-  '';
-
-  enableParallelBuilding = true;
-
-  doCheck = !isPyPy; # numpy 1.16+ hits a bug in pypy's ctypes, using either numpy or pypy HEAD fixes this (https://github.com/numpy/numpy/issues/13807)
-
-  checkPhase = ''
-    runHook preCheck
-    pushd dist
-    ${python.interpreter} -c 'import numpy; numpy.test("fast", verbose=10)'
-    popd
-    runHook postCheck
-  '';
-
-  passthru = {
-    # just for backwards compatibility
-    blas = blas.provider;
-    blasImplementation = blas.implementation;
-    inherit cfg;
-  };
-
-  # Disable test
-  # - test_large_file_support: takes a long time and can cause the machine to run out of disk space
-  NOSE_EXCLUDE="test_large_file_support";
-
-  meta = {
-    description = "Scientific tools for Python";
-    homepage = "https://numpy.org/";
-    license = lib.licenses.bsd3;
-    maintainers = with lib.maintainers; [ fridh ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/numpy/numpy-distutils-C++.patch b/nixpkgs/pkgs/development/python2-modules/numpy/numpy-distutils-C++.patch
deleted file mode 100644
index b2626ea26e5b..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/numpy/numpy-distutils-C++.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py
---- a/numpy/distutils/unixccompiler.py
-+++ b/numpy/distutils/unixccompiler.py
-@@ -44,8 +44,6 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
-         if opt not in llink_s:
-             self.linker_so = llink_s.split() + opt.split()
- 
--    display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
--
-     # gcc style automatic dependencies, outputs a makefile (-MF) that lists
-     # all headers needed by a c file as a side effect of compilation (-MMD)
-     if getattr(self, '_auto_depends', False):
-@@ -54,8 +52,15 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
-         deps = []
- 
-     try:
--        self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps +
--                   extra_postargs, display = display)
-+        if self.detect_language(src) == 'c++':
-+            display = '%s: %s' % (os.path.basename(self.compiler_so_cxx[0]), src)
-+            self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + deps +
-+                       extra_postargs, display = display)
-+        else:
-+            display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
-+            self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps +
-+                       extra_postargs, display = display)
-+
-     except DistutilsExecError:
-         msg = str(get_exception())
-         raise CompileError(msg)
diff --git a/nixpkgs/pkgs/development/python2-modules/packaging/default.nix b/nixpkgs/pkgs/development/python2-modules/packaging/default.nix
index 0f9e61859a16..61f0ed3a7303 100644
--- a/nixpkgs/pkgs/development/python2-modules/packaging/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/packaging/default.nix
@@ -22,7 +22,7 @@ buildPythonPackage rec {
 
   propagatedBuildInputs = [ pyparsing six ];
 
-  checkInputs = [
+  nativeCheckInputs = [
     pytestCheckHook
     pretend
   ];
diff --git a/nixpkgs/pkgs/development/python2-modules/pillow/default.nix b/nixpkgs/pkgs/development/python2-modules/pillow/default.nix
deleted file mode 100644
index 61242c894a89..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/pillow/default.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k
-, olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
-, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
-}@args:
-
-import ./generic.nix (rec {
-  pname = "Pillow";
-  version = "6.2.2";
-
-  disabled = !isPy3k;
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "0l5rv8jkdrb5q846v60v03mcq64yrhklidjkgwv6s1pda71g17yv";
-  };
-
-  meta = with lib; {
-    homepage = "https://python-pillow.org/";
-    description = "The friendly PIL fork (Python Imaging Library)";
-    longDescription = ''
-      The Python Imaging Library (PIL) adds image processing
-      capabilities to your Python interpreter.  This library
-      supports many file formats, and provides powerful image
-      processing and graphics capabilities.
-    '';
-    license = "http://www.pythonware.com/products/pil/license.htm";
-    maintainers = with maintainers; [ goibhniu prikhi SuperSandro2000 ];
-    knownVulnerabilities = [
-      "CVE-2020-10177"
-      "CVE-2020-10378"
-      "CVE-2020-10379"
-      "CVE-2020-10994"
-      "CVE-2020-11538"
-      "CVE-2020-35653"
-      "CVE-2020-35654"
-      "CVE-2020-35655"
-      "CVE-2021-25289"
-      "CVE-2021-25290"
-      "CVE-2021-25291"
-      "CVE-2021-25292"
-      "CVE-2021-25293"
-      "CVE-2021-27921"
-      "CVE-2021-27922"
-      "CVE-2021-27923"
-    ];
-  };
-} // args )
diff --git a/nixpkgs/pkgs/development/python2-modules/pillow/generic.nix b/nixpkgs/pkgs/development/python2-modules/pillow/generic.nix
deleted file mode 100644
index 3e33f1a8aa0f..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/pillow/generic.nix
+++ /dev/null
@@ -1,77 +0,0 @@
-{ pname
-, version
-, disabled
-, src
-, meta
-, ...
-}@args:
-
-with args;
-
-buildPythonPackage rec {
-  inherit pname version src meta;
-
-  # Disable imagefont tests, because they don't work well with infinality:
-  # https://github.com/python-pillow/Pillow/issues/1259
-  postPatch = ''
-    rm Tests/test_imagefont.py
-  '';
-
-  # Disable darwin tests which require executables: `iconutil` and `screencapture`
-  disabledTests = lib.optionals stdenv.isDarwin [
-    "test_grab"
-    "test_grabclipboard"
-    "test_save"
-
-    # pillow-simd
-    "test_roundtrip"
-    "test_basic"
-  ] ++ lib.optionals (lib.versions.major version == "6") [
-    # RuntimeError: Error setting from dictionary
-    "test_custom_metadata"
-  ];
-
-  propagatedBuildInputs = [ olefile ]
-    ++ lib.optionals (lib.versionAtLeast version "8.2.0") [ defusedxml ];
-
-  checkInputs = [ pytestCheckHook pyroma numpy ];
-
-  buildInputs = [ freetype libjpeg openjpeg libimagequant zlib libtiff libwebp tcl lcms2 ]
-    ++ lib.optionals (lib.versionAtLeast version "7.1.0") [ libxcb ]
-    ++ lib.optionals (isPyPy) [ tk libX11 ];
-
-  # NOTE: we use LCMS_ROOT as WEBP root since there is not other setting for webp.
-  # NOTE: The Pillow install script will, by default, add paths like /usr/lib
-  # and /usr/include to the search paths. This can break things when building
-  # on a non-NixOS system that has some libraries installed that are not
-  # installed in Nix (for example, Arch Linux has jpeg2000 but Nix doesn't
-  # build Pillow with this support). We patch the `disable_platform_guessing`
-  # setting here, instead of passing the `--disable-platform-guessing`
-  # command-line option, since the command-line option doesn't work when we run
-  # tests.
-  preConfigure = let
-    libinclude' = pkg: ''"${pkg.out}/lib", "${pkg.out}/include"'';
-    libinclude = pkg: ''"${pkg.out}/lib", "${pkg.dev}/include"'';
-  in ''
-    sed -i "setup.py" \
-        -e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = ${libinclude freetype}|g ;
-            s|^JPEG_ROOT =.*$|JPEG_ROOT = ${libinclude libjpeg}|g ;
-            s|^JPEG2K_ROOT =.*$|JPEG2K_ROOT = ${libinclude openjpeg}|g ;
-            s|^IMAGEQUANT_ROOT =.*$|IMAGEQUANT_ROOT = ${libinclude' libimagequant}|g ;
-            s|^ZLIB_ROOT =.*$|ZLIB_ROOT = ${libinclude zlib}|g ;
-            s|^LCMS_ROOT =.*$|LCMS_ROOT = ${libinclude lcms2}|g ;
-            s|^TIFF_ROOT =.*$|TIFF_ROOT = ${libinclude libtiff}|g ;
-            s|^TCL_ROOT=.*$|TCL_ROOT = ${libinclude' tcl}|g ;
-            s|self\.disable_platform_guessing = None|self.disable_platform_guessing = True|g ;'
-    export LDFLAGS="$LDFLAGS -L${libwebp}/lib"
-    export CFLAGS="$CFLAGS -I${libwebp}/include"
-  '' + lib.optionalString (lib.versionAtLeast version "7.1.0") ''
-    export LDFLAGS="$LDFLAGS -L${libxcb}/lib"
-    export CFLAGS="$CFLAGS -I${libxcb.dev}/include"
-  '' + lib.optionalString stdenv.isDarwin ''
-    # Remove impurities
-    substituteInPlace setup.py \
-      --replace '"/Library/Frameworks",' "" \
-      --replace '"/System/Library/Frameworks"' ""
-  '';
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/pip/default.nix b/nixpkgs/pkgs/development/python2-modules/pip/default.nix
index e3666d6a7961..ba78377f5943 100644
--- a/nixpkgs/pkgs/development/python2-modules/pip/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/pip/default.nix
@@ -28,7 +28,7 @@ buildPythonPackage rec {
   # to force it a little.
   pipInstallFlags = [ "--ignore-installed" ];
 
-  checkInputs = [ mock scripttest virtualenv pretend pytest ];
+  nativeCheckInputs = [ mock scripttest virtualenv pretend pytest ];
   # Pip wants pytest, but tests are not distributed
   doCheck = false;
 
diff --git a/nixpkgs/pkgs/development/python2-modules/prettytable/default.nix b/nixpkgs/pkgs/development/python2-modules/prettytable/default.nix
deleted file mode 100644
index 8191e9b5f579..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/prettytable/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, glibcLocales
-, setuptools-scm
-, wcwidth
-}:
-
-buildPythonPackage rec {
-  pname = "prettytable";
-  version = "1.0.1";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "0wcpp1nkicrswb353yn6xd2x535cpif62nw5rgz33c1wj0wzbdvb";
-  };
-
-  nativeBuildInputs = [ setuptools-scm ];
-  buildInputs = [ glibcLocales ];
-
-  propagatedBuildInputs = [ wcwidth ];
-
-  preCheck = ''
-    export LANG="en_US.UTF-8"
-  '';
-
-  # no test no longer available in pypi package
-  doCheck = false;
-  pythonImportsCheck = [ "prettytable" ];
-
-  meta = with lib; {
-    description = "Simple Python library for easily displaying tabular data in a visually appealing ASCII table format";
-    homepage = "http://code.google.com/p/prettytable/";
-    license = licenses.bsd3;
-  };
-
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/protobuf/default.nix b/nixpkgs/pkgs/development/python2-modules/protobuf/default.nix
deleted file mode 100644
index 30e9fbf9ea75..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/protobuf/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{ buildPackages
-, lib
-, fetchpatch
-, python
-, buildPythonPackage
-, isPy37
-, protobuf
-, google-apputils ? null
-, six
-, pyext
-, isPy27
-, disabled
-, doCheck ? true
-}:
-
-buildPythonPackage {
-  inherit (protobuf) pname src version;
-  inherit disabled;
-  doCheck = doCheck && !isPy27; # setuptools>=41.4 no longer collects correctly on python2
-
-  propagatedBuildInputs = [ six ] ++ lib.optionals isPy27 [ google-apputils ];
-  propagatedNativeBuildInputs = [ buildPackages.protobuf ]; # For protoc.
-  nativeBuildInputs = [ pyext ] ++ lib.optionals isPy27 [ google-apputils ];
-  buildInputs = [ protobuf ];
-
-  patches = lib.optional (isPy37 && (lib.versionOlder protobuf.version "3.6.1.2"))
-    # Python 3.7 compatibility (not needed for protobuf >= 3.6.1.2)
-    (fetchpatch {
-      url = "https://github.com/protocolbuffers/protobuf/commit/0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7.patch";
-      sha256 = "09hw22y3423v8bbmc9xm07znwdxfbya6rp78d4zqw6fisdvjkqf1";
-      stripLen = 1;
-    })
-  ;
-
-  prePatch = ''
-    while [ ! -d python ]; do
-      cd *
-    done
-    cd python
-  '';
-
-  setupPyGlobalFlags = lib.optional (lib.versionAtLeast protobuf.version "2.6.0")
-    "--cpp_implementation";
-
-  pythonImportsCheck = [
-    "google.protobuf"
-  ] ++ lib.optionals (lib.versionAtLeast protobuf.version "2.6.0") [
-    "google.protobuf.internal._api_implementation" # Verify that --cpp_implementation worked
-  ];
-
-  meta = with lib; {
-    description = "Protocol Buffers are Google's data interchange format";
-    homepage = "https://developers.google.com/protocol-buffers/";
-    license = licenses.bsd3;
-    maintainers = with maintainers; [ knedlsepp ];
-  };
-
-  passthru.protobuf = protobuf;
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/pygobject/default.nix b/nixpkgs/pkgs/development/python2-modules/pygobject/default.nix
index ce9410eaf8b5..2a09002976b2 100644
--- a/nixpkgs/pkgs/development/python2-modules/pygobject/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/pygobject/default.nix
@@ -1,33 +1,48 @@
-{ lib, stdenv, fetchurl, buildPythonPackage, pkg-config, glib, gobject-introspection,
-pycairo, cairo, which, ncurses, meson, ninja, isPy3k, gnome }:
+{ lib, stdenv, fetchurl, fetchpatch, python, buildPythonPackage, pkg-config, glib, isPy3k, pythonAtLeast }:
 
 buildPythonPackage rec {
   pname = "pygobject";
-  version = "3.36.1";
-
+  version = "2.28.7";
   format = "other";
+  disabled = pythonAtLeast "3.9";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0b9CgC0c7BE7Wtqg579/N0W0RSHcIWNYjSdtXNYdcY8=";
+    url = "mirror://gnome/sources/pygobject/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv";
   };
 
-  outputs = [ "out" "dev" ];
+  outputs = [ "out" "devdoc" ];
 
-  mesonFlags = [
-    "-Dpython=python${if isPy3k then "3" else "2" }"
+  patches = lib.optionals stdenv.isDarwin [
+    ./pygobject-2.0-fix-darwin.patch
+    (fetchpatch {
+      url = "https://github.com/macports/macports-ports/raw/f2975d5bbbc2459c661905c5a850cc661fa32f55/python/py-gobject/files/py-gobject-dynamic_lookup-11.patch";
+      sha256 = "sha256-mtlyu+La3+iC5iQAmVJzDA5E35XGaRQy/EKXzvrWRCg=";
+      extraPrefix = "";
+    })
   ];
 
-  nativeBuildInputs = [ pkg-config meson ninja gobject-introspection ];
-  buildInputs = [ glib gobject-introspection ]
-                 ++ lib.optionals stdenv.isDarwin [ which ncurses ];
-  propagatedBuildInputs = [ pycairo cairo ];
+  configureFlags = [ "--disable-introspection" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib ];
+
+  # in a "normal" setup, pygobject and pygtk are installed into the
+  # same site-packages: we need a pth file for both. pygtk.py would be
+  # used to select a specific version, in our setup it should have no
+  # effect, but we leave it in case somebody expects and calls it.
+  postInstall = lib.optionalString (!isPy3k) ''
+    mv $out/${python.sitePackages}/{pygtk.pth,${pname}-${version}.pth}
+
+    # Prevent wrapping of codegen files as these are meant to be
+    # executed by the python program
+    chmod a-x $out/share/pygobject/*/codegen/*.py
+  '';
 
   meta = with lib; {
     homepage = "https://pygobject.readthedocs.io/";
-    description = "Python bindings for Glib";
+    description = "Python bindings for GLib";
     license = licenses.gpl2;
-    maintainers = with maintainers; [ orivej ];
-    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
   };
 }
diff --git a/nixpkgs/pkgs/development/python2-modules/pygobject/pygobject-2.0-fix-darwin.patch b/nixpkgs/pkgs/development/python2-modules/pygobject/pygobject-2.0-fix-darwin.patch
new file mode 100644
index 000000000000..7fef05262f4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/python2-modules/pygobject/pygobject-2.0-fix-darwin.patch
@@ -0,0 +1,88 @@
+--- a/gio/unix-types.defs
++++ b/gio/unix-types.defs
+@@ -7,18 +7,6 @@
+   (gtype-id "G_TYPE_UNIX_CONNECTION")
+ )
+ 
+-(define-object DesktopAppInfo
+-  (docstring
+-  "DesktopAppInfo(desktop_id) -> gio.unix.DesktopAppInfo\n\n"
+-  "gio.Unix.DesktopAppInfo is an implementation of gio.AppInfo\n"
+-  "based on desktop files."
+-  )
+-  (in-module "giounix")
+-  (parent "GObject")
+-  (c-name "GDesktopAppInfo")
+-  (gtype-id "G_TYPE_DESKTOP_APP_INFO")
+-)
+-
+ (define-object FDMessage
+   (in-module "giounix")
+   (parent "GSocketControlMessage")
+--- a/gio/unix.defs
++++ b/gio/unix.defs
+@@ -32,54 +32,6 @@
+ 
+ 
+ 
+-;; From gdesktopappinfo.h
+-
+-(define-function desktop_app_info_get_type
+-  (c-name "g_desktop_app_info_get_type")
+-  (return-type "GType")
+-)
+-
+-(define-function desktop_app_info_new_from_filename
+-  (c-name "g_desktop_app_info_new_from_filename")
+-  (return-type "GDesktopAppInfo*")
+-  (parameters
+-    '("const-char*" "filename")
+-  )
+-)
+-
+-(define-function g_desktop_app_info_new_from_keyfile
+-  (c-name "g_desktop_app_info_new_from_keyfile")
+-  (return-type "GDesktopAppInfo*")
+-  (parameters
+-    '("GKeyFile*" "key_file")
+-  )
+-)
+-
+-(define-function desktop_app_info_new
+-  (c-name "g_desktop_app_info_new")
+-  (is-constructor-of "GDesktopAppInfo")
+-  (return-type "GDesktopAppInfo*")
+-  (parameters
+-    '("const-char*" "desktop_id")
+-  )
+-)
+-
+-(define-method get_is_hidden
+-  (of-object "GDesktopAppInfo")
+-  (c-name "g_desktop_app_info_get_is_hidden")
+-  (return-type "gboolean")
+-)
+-
+-(define-function desktop_app_info_set_desktop_env
+-  (c-name "g_desktop_app_info_set_desktop_env")
+-  (return-type "none")
+-  (parameters
+-    '("const-char*" "desktop_env")
+-  )
+-)
+-
+-
+-
+ ;; From gunixfdmessage.h
+ 
+ (define-function g_unix_fd_message_get_type
+--- a/gio/unix.override
++++ b/gio/unix.override
+@@ -24,7 +24,6 @@
+ #define NO_IMPORT_PYGOBJECT
+ #include <pygobject.h>
+ #include <gio/gio.h>
+-#include <gio/gdesktopappinfo.h>
+ #include <gio/gunixinputstream.h>
+ #include <gio/gunixmounts.h>
+ #include <gio/gunixoutputstream.h>
diff --git a/nixpkgs/pkgs/development/python2-modules/pygtk/default.nix b/nixpkgs/pkgs/development/python2-modules/pygtk/default.nix
index 08e1520c4c85..c3960dd5309d 100644
--- a/nixpkgs/pkgs/development/python2-modules/pygtk/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/pygtk/default.nix
@@ -5,6 +5,7 @@ buildPythonPackage rec {
   pname = "pygtk";
   outputs = [ "out" "dev" ];
   version = "2.24.0";
+  format = "other";
 
   disabled = isPy3k;
 
@@ -36,7 +37,8 @@ buildPythonPackage rec {
 
   buildPhase = "buildPhase";
 
-  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-ObjC";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-ObjC"
+    + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) " -lpython2.7";
 
   installPhase = "installPhase";
 
diff --git a/nixpkgs/pkgs/development/python2-modules/pyparsing/default.nix b/nixpkgs/pkgs/development/python2-modules/pyparsing/default.nix
index d51032a154af..5b61dc0c85b5 100644
--- a/nixpkgs/pkgs/development/python2-modules/pyparsing/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/pyparsing/default.nix
@@ -22,7 +22,7 @@ let
 
     # circular dependencies if enabled by default
     doCheck = false;
-    checkInputs = [
+    nativeCheckInputs = [
       jinja2
       railroad-diagrams
     ];
diff --git a/nixpkgs/pkgs/development/python2-modules/pyroma/default.nix b/nixpkgs/pkgs/development/python2-modules/pyroma/default.nix
deleted file mode 100644
index 9fee5ec56c0e..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/pyroma/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ lib, buildPythonPackage, fetchPypi
-, docutils, pygments, setuptools
-}:
-
-buildPythonPackage rec {
-  pname = "pyroma";
-  version = "2.6.1";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "2527423e3a24ccd56951f3ce1b0ebbcc4fa0518c82fca882e696c78726ab9c2f";
-  };
-
-  postPatch = ''
-    substituteInPlace setup.py \
-      --replace "pygments < 2.6" "pygments"
-  '';
-
-  propagatedBuildInputs = [ docutils pygments setuptools ];
-
-  meta = with lib; {
-    description = "Test your project's packaging friendliness";
-    homepage = "https://github.com/regebro/pyroma";
-    license = licenses.mit;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/pysqlite/default.nix b/nixpkgs/pkgs/development/python2-modules/pysqlite/default.nix
deleted file mode 100644
index 09cc312223ad..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/pysqlite/default.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ lib, stdenv
-, buildPythonPackage
-, fetchPypi
-, isPy3k
-, pkgs
-}:
-
-buildPythonPackage rec {
-  pname = "pysqlite";
-  version = "2.8.3";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "17d3335863e8cf8392eea71add33dab3f96d060666fe68ab7382469d307f4490";
-  };
-
-  # Need to use the builtin sqlite3 on Python 3
-  disabled = isPy3k;
-
-  # Since the `.egg' file is zipped, the `NEEDED' of the `.so' files
-  # it contains is not taken into account.  Thus, we must explicitly make
-  # it a propagated input.
-  propagatedBuildInputs = [ pkgs.sqlite ];
-
-  patchPhase = ''
-    substituteInPlace "setup.cfg"                                     \
-            --replace "/usr/local/include" "${pkgs.sqlite.dev}/include"   \
-            --replace "/usr/local/lib" "${pkgs.sqlite.out}/lib"
-    ${lib.optionalString (!stdenv.isDarwin) ''export LDSHARED="$CC -pthread -shared"''}
-  '';
-
-  meta = with lib; {
-    homepage = "https://pysqlite.org/";
-    description = "Python bindings for the SQLite embedded relational database engine";
-    longDescription = ''
-      pysqlite is a DB-API 2.0-compliant database interface for SQLite.
-
-      SQLite is a relational database management system contained in
-      a relatively small C library.  It is a public domain project
-      created by D. Richard Hipp.  Unlike the usual client-server
-      paradigm, the SQLite engine is not a standalone process with
-      which the program communicates, but is linked in and thus
-      becomes an integral part of the program.  The library
-      implements most of SQL-92 standard, including transactions,
-      triggers and most of complex queries.
-
-      pysqlite makes this powerful embedded SQL engine available to
-      Python programmers.  It stays compatible with the Python
-      database API specification 2.0 as much as possible, but also
-      exposes most of SQLite's native API, so that it is for example
-      possible to create user-defined SQL functions and aggregates
-      in Python.
-    '';
-    license = licenses.bsd3;
-  };
-
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/pytest-runner/default.nix b/nixpkgs/pkgs/development/python2-modules/pytest-runner/default.nix
deleted file mode 100644
index bea83146c37d..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/pytest-runner/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ lib, buildPythonPackage, fetchPypi, setuptools-scm, pytest }:
-
-buildPythonPackage rec {
-  pname = "pytest-runner";
-  version = "5.2";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "96c7e73ead7b93e388c5d614770d2bae6526efd997757d3543fe17b557a0942b";
-  };
-
-  nativeBuildInputs = [ setuptools-scm pytest ];
-
-  postPatch = ''
-    rm pytest.ini
-  '';
-
-  checkPhase = ''
-    py.test tests
-  '';
-
-  # Fixture not found
-  doCheck = false;
-
-  meta = with lib; {
-    description = "Invoke py.test as distutils command with dependency resolution";
-    homepage = "https://github.com/pytest-dev/pytest-runner";
-    license = licenses.mit;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/pytest-xdist/default.nix b/nixpkgs/pkgs/development/python2-modules/pytest-xdist/default.nix
index 466d86f50f78..5da424a0c302 100644
--- a/nixpkgs/pkgs/development/python2-modules/pytest-xdist/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/pytest-xdist/default.nix
@@ -11,7 +11,7 @@ buildPythonPackage rec {
   };
 
   nativeBuildInputs = [ setuptools-scm pytest ];
-  checkInputs = [ pytest filelock ];
+  nativeCheckInputs = [ pytest filelock ];
   propagatedBuildInputs = [ execnet pytest-forked psutil six ];
 
   # Encountered a memory leak
diff --git a/nixpkgs/pkgs/development/python2-modules/pytest/default.nix b/nixpkgs/pkgs/development/python2-modules/pytest/default.nix
index 0a0ae571ba01..0edfd3039112 100644
--- a/nixpkgs/pkgs/development/python2-modules/pytest/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/pytest/default.nix
@@ -16,7 +16,7 @@ buildPythonPackage rec {
       --replace "pluggy>=0.12,<1.0" "pluggy>=0.12,<2.0"
   '';
 
-  checkInputs = [ hypothesis mock ];
+  nativeCheckInputs = [ hypothesis mock ];
   buildInputs = [ setuptools-scm ];
   propagatedBuildInputs = [ attrs py setuptools six pluggy more-itertools atomicwrites wcwidth packaging ]
     ++ lib.optionals (!isPy3k) [ funcsigs ]
diff --git a/nixpkgs/pkgs/development/python2-modules/pyyaml/default.nix b/nixpkgs/pkgs/development/python2-modules/pyyaml/default.nix
deleted file mode 100644
index 3edfae90e668..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/pyyaml/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
-, cython
-, libyaml
-, isPy27
-, python
-}:
-
-buildPythonPackage rec {
-  pname = "PyYAML";
-  version = "5.4.1.1";
-
-  src = fetchFromGitHub {
-    owner = "yaml";
-    repo = "pyyaml";
-    rev = version;
-    sha256 = "1v386gzdvsjg0mgix6v03rd0cgs9dl81qvn3m547849jm8r41dx8";
-  };
-
-  nativeBuildInputs = [ cython ];
-
-  buildInputs = [ libyaml ];
-
-  checkPhase = ''
-    runHook preCheck
-    PYTHONPATH=""tests/lib":$PYTHONPATH" ${python.interpreter} -m test_all
-    runHook postCheck
-  '';
-
-  pythonImportsCheck = [ "yaml" ];
-
-  meta = with lib; {
-    description = "The next generation YAML parser and emitter for Python";
-    homepage = "https://github.com/yaml/pyyaml";
-    license = licenses.mit;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/qpid-python/default.nix b/nixpkgs/pkgs/development/python2-modules/qpid-python/default.nix
deleted file mode 100644
index e22b3215e81f..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/qpid-python/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchurl
-, isPy3k
-}:
-
-buildPythonPackage rec {
-  pname = "qpid-python";
-  version = "0.32";
-  disabled = isPy3k;
-
-  src = fetchurl {
-    url = "http://www.us.apache.org/dist/qpid/${version}/${pname}-${version}.tar.gz";
-    sha256 = "09hdfjgk8z4s3dr8ym2r6xn97j1f9mkb2743pr6zd0bnj01vhsv4";
-  };
-
-  # needs a broker running and then ./qpid-python-test
-  doCheck = false;
-
-  meta = with lib; {
-    homepage = "https://qpid.apache.org/";
-    description = "Python client implementation and AMQP conformance tests for Apache Qpid";
-    license = licenses.asl20;
-  };
-
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/s3transfer/default.nix b/nixpkgs/pkgs/development/python2-modules/s3transfer/default.nix
deleted file mode 100644
index 8cfd324f00a5..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/s3transfer/default.nix
+++ /dev/null
@@ -1,52 +0,0 @@
-{ lib
-, fetchPypi
-, pythonOlder
-, buildPythonPackage
-, docutils
-, mock
-, nose
-, coverage
-, wheel
-, unittest2
-, botocore
-, futures ? null
-}:
-
-buildPythonPackage rec {
-  pname = "s3transfer";
-  version = "0.4.2";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "sha256-ywIvSxZVHt67sxo3fT8JYA262nNj2MXbeXbn9Hcy4bI=";
-  };
-
-  propagatedBuildInputs =
-    [
-      botocore
-    ] ++ lib.optional (pythonOlder "3") futures;
-
-  buildInputs = [
-    docutils
-    mock
-    nose
-    coverage
-    wheel
-    unittest2
-  ];
-
-  checkPhase = ''
-    pushd s3transfer/tests
-    nosetests -v unit/ functional/
-    popd
-  '';
-
-  # version on pypi has no tests/ dir
-  doCheck = false;
-
-  meta = with lib; {
-    homepage = "https://github.com/boto/s3transfer";
-    license = licenses.asl20;
-    description = "A library for managing Amazon S3 transfers";
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/scandir/add-aarch64-darwin-dirent.patch b/nixpkgs/pkgs/development/python2-modules/scandir/add-aarch64-darwin-dirent.patch
new file mode 100644
index 000000000000..1b35a0b950ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/python2-modules/scandir/add-aarch64-darwin-dirent.patch
@@ -0,0 +1,28 @@
+diff --git a/scandir.py b/scandir.py
+index 3f602fb..40af3e5 100644
+--- a/scandir.py
++++ b/scandir.py
+@@ -23,6 +23,7 @@ from os import listdir, lstat, stat, strerror
+ from os.path import join, islink
+ from stat import S_IFDIR, S_IFLNK, S_IFREG
+ import collections
++import platform
+ import sys
+ 
+ try:
+@@ -432,6 +433,15 @@ elif sys.platform.startswith(('linux', 'darwin', 'sunos5')) or 'bsd' in sys.plat
+                     ('__d_padding', ctypes.c_uint8 * 4),
+                     ('d_name', ctypes.c_char * 256),
+                 )
++            elif 'darwin' in sys.platform and 'arm64' in platform.machine():
++                _fields_ = (
++                    ('d_ino', ctypes.c_uint64),
++                    ('d_off', ctypes.c_uint64),
++                    ('d_reclen', ctypes.c_uint16),
++                    ('d_namlen', ctypes.c_uint16),
++                    ('d_type', ctypes.c_uint8),
++                    ('d_name', ctypes.c_char * 1024),
++                )
+             else:
+                 _fields_ = (
+                     ('d_ino', ctypes.c_uint32),  # must be uint32, not ulong
diff --git a/nixpkgs/pkgs/development/python2-modules/scandir/default.nix b/nixpkgs/pkgs/development/python2-modules/scandir/default.nix
index f92b1f5a6ed7..e712cca8348d 100644
--- a/nixpkgs/pkgs/development/python2-modules/scandir/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/scandir/default.nix
@@ -6,9 +6,13 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 ="1bkqwmf056pkchf05ywbnf659wqlp6lljcdb0y88wr9f0vv32ijd";
+    sha256 = "1bkqwmf056pkchf05ywbnf659wqlp6lljcdb0y88wr9f0vv32ijd";
   };
 
+  patches = [
+    ./add-aarch64-darwin-dirent.patch
+  ];
+
   checkPhase = "${python.interpreter} test/run_tests.py";
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/development/python2-modules/sphinx/default.nix b/nixpkgs/pkgs/development/python2-modules/sphinx/default.nix
deleted file mode 100644
index 80dec0531085..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/sphinx/default.nix
+++ /dev/null
@@ -1,82 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, pytest
-, simplejson
-, mock
-, glibcLocales
-, html5lib
-, pythonOlder
-, enum34
-, python
-, docutils
-, jinja2
-, pygments
-, alabaster
-, babel
-, snowballstemmer
-, six
-, sqlalchemy
-, whoosh
-, imagesize
-, requests
-, typing
-, sphinxcontrib-websupport
-, setuptools
-}:
-
-buildPythonPackage rec {
-  pname = "sphinx";
-  version = "1.8.5";
-  src = fetchPypi {
-    pname = "Sphinx";
-    inherit version;
-    sha256 = "c7658aab75c920288a8cf6f09f244c6cfdae30d82d803ac1634d9f223a80ca08";
-  };
-  LC_ALL = "en_US.UTF-8";
-
-  checkInputs = [ pytest ];
-  buildInputs = [ simplejson mock glibcLocales html5lib ] ++ lib.optional (pythonOlder "3.4") enum34;
-  # Disable two tests that require network access.
-  checkPhase = ''
-    cd tests; ${python.interpreter} run.py --ignore py35 -k 'not test_defaults and not test_anchors_ignored'
-  '';
-  propagatedBuildInputs = [
-    docutils
-    jinja2
-    pygments
-    alabaster
-    babel
-    setuptools
-    snowballstemmer
-    six
-    sphinxcontrib-websupport
-    sqlalchemy
-    whoosh
-    imagesize
-    requests
-  ] ++ lib.optional (pythonOlder "3.5") typing;
-
-  # Lots of tests. Needs network as well at some point.
-  doCheck = false;
-
-  patches = [
-    # Since pygments 2.5, PythonLexer refers to python3. If we want to use
-    # python2, we need to explicitly specify Python2Lexer.
-    # Not upstreamed since there doesn't seem to be any upstream maintenance
-    # branch for 1.8 (and this patch doesn't make any sense for 2.x).
-    ./python2-lexer.patch
-  ];
-  # https://github.com/NixOS/nixpkgs/issues/22501
-  # Do not run `python sphinx-build arguments` but `sphinx-build arguments`.
-  postPatch = ''
-    substituteInPlace sphinx/make_mode.py --replace "sys.executable, " ""
-  '';
-
-  meta = {
-    description = "A tool that makes it easy to create intelligent and beautiful documentation for Python projects";
-    homepage = "http://sphinx.pocoo.org/";
-    license = lib.licenses.bsd3;
-    maintainers = with lib.maintainers; [ ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/sphinx/python2-lexer.patch b/nixpkgs/pkgs/development/python2-modules/sphinx/python2-lexer.patch
deleted file mode 100644
index cf4a243315a2..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/sphinx/python2-lexer.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
-index ac2bd1b06..63ca52de2 100644
---- a/sphinx/highlighting.py
-+++ b/sphinx/highlighting.py
-@@ -16,7 +16,7 @@ from pygments.filters import ErrorToken
- from pygments.formatters import HtmlFormatter, LatexFormatter
- from pygments.lexer import Lexer  # NOQA
- from pygments.lexers import get_lexer_by_name, guess_lexer
--from pygments.lexers import PythonLexer, Python3Lexer, PythonConsoleLexer, \
-+from pygments.lexers import Python2Lexer, Python3Lexer, PythonConsoleLexer, \
-     CLexer, TextLexer, RstLexer
- from pygments.styles import get_style_by_name
- from pygments.util import ClassNotFound
-@@ -40,7 +40,7 @@ logger = logging.getLogger(__name__)
- 
- lexers = dict(
-     none = TextLexer(stripnl=False),
--    python = PythonLexer(stripnl=False),
-+    python = Python2Lexer(stripnl=False),
-     python3 = Python3Lexer(stripnl=False),
-     pycon = PythonConsoleLexer(stripnl=False),
-     pycon3 = PythonConsoleLexer(python3=True, stripnl=False),
diff --git a/nixpkgs/pkgs/development/python2-modules/sphinxcontrib-websupport/default.nix b/nixpkgs/pkgs/development/python2-modules/sphinxcontrib-websupport/default.nix
deleted file mode 100644
index b1bdf6a0dff6..000000000000
--- a/nixpkgs/pkgs/development/python2-modules/sphinxcontrib-websupport/default.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, six
-}:
-
-buildPythonPackage rec {
-  pname = "sphinxcontrib-websupport";
-  version = "1.1.2";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "1501befb0fdf1d1c29a800fdbf4ef5dc5369377300ddbdd16d2cd40e54c6eefc";
-  };
-
-  propagatedBuildInputs = [ six ];
-
-  doCheck = false;
-
-  meta = {
-    description = "Sphinx API for Web Apps";
-    homepage = "http://sphinx-doc.org/";
-    license = lib.licenses.bsd2;
-  };
-}
diff --git a/nixpkgs/pkgs/development/python2-modules/typing/default.nix b/nixpkgs/pkgs/development/python2-modules/typing/default.nix
index b3dcea203231..b8c143cbd537 100644
--- a/nixpkgs/pkgs/development/python2-modules/typing/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/typing/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildPythonPackage, fetchPypi, pythonOlder, isPy3k, isPyPy, python
+{ lib, buildPythonPackage, fetchPypi, pythonOlder, isPy3k, isPyPy, unittestCheckHook
 , pythonAtLeast }:
 
 let
@@ -20,10 +20,9 @@ in buildPythonPackage rec {
   # Also, don't bother on PyPy: AssertionError: TypeError not raised
   doCheck = pythonOlder "3.6" && !isPyPy;
 
-  checkPhase = ''
-    cd ${testDir}
-    ${python.interpreter} -m unittest discover
-  '';
+  nativeCheckInputs = [ unittestCheckHook ];
+
+  unittestFlagsArray = [ "-s" testDir ];
 
   meta = with lib; {
     description = "Backport of typing module to Python versions older than 3.5";
diff --git a/nixpkgs/pkgs/development/python2-modules/wheel/0001-tests-Rename-a-a-o-_-.py-_-.py.patch b/nixpkgs/pkgs/development/python2-modules/wheel/0001-tests-Rename-a-a-o-_-.py-_-.py.patch
new file mode 100644
index 000000000000..93db54b0c6e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/python2-modules/wheel/0001-tests-Rename-a-a-o-_-.py-_-.py.patch
@@ -0,0 +1,37 @@
+From 5879a4bbc34d1eb25e160b15b2f5a4f10eac6bd2 Mon Sep 17 00:00:00 2001
+From: toonn <toonn@toonn.io>
+Date: Mon, 13 Sep 2021 18:07:26 +0200
+Subject: [PATCH] =?UTF-8?q?tests:=20Rename=20a=CC=8Aa=CC=88o=CC=88=5F?=
+ =?UTF-8?q?=E6=97=A5=E6=9C=AC=E8=AA=9E.py=20=3D>=20=C3=A6=C9=90=C3=B8=5F?=
+ =?UTF-8?q?=E6=97=A5=E6=9C=AC=E5=83=B9.py?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+`åäö_日本語.py` normalizes differently in NFC and NFD normal forms. This
+means a hash generated for the source directory can differ depending on
+whether or not the filesystem is normalizing and which normal form it
+uses.
+
+By renaming the file to `æɐø_日本價.py` we avoid this issue by using a
+name that has the same encoding in each normal form.
+---
+ tests/test_bdist_wheel.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py
+index 651c034..9b94ac8 100644
+--- a/tests/test_bdist_wheel.py
++++ b/tests/test_bdist_wheel.py
+@@ -58,7 +58,7 @@ def test_unicode_record(wheel_paths):
+     with ZipFile(path) as zf:
+         record = zf.read('unicode.dist-0.1.dist-info/RECORD')
+ 
+-    assert u'åäö_日本語.py'.encode('utf-8') in record
++    assert u'æɐø_日本價.py'.encode('utf-8') in record
+ 
+ 
+ def test_licenses_default(dummy_dist, monkeypatch, tmpdir):
+-- 
+2.17.2 (Apple Git-113)
+
diff --git a/nixpkgs/pkgs/development/python2-modules/wheel/default.nix b/nixpkgs/pkgs/development/python2-modules/wheel/default.nix
new file mode 100644
index 000000000000..8735a37b21ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/python2-modules/wheel/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, bootstrapped-pip
+, setuptools
+}:
+
+buildPythonPackage rec {
+  pname = "wheel";
+  version = "0.37.1";
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "pypa";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-JlTmUPY3yo/uROyd3nW1dJa23zbLhgQTwcmqZkPOrHs=";
+    name = "${pname}-${version}-source";
+    postFetch = ''
+      cd $out
+      mv tests/testdata/unicode.dist/unicodedist/åäö_日本語.py \
+        tests/testdata/unicode.dist/unicodedist/æɐø_日本價.py
+      patch -p1 < ${./0001-tests-Rename-a-a-o-_-.py-_-.py.patch}
+    '';
+  };
+
+  nativeBuildInputs = [
+    bootstrapped-pip
+    setuptools
+  ];
+
+  # No tests in archive
+  doCheck = false;
+  pythonImportsCheck = [ "wheel" ];
+
+  # We add this flag to ignore the copy installed by bootstrapped-pip
+  pipInstallFlags = [ "--ignore-installed" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/pypa/wheel";
+    description = "A built-package format for Python";
+    longDescription = ''
+      This library is the reference implementation of the Python wheel packaging standard,
+      as defined in PEP 427.
+
+      It has two different roles:
+
+      - A setuptools extension for building wheels that provides the bdist_wheel setuptools command
+      - A command line tool for working with wheel files
+
+      It should be noted that wheel is not intended to be used as a library,
+      and as such there is no stable, public API.
+    '';
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ siriobalmelli ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/python2-modules/zipp/default.nix b/nixpkgs/pkgs/development/python2-modules/zipp/default.nix
index 82f100aaa0d1..c256ed4f7ada 100644
--- a/nixpkgs/pkgs/development/python2-modules/zipp/default.nix
+++ b/nixpkgs/pkgs/development/python2-modules/zipp/default.nix
@@ -20,7 +20,7 @@ buildPythonPackage rec {
 
   propagatedBuildInputs = [ more-itertools ];
 
-  checkInputs = [ pytest pytest-flake8 ];
+  nativeCheckInputs = [ pytest pytest-flake8 ];
 
   checkPhase = ''
     pytest