Loading pkgs/build-support/build-setupcfg/default.nix 0 → 100644 +23 −0 Original line number Diff line number Diff line # Build a python package from info made available by setupcfg2nix. # # * src: The source of the package. # * info: The package information generated by setupcfg2nix. # * meta: Standard nixpkgs metadata. # * application: Whether this package is a python library or an # application which happens to be written in python. pythonPackages: { src, info, meta ? {}, application ? false }: let build = if application then pythonPackages.buildPythonApplication else pythonPackages.buildPythonPackage; in build { inherit (info) pname version; inherit src meta; nativeBuildInputs = map (p: pythonPackages.${p}) ( (info.setup_requires or []) ++ (info.tests_require or [])); propagatedBuildInputs = map (p: pythonPackages.${p}) (info.install_requires or []); } pkgs/development/tools/setupcfg2nix/default.nix 0 → 100644 +19 −0 Original line number Diff line number Diff line { buildSetupcfg, fetchFromGitHub, lib }: buildSetupcfg rec { info = import ./info.nix; src = fetchFromGitHub { owner = "target"; repo = "setupcfg2nix"; rev = info.version; sha256 = "1zn9njpzwhwikrirgjlyz6ys3xr8gq61ry8blmnpscqvhsdhxcs6"; }; application = true; meta = { description = "Generate nix expressions from setup.cfg for a python package."; homepage = https://github.com/target/setupcfg2nix; license = lib.licenses.mit; platforms = lib.platforms.all; maintainers = [ lib.maintainers.shlevy ]; }; } pkgs/development/tools/setupcfg2nix/info.nix 0 → 100644 +7 −0 Original line number Diff line number Diff line { pname = ''setupcfg2nix''; version = ''1.1.0''; install_requires = [ ''setuptools'' ]; } pkgs/top-level/all-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -7230,6 +7230,8 @@ with pkgs; pythonPackages = python3Packages; }; setupcfg2nix = python3Packages.callPackage ../development/tools/setupcfg2nix {}; # These pyside tools do not provide any Python modules and are meant to be here. # See ../development/python-modules/pyside/default.nix for details. pysideApiextractor = callPackage ../development/python-modules/pyside/apiextractor.nix { }; Loading pkgs/top-level/python-packages.nix +4 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,9 @@ let toPythonModule = x: x; # Application does not provide modules. })); # See build-setupcfg/default.nix for documentation. buildSetupcfg = import ../build-support/build-setupcfg self; graphiteVersion = "1.0.2"; fetchPypi = makeOverridable( {format ? "setuptools", ... } @attrs: Loading Loading @@ -133,6 +136,7 @@ in { inherit fetchPypi callPackage; inherit hasPythonModule requiredPythonModules makePythonPath disabledIf; inherit toPythonModule toPythonApplication; inherit buildSetupcfg; # helpers Loading Loading
pkgs/build-support/build-setupcfg/default.nix 0 → 100644 +23 −0 Original line number Diff line number Diff line # Build a python package from info made available by setupcfg2nix. # # * src: The source of the package. # * info: The package information generated by setupcfg2nix. # * meta: Standard nixpkgs metadata. # * application: Whether this package is a python library or an # application which happens to be written in python. pythonPackages: { src, info, meta ? {}, application ? false }: let build = if application then pythonPackages.buildPythonApplication else pythonPackages.buildPythonPackage; in build { inherit (info) pname version; inherit src meta; nativeBuildInputs = map (p: pythonPackages.${p}) ( (info.setup_requires or []) ++ (info.tests_require or [])); propagatedBuildInputs = map (p: pythonPackages.${p}) (info.install_requires or []); }
pkgs/development/tools/setupcfg2nix/default.nix 0 → 100644 +19 −0 Original line number Diff line number Diff line { buildSetupcfg, fetchFromGitHub, lib }: buildSetupcfg rec { info = import ./info.nix; src = fetchFromGitHub { owner = "target"; repo = "setupcfg2nix"; rev = info.version; sha256 = "1zn9njpzwhwikrirgjlyz6ys3xr8gq61ry8blmnpscqvhsdhxcs6"; }; application = true; meta = { description = "Generate nix expressions from setup.cfg for a python package."; homepage = https://github.com/target/setupcfg2nix; license = lib.licenses.mit; platforms = lib.platforms.all; maintainers = [ lib.maintainers.shlevy ]; }; }
pkgs/development/tools/setupcfg2nix/info.nix 0 → 100644 +7 −0 Original line number Diff line number Diff line { pname = ''setupcfg2nix''; version = ''1.1.0''; install_requires = [ ''setuptools'' ]; }
pkgs/top-level/all-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -7230,6 +7230,8 @@ with pkgs; pythonPackages = python3Packages; }; setupcfg2nix = python3Packages.callPackage ../development/tools/setupcfg2nix {}; # These pyside tools do not provide any Python modules and are meant to be here. # See ../development/python-modules/pyside/default.nix for details. pysideApiextractor = callPackage ../development/python-modules/pyside/apiextractor.nix { }; Loading
pkgs/top-level/python-packages.nix +4 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,9 @@ let toPythonModule = x: x; # Application does not provide modules. })); # See build-setupcfg/default.nix for documentation. buildSetupcfg = import ../build-support/build-setupcfg self; graphiteVersion = "1.0.2"; fetchPypi = makeOverridable( {format ? "setuptools", ... } @attrs: Loading Loading @@ -133,6 +136,7 @@ in { inherit fetchPypi callPackage; inherit hasPythonModule requiredPythonModules makePythonPath disabledIf; inherit toPythonModule toPythonApplication; inherit buildSetupcfg; # helpers Loading