git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #49629 from marsam/feature/fixes-pyre

pyre: 0.0.14 -> 0.0.17

commit5ea21ad32add0d94ea9bef5e56caec97febf8937 authorJörg Thalheim <Mic92@users.noreply.github.com> dateSat 3 Nov 2018, 02:32 (8 years ago) parent78ca6d891ce8c0
1 file changed+24−31
pkgs/development/tools/pyre/default.nix+24−31
pkgs/development/tools/pyre/default.nix+24−31
@@ -1,9 +1,15 @@
11{ stdenv, fetchFromGitHub, ocamlPackages, makeWrapper, writeScript
2−, dune, python3, rsync, fetchpatch }:
2+, dune, python3, rsync, fetchpatch, buck }:
33let
44 # Manually set version - the setup script requires
55 # hg and git + keeping the .git directory around.
6− pyre-version = "0.0.14";
6+ pyre-version = "0.0.17"; # also change typeshed revision below with $pyre-src/.typeshed-version
7+ pyre-src = fetchFromGitHub {
8+ owner = "facebook";
9+ repo = "pyre-check";
10+ rev = "v${pyre-version}";
11+ sha256 = "0y86a3g5xbgh0byksyx5jw7yq7w840x85dhz9inz6mkg5j06mcis";
12+ };
713 versionFile = writeScript "version.ml" ''
814 cat > "./version.ml" <<EOF
915 open Core
@@ -20,12 +26,7 @@ let
2026 pyre-bin = stdenv.mkDerivation {
2127 name = "pyre-${pyre-version}";
2228
23− src = fetchFromGitHub {
24− owner = "facebook";
25− repo = "pyre-check";
26− rev = "v${pyre-version}";
27− sha256 = "0c8xzaa3ljqb6llr041sydw0l4xqn7x21nw9vaymdxh35nx9bp2v";
28− };
29+ src = pyre-src;
2930
3031 nativeBuildInputs = [ makeWrapper ];
3132
@@ -49,7 +50,6 @@ let
4950 export HOME=.
5051
5152 # "external" because https://github.com/facebook/pyre-check/pull/8/files
52− cp Makefile.template Makefile
5353 sed "s/%VERSION%/external/" dune.in > dune
5454
5555 cp ${versionFile} ./scripts/generate-version-number.sh
@@ -77,20 +77,18 @@ let
7777 description = "A performant type-checker for Python 3";
7878 homepage = https://pyre-check.org;
7979 license = licenses.mit;
80− platforms = with platforms; linux;
80+ platforms = ocamlPackages.ocaml.meta.platforms;
8181 maintainers = with maintainers; [ teh ];
8282 };
8383};
8484typeshed = stdenv.mkDerivation {
8585 name = "typeshed";
86− # typeshed doesn't have versions, it seems to be synchronized with
87− # mypy relases. I'm assigning a random version here (same as pyre).
8886 version = pyre-version;
8987 src = fetchFromGitHub {
9088 owner = "python";
9189 repo = "typeshed";
92− rev = "a08c6ea";
93− sha256 = "0wy8yh43vhyyc4g7iqnmlj66kz5in02y5qc0c4jdckhpa3mchaqk";
90+ rev = "bc3f9fe1d3c43b00c04cedb23e0eeebc9e1734b6";
91+ sha256 = "06b2kj4n49h4sgi8hn5kalmir8llhanfdc7f1924cxvrkj5ry94b";
9492 };
9593 phases = [ "unpackPhase" "installPhase" ];
9694 installPhase = "cp -r $src $out";
@@ -98,19 +96,8 @@ typeshed = stdenv.mkDerivation {
9896in python3.pkgs.buildPythonApplication rec {
9997 pname = "pyre-check";
10098 version = pyre-version;
101− src = fetchFromGitHub {
102− owner = "facebook";
103− repo = "pyre-check";
104− rev = "v${pyre-version}";
105− sha256 = "0ig7bx2kfn2kbxw74wysh5365yp5gyby42l9l29iclrzdghgk32l";
106− };
107− patches = [
108− (fetchpatch {
109− url = "https://github.com/facebook/pyre-check/commit/b473d2ed9fc11e7c1cd0c7b8c42f521e5cdc2003.patch";
110− sha256 = "05xvyp7j4n6z92bxf64rxfq5pvaadxgx1c8c5qziy75vdz72lkcy";
111− })
112− ./pyre-bdist-wheel.patch
113− ];
99+ src = pyre-src;
100+ patches = [ ./pyre-bdist-wheel.patch ];
114101
115102 # The build-pypi-package script does some funky stuff with build
116103 # directories - easier to patch it a bit than to replace it
@@ -119,15 +106,21 @@ in python3.pkgs.buildPythonApplication rec {
119106 mkdir ./build
120107 substituteInPlace scripts/build-pypi-package.sh \
121108 --replace 'NIX_BINARY_FILE' '${pyre-bin}/bin/pyre.bin' \
122− --replace 'BUILD_ROOT="$(mktemp -d)"' "BUILD_ROOT=$(pwd)/build"
109+ --replace 'BUILD_ROOT="$(mktemp -d)"' "BUILD_ROOT=$PWD/build"
110+ substituteInPlace client/buck.py \
111+ --replace '"buck"' '"${buck}/bin/buck"'
112+ substituteInPlace client/tests/buck_test.py \
113+ --replace '"buck"' '"${buck}/bin/buck"'
123114 '';
124115
125− buildInputs = [ pyre-bin rsync ];
116+ buildInputs = [ pyre-bin ];
117+ nativeBuildInputs = [ rsync ]; # only required for build-pypi-package.sh
126118 propagatedBuildInputs = with python3.pkgs; [ docutils typeshed ];
127119 buildPhase = ''
128120 bash scripts/build-pypi-package.sh --version ${pyre-version} --bundle-typeshed ${typeshed}
129121 cp -r build/dist dist
130122 '';
131−
132− doCheck = false; # can't open file 'nix_run_setup':
123+ checkPhase = ''
124+ bash scripts/run-python-tests.sh
125+ '';
133126}