1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 distutils,
6 fetchFromGitHub,
7 python,
8 wheel,
9}:
10
11buildPythonPackage rec {
12 pname = "setuptools";
13 version = "70.0.0";
14 format = "pyproject";
15
16 src = fetchFromGitHub {
17 owner = "pypa";
18 repo = "setuptools";
19 rev = "refs/tags/v${version}";
20 hash = "sha256-LXF3R9zfWylvihP2M8N94/IlgifwxUwKJFhtvcXEPB0=";
21 };
22
23 patches = [
24 ./tag-date.patch
25 ./setuptools-distutils-C++.patch
26 ];
27
28 nativeBuildInputs = [ wheel ];
29
30 preBuild = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
31 export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
32 '';
33
34 # Requires pytest, causing infinite recursion.
35 doCheck = false;
36
37 passthru.tests = {
38 inherit distutils;
39 };
40
41 meta = with lib; {
42 description = "Utilities to facilitate the installation of Python packages";
43 homepage = "https://github.com/pypa/setuptools";
44 changelog = "https://setuptools.pypa.io/en/stable/history.html#v${
45 replaceStrings [ "." ] [ "-" ] version
46 }";
47 license = with licenses; [ mit ];
48 platforms = python.meta.platforms;
49 maintainers = teams.python.members;
50 };
51}