Skip to content

Instantly share code, notes, and snippets.

@JonathanReeve
Created January 5, 2020 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathanReeve/8b19afeaccb8e968c58d98431ce7381f to your computer and use it in GitHub Desktop.
Save JonathanReeve/8b19afeaccb8e968c58d98431ce7381f to your computer and use it in GitHub Desktop.
pypi2nix output for colormath
# generated using pypi2nix tool (version: 2.0.2)
# See more at: https://github.com/nix-community/pypi2nix
#
# COMMAND:
# pypi2nix -V python3 -e colormath
#
{ pkgs ? import <nixpkgs> {},
overrides ? ({ pkgs, python }: self: super: {})
}:
let
inherit (pkgs) makeWrapper;
inherit (pkgs.stdenv.lib) fix' extends inNixShell;
pythonPackages =
import "${toString pkgs.path}/pkgs/top-level/python-packages.nix" {
inherit pkgs;
inherit (pkgs) stdenv;
python = pkgs.python3;
};
commonBuildInputs = [];
commonDoCheck = false;
withPackages = pkgs':
let
pkgs = builtins.removeAttrs pkgs' ["__unfix__"];
interpreterWithPackages = selectPkgsFn: pythonPackages.buildPythonPackage {
name = "python3-interpreter";
buildInputs = [ makeWrapper ] ++ (selectPkgsFn pkgs);
buildCommand = ''
mkdir -p $out/bin
ln -s ${pythonPackages.python.interpreter} \
$out/bin/${pythonPackages.python.executable}
for dep in ${builtins.concatStringsSep " "
(selectPkgsFn pkgs)}; do
if [ -d "$dep/bin" ]; then
for prog in "$dep/bin/"*; do
if [ -x "$prog" ] && [ -f "$prog" ]; then
ln -s $prog $out/bin/`basename $prog`
fi
done
fi
done
for prog in "$out/bin/"*; do
wrapProgram "$prog" --prefix PYTHONPATH : "$PYTHONPATH"
done
pushd $out/bin
ln -s ${pythonPackages.python.executable} python
ln -s ${pythonPackages.python.executable} \
python3
popd
'';
passthru.interpreter = pythonPackages.python;
};
interpreter = interpreterWithPackages builtins.attrValues;
in {
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = args: pythonPackages.buildPythonPackage (args // {
nativeBuildInputs = (args.nativeBuildInputs or []) ++ args.buildInputs;
});
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
drv.drvAttrs // f drv.drvAttrs // { meta = drv.meta; }
);
withPackages = pkgs'':
withPackages (pkgs // pkgs'');
};
python = withPackages {};
generated = self: {
"colormath" = python.mkDerivation {
name = "colormath-3.0.0";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/ce/cf/70ea34103a76cc6fb1892289bda321cd0cc73b1a5500ee7fe9ef9f64acef/colormath-3.0.0.tar.gz";
sha256 = "3d4605af344527da0e4f9f504fad7ddbebda35322c566a6c72e28edb1ff31217";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [
self."networkx"
self."numpy"
];
meta = with pkgs.stdenv.lib; {
homepage = "https://github.com/gtaylor/python-colormath";
license = licenses.bsdOriginal;
description = "Color math and conversion library.";
};
};
"cython" = python.mkDerivation {
name = "cython-0.29.14";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/9c/9b/706dac7338c2860cd063a28cdbf5e9670995eaea408abbf2e88ba070d90d/Cython-0.29.14.tar.gz";
sha256 = "e4d6bb8703d0319eb04b7319b12ea41580df44fd84d83ccda13ea463c6801414";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "http://cython.org/";
license = licenses.asl20;
description = "The Cython compiler for writing C extensions for the Python language.";
};
};
"decorator" = python.mkDerivation {
name = "decorator-4.4.1";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/dc/c3/9d378af09f5737cfd524b844cd2fbb0d2263a35c11d712043daab290144d/decorator-4.4.1.tar.gz";
sha256 = "54c38050039232e1db4ad7375cfce6748d7b41c29e95a081c8a6d2c30364a2ce";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://github.com/micheles/decorator";
license = licenses.bsdOriginal;
description = "Decorators for Humans";
};
};
"networkx" = python.mkDerivation {
name = "networkx-2.4";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/bf/63/7b579dd3b1c49ce6b7fd8f6f864038f255201410905dd183cf7f4a3845cf/networkx-2.4.tar.gz";
sha256 = "f8f4ff0b6f96e4f9b16af6b84622597b5334bf9cae8cf9b2e42e7985d5c95c64";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [
self."decorator"
];
meta = with pkgs.stdenv.lib; {
homepage = "http://networkx.github.io/";
license = licenses.bsdOriginal;
description = "Python package for creating and manipulating graphs and networks";
};
};
"numpy" = python.mkDerivation {
name = "numpy-1.18.0";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/31/0a/5df350c29a06835d534a6c4f5681075304da38d85f1c69e5226a635a67ce/numpy-1.18.0.zip";
sha256 = "a9d72d9abaf65628f0f31bbb573b7d9304e43b1e6bbae43149c17737a42764c4";
};
doCheck = commonDoCheck;
format = "pyproject";
buildInputs = commonBuildInputs ++ [
self."cython"
self."setuptools"
self."wheel"
];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://www.numpy.org";
license = licenses.bsdOriginal;
description = "NumPy is the fundamental package for array computing with Python.";
};
};
"setuptools" = python.mkDerivation {
name = "setuptools-44.0.0";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/b0/f3/44da7482ac6da3f36f68e253cb04de37365b3dba9036a3c70773b778b485/setuptools-44.0.0.zip";
sha256 = "e5baf7723e5bb8382fc146e33032b241efc63314211a3a120aaa55d62d2bb008";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://github.com/pypa/setuptools";
license = licenses.mit;
description = "Easily download, build, install, upgrade, and uninstall Python packages";
};
};
"wheel" = python.mkDerivation {
name = "wheel-0.33.6";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/59/b0/11710a598e1e148fb7cbf9220fd2a0b82c98e94efbdecb299cb25e7f0b39/wheel-0.33.6.tar.gz";
sha256 = "10c9da68765315ed98850f8e048347c3eb06dd81822dc2ab1d4fde9dc9702646";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://github.com/pypa/wheel";
license = licenses.mit;
description = "A built-package format for Python.";
};
};
};
localOverridesFile = ./requirements_override.nix;
localOverrides = import localOverridesFile { inherit pkgs python; };
commonOverrides = [
(let src = pkgs.fetchFromGitHub { owner = "nix-community"; repo = "pypi2nix-overrides"; rev = "db87933d87d9b3943cf636a49f16b76c9ea66db7"; sha256 = "1phiqh72dyg7qhkv15kdg4gjkx8rkywvs41j7liz5faj66ijlpv6"; } ; in import "${src}/overrides.nix" { inherit pkgs python; })
];
paramOverrides = [
(overrides { inherit pkgs python; })
];
allOverrides =
(if (builtins.pathExists localOverridesFile)
then [localOverrides] else [] ) ++ commonOverrides ++ paramOverrides;
in python.withPackages
(fix' (pkgs.lib.fold
extends
generated
allOverrides
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment