From: Scott Worley Date: Thu, 11 Jun 2020 20:41:49 +0000 (-0700) Subject: Build like a real Python package X-Git-Tag: 1.4~2 X-Git-Url: http://git.scottworley.com/pinch/commitdiff_plain/b5964ec35e259f36550d6e8c7fa60412db05a049?ds=inline Build like a real Python package --- diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..942ef10 --- /dev/null +++ b/default.nix @@ -0,0 +1,11 @@ +{ pkgs ? import { } }: +pkgs.python3Packages.callPackage +({ lib, buildPythonPackage, nix, git, autopep8, mypy, pylint, }: + buildPythonPackage rec { + pname = "pinch"; + version = "1.3"; + src = lib.cleanSource ./.; + checkInputs = [ nix git autopep8 mypy pylint ]; + doCheck = true; + checkPhase = "./test.sh"; + }) { } diff --git a/pinch.py b/pinch.py index b761313..5f25015 100644 --- a/pinch.py +++ b/pinch.py @@ -602,4 +602,5 @@ def main() -> None: args.func(args) -main() +if __name__ == '__main__': + main() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f8647e6 --- /dev/null +++ b/setup.py @@ -0,0 +1,8 @@ +from setuptools import setup + +setup( + name="pinch", + version="1.4", + py_modules=['pinch'], + entry_points={"console_scripts": ["pinch = pinch:main"]}, +) diff --git a/shell.nix b/shell.nix deleted file mode 100644 index b408ea4..0000000 --- a/shell.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs ? import { } }: -pkgs.mkShell rec { - doCheck = true; - buildInputs = with pkgs; [ python3 ]; - checkInputs = with pkgs; [ - mypy - python3Packages.autopep8 - python3Packages.pylint - ]; -}