Created
June 27, 2015 08:44
-
-
Save benley/7e8f460ddac91d131fb4 to your computer and use it in GitHub Desktop.
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
{ pythonPackages }: | |
let | |
buildPythonScript = { src, ... }@args: | |
let | |
name = args.name or (removeSuffix ".py" (baseNameOf src)); | |
setup.py = builtins.toFile "setup.py" '' | |
import setuptools | |
setuptools.setup( | |
name = "${name}", | |
scripts = ["${name}"]) | |
''; | |
in buildPythonPackage ({ | |
inherit name; | |
unpackPhase = '' | |
ln -s ${src} ${name} | |
ln -s ${setup.py} setup.py | |
''; | |
} // args); | |
in | |
{ | |
some_python_script_lol = buildPythonScript { | |
src = ./some_python_script_lol.py; | |
pythonPath = with pythonPackages; [ | |
boto | |
pyyaml | |
requests | |
]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment