Skip to content

Instantly share code, notes, and snippets.

@benley
Created June 27, 2015 08:44
Show Gist options
  • Save benley/7e8f460ddac91d131fb4 to your computer and use it in GitHub Desktop.
Save benley/7e8f460ddac91d131fb4 to your computer and use it in GitHub Desktop.
{ 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