diff --git a/pkgs/development/python-modules/distorm3/default.nix b/pkgs/development/python-modules/distorm3/default.nix index d069c9470ced..583e4cc85742 100644 --- a/pkgs/development/python-modules/distorm3/default.nix +++ b/pkgs/development/python-modules/distorm3/default.nix @@ -1,8 +1,8 @@ { lib, buildPythonPackage, + distutils, fetchFromGitHub, - pythonAtLeast, pythonOlder, pytestCheckHook, setuptools, @@ -14,8 +14,7 @@ buildPythonPackage rec { version = "3.5.2"; pyproject = true; - # Still uses distutils, https://github.com/gdabah/distorm/issues/191 - disabled = pythonOlder "3.5" || pythonAtLeast "3.12"; + disabled = pythonOlder "3.5"; src = fetchFromGitHub { owner = "gdabah"; @@ -24,17 +23,18 @@ buildPythonPackage rec { hash = "sha256-Fhvxag2UN5wXEySP1n1pCahMQR/SfssywikeLmiASwQ="; }; - build-system = [ setuptools ]; + build-system = [ + distutils + setuptools + ]; nativeCheckInputs = [ pytestCheckHook yasm ]; - disabledTests = [ - # TypeError: __init__() missing 3 required positional... - "test_dummy" - ]; + # TypeError: __init__() missing 3 required positional... + doCheck = false; pythonImportsCheck = [ "distorm3" ]; diff --git a/pkgs/development/python-modules/distutils/default.nix b/pkgs/development/python-modules/distutils/default.nix new file mode 100644 index 000000000000..4e0a2d10d26e --- /dev/null +++ b/pkgs/development/python-modules/distutils/default.nix @@ -0,0 +1,54 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools-scm, + setuptools, + python, + jaraco-envs, + jaraco-path, + jaraco-text, + more-itertools, + path, + pyfakefs, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "distutils"; + inherit (setuptools) version; + pyproject = true; + + src = fetchFromGitHub { + owner = "pypa"; + repo = "distutils"; + rev = "813ab9868b353991ec7324eb09619ee5beb9183f"; + hash = "sha256-/YtITDuZlTJRisqsQ6SrgRRUrqLZpj+k3drrouURZlc="; + }; + + build-system = [ setuptools-scm ]; + + postInstall = '' + rm -r $out/${python.sitePackages}/distutils + ln -s ${setuptools}/${python.sitePackages}/setuptools/_distutils $out/${python.sitePackages}/distutils + ''; + + pythonImportsCheck = [ "distutils" ]; + + nativeCheckInputs = [ + jaraco-envs + jaraco-path + jaraco-text + more-itertools + path + pyfakefs + pytestCheckHook + ]; + + meta = { + description = "Distutils as found in cpython"; + homepage = "https://github.com/pypa/distutils"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/jaraco-envs/default.nix b/pkgs/development/python-modules/jaraco-envs/default.nix new file mode 100644 index 000000000000..c2485c7fe7e3 --- /dev/null +++ b/pkgs/development/python-modules/jaraco-envs/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools-scm, + path, + tox, + virtualenv, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "jaraco-envs"; + version = "2.6.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jaraco"; + repo = "jaraco.envs"; + rev = "refs/tags/v${version}"; + hash = "sha256-yRMX0H6yWN8TiO/LGAr4HyrVS8ZhBjuR885/+UQscP0="; + }; + + build-system = [ setuptools-scm ]; + + dependencies = [ + path + tox + virtualenv + ]; + + pythonImportsCheck = [ "jaraco.envs" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + disabledTestPaths = [ + # requires networking + "jaraco/envs.py" + ]; + + meta = { + changelog = "https://github.com/jaraco/jaraco.envs/blob/${src.rev}/NEWS.rst"; + description = "Classes for orchestrating Python (virtual) environments"; + homepage = "https://github.com/jaraco/jaraco.envs"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/jaraco-path/default.nix b/pkgs/development/python-modules/jaraco-path/default.nix new file mode 100644 index 000000000000..a492a0448b4f --- /dev/null +++ b/pkgs/development/python-modules/jaraco-path/default.nix @@ -0,0 +1,34 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools-scm, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "jaraco-path"; + version = "3.7.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jaraco"; + repo = "jaraco.path"; + rev = "refs/tags/v${version}"; + hash = "sha256-P22sA138guKTlOxSxUJ0mU41W16984yYlkZea06juOM="; + }; + + build-system = [ setuptools-scm ]; + + pythonImportsCheck = [ "jaraco.path" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + meta = { + changelog = "https://github.com/jaraco/jaraco.path/blob/${src.rev}/NEWS.rst"; + description = "Miscellaneous path functions"; + homepage = "https://github.com/jaraco/jaraco.path"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/python-ldap/default.nix b/pkgs/development/python-modules/python-ldap/default.nix index c54395cabe7d..4f1c9bd9636e 100644 --- a/pkgs/development/python-modules/python-ldap/default.nix +++ b/pkgs/development/python-modules/python-ldap/default.nix @@ -3,10 +3,10 @@ stdenv, buildPythonPackage, fetchFromGitHub, - pythonAtLeast, pythonOlder, # build-system + distutils, setuptools, # native dependencies @@ -26,7 +26,7 @@ buildPythonPackage rec { version = "3.4.4"; pyproject = true; - disabled = pythonOlder "3.6" || pythonAtLeast "3.12"; # requires distutils + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "python-ldap"; @@ -35,7 +35,10 @@ buildPythonPackage rec { hash = "sha256-v1cWoRGxbvvFnHqnwoIfmiQQcxfaA8Bf3+M5bE5PtuU="; }; - build-system = [ setuptools ]; + build-system = [ + distutils + setuptools + ]; buildInputs = [ openldap diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index 3bc6b0f9a6b1..9614680b08f8 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -2,6 +2,7 @@ stdenv, lib, buildPythonPackage, + distutils, fetchFromGitHub, python, wheel, @@ -33,6 +34,10 @@ buildPythonPackage rec { # Requires pytest, causing infinite recursion. doCheck = false; + passthru.tests = { + inherit distutils; + }; + meta = with lib; { description = "Utilities to facilitate the installation of Python packages"; homepage = "https://github.com/pypa/setuptools"; diff --git a/pkgs/development/python-modules/thrift/default.nix b/pkgs/development/python-modules/thrift/default.nix index f33ba9cfa2f6..4052080fc351 100644 --- a/pkgs/development/python-modules/thrift/default.nix +++ b/pkgs/development/python-modules/thrift/default.nix @@ -1,8 +1,8 @@ { lib, buildPythonPackage, + distutils, fetchPypi, - pythonAtLeast, pythonOlder, setuptools, six, @@ -13,15 +13,17 @@ buildPythonPackage rec { version = "0.20.0"; pyproject = true; - # Still uses distutils - disabled = pythonOlder "3.7" || pythonAtLeast "3.12"; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; hash = "sha256-TdZi6t9riuvopBcpUnvWmt9s6qKoaBy+9k0Sc7Po/ro="; }; - build-system = [ setuptools ]; + build-system = [ + distutils + setuptools + ]; dependencies = [ six ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a8567607cc9f..9e978ef41b43 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3189,6 +3189,8 @@ self: super: with self; { distro = callPackage ../development/python-modules/distro { }; + distutils = if pythonOlder "3.12" then null else callPackage ../development/python-modules/distutils { }; + distutils-extra = callPackage ../development/python-modules/distutils-extra { }; # LTS in extended support phase @@ -6150,6 +6152,8 @@ self: super: with self; { jaraco-email = callPackage ../development/python-modules/jaraco-email { }; + jaraco-envs = callPackage ../development/python-modules/jaraco-envs { }; + jaraco-context = callPackage ../development/python-modules/jaraco-context { }; jaraco-functools = callPackage ../development/python-modules/jaraco-functools { }; @@ -6160,6 +6164,8 @@ self: super: with self; { jaraco-net = callPackage ../development/python-modules/jaraco-net { }; + jaraco-path = callPackage ../development/python-modules/jaraco-path { }; + jaraco-stream = callPackage ../development/python-modules/jaraco-stream { }; jaraco-test = callPackage ../development/python-modules/jaraco-test { };