forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python310Packages.setuptools: init at 50.3.0
- Loading branch information
Showing
2 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ stdenv | ||
, buildPythonPackage | ||
, fetchFromGitHub | ||
, python | ||
, wrapPython | ||
, unzip | ||
, callPackage | ||
, bootstrapped-pip | ||
, lib | ||
, pipInstallHook | ||
, setuptoolsBuildHook | ||
}: | ||
|
||
let | ||
pname = "setuptools"; | ||
version = "50.3.0"; | ||
|
||
# Create an sdist of setuptools | ||
sdist = stdenv.mkDerivation rec { | ||
name = "${pname}-${version}-sdist.tar.gz"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "pypa"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
sha256 = "0vsj6l8s7wrk7ily08fbqkixrig6sd6j86jwhq31hlkmllmmar60"; | ||
name = "${pname}-${version}-source"; | ||
}; | ||
|
||
buildPhase = '' | ||
${python.pythonForBuild.interpreter} bootstrap.py | ||
${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar | ||
''; | ||
|
||
installPhase = '' | ||
echo "Moving sdist..." | ||
mv dist/*.tar.gz $out | ||
''; | ||
}; | ||
in buildPythonPackage rec { | ||
inherit pname version; | ||
# Because of bootstrapping we don't use the setuptoolsBuildHook that comes with format="setuptools" directly. | ||
# Instead, we override it to remove setuptools to avoid a circular dependency. | ||
# The same is done for pip and the pipInstallHook. | ||
format = "other"; | ||
|
||
src = sdist; | ||
|
||
nativeBuildInputs = [ | ||
bootstrapped-pip | ||
(pipInstallHook.override{pip=null;}) | ||
(setuptoolsBuildHook.override{setuptools=null; wheel=null;}) | ||
]; | ||
|
||
preBuild = lib.strings.optionalString (!stdenv.hostPlatform.isWindows) '' | ||
export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0 | ||
''; | ||
|
||
pipInstallFlags = [ "--ignore-installed" ]; | ||
|
||
# Adds setuptools to nativeBuildInputs causing infinite recursion. | ||
catchConflicts = false; | ||
|
||
# Requires pytest, causing infinite recursion. | ||
doCheck = false; | ||
|
||
meta = with stdenv.lib; { | ||
description = "Utilities to facilitate the installation of Python packages"; | ||
homepage = "https://pypi.python.org/pypi/setuptools"; | ||
license = with licenses; [ psfl zpl20 ]; | ||
platforms = python.meta.platforms; | ||
priority = 10; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters