Skip to content

Commit

Permalink
Merge pull request #328379 from dotlambda/python3Packages.standard-di…
Browse files Browse the repository at this point in the history
…stutils

python312Packages.distutils: init at 0.70.0
  • Loading branch information
dotlambda authored Jul 22, 2024
2 parents de02e64 + 3dbc32f commit 79ba441
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 15 deletions.
16 changes: 8 additions & 8 deletions pkgs/development/python-modules/distorm3/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
lib,
buildPythonPackage,
distutils,
fetchFromGitHub,
pythonAtLeast,
pythonOlder,
pytestCheckHook,
setuptools,
Expand All @@ -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";
Expand All @@ -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" ];

Expand Down
54 changes: 54 additions & 0 deletions pkgs/development/python-modules/distutils/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
48 changes: 48 additions & 0 deletions pkgs/development/python-modules/jaraco-envs/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
34 changes: 34 additions & 0 deletions pkgs/development/python-modules/jaraco-path/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
9 changes: 6 additions & 3 deletions pkgs/development/python-modules/python-ldap/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
stdenv,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
pythonOlder,

# build-system
distutils,
setuptools,

# native dependencies
Expand All @@ -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";
Expand All @@ -35,7 +35,10 @@ buildPythonPackage rec {
hash = "sha256-v1cWoRGxbvvFnHqnwoIfmiQQcxfaA8Bf3+M5bE5PtuU=";
};

build-system = [ setuptools ];
build-system = [
distutils
setuptools
];

buildInputs = [
openldap
Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/python-modules/setuptools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
stdenv,
lib,
buildPythonPackage,
distutils,
fetchFromGitHub,
python,
wheel,
Expand Down Expand Up @@ -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";
Expand Down
10 changes: 6 additions & 4 deletions pkgs/development/python-modules/thrift/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
lib,
buildPythonPackage,
distutils,
fetchPypi,
pythonAtLeast,
pythonOlder,
setuptools,
six,
Expand All @@ -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 ];

Expand Down
6 changes: 6 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 { };
Expand All @@ -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 { };
Expand Down

0 comments on commit 79ba441

Please sign in to comment.