diff --git a/pkgs/development/tools/pyre/default.nix b/pkgs/development/tools/pyre/default.nix deleted file mode 100644 index 060875924d80b3..00000000000000 --- a/pkgs/development/tools/pyre/default.nix +++ /dev/null @@ -1,137 +0,0 @@ -{ stdenv, fetchFromGitHub, ocamlPackages, writeScript -, dune, python3, rsync, buck, watchman, sqlite }: -let - # Manually set version - the setup script requires - # hg and git + keeping the .git directory around. - pyre-version = "0.0.22"; # also change typeshed revision below with $pyre-src/.typeshed-version - pyre-src = fetchFromGitHub { - owner = "facebook"; - repo = "pyre-check"; - rev = "v${pyre-version}"; - sha256 = "057vy6zmgwsi0ag9n4m6sszhahmfk2s1ywm36nyfs7w4d0wnk92s"; - }; - versionFile = writeScript "version.ml" '' - cat > "./version.ml" < dune - - ln -sf ${versionFile} ./scripts/generate-version-number.sh - - mkdir $(pwd)/build - export OCAMLFIND_DESTDIR=$(pwd)/build - export OCAMLPATH=$OCAMLPATH:$(pwd)/build - ''; - - buildFlags = [ "release" ]; - - doCheck = true; - # ./scripts/run-python-tests.sh # TODO: once typeshed and python bits are added - - # Note that we're not installing the typeshed yet. - # Improvement for a future version. - installPhase = '' - install -D ./_build/default/main.exe $out/bin/pyre.bin - ''; - - meta = with stdenv.lib; { - description = "A performant type-checker for Python 3"; - homepage = https://pyre-check.org; - license = licenses.mit; - platforms = ocamlPackages.ocaml.meta.platforms; - maintainers = with maintainers; [ teh ]; - }; -}; -typeshed = stdenv.mkDerivation { - pname = "typeshed"; - version = pyre-version; - src = fetchFromGitHub { - owner = "python"; - repo = "typeshed"; - rev = "0b49ce75b478fdf283dda5dd1368759ac342dfe2"; - sha256 = "1w5aqbbcfk5ki8n9fgdikkyadjb318ipqyi517s9xnwlzi1jv0fh"; - }; - phases = [ "unpackPhase" "installPhase" ]; - installPhase = "cp -r $src $out"; -}; -in python3.pkgs.buildPythonApplication { - pname = "pyre-check"; - version = pyre-version; - src = pyre-src; - patches = [ ./pyre-bdist-wheel.patch ]; - - # The build-pypi-package script does some funky stuff with build - # directories - easier to patch it a bit than to replace it - # completely though: - postPatch = '' - mkdir ./build - substituteInPlace scripts/build-pypi-package.sh \ - --replace 'NIX_BINARY_FILE' '${pyre-bin}/bin/pyre.bin' \ - --replace 'BUILD_ROOT="$(mktemp -d)"' "BUILD_ROOT=$PWD/build" - for file in client/pyre.py client/commands/initialize.py client/commands/tests/initialize_test.py; do - substituteInPlace "$file" \ - --replace '"watchman"' '"${watchman}/bin/watchman"' - done - substituteInPlace client/buck.py \ - --replace '"buck"' '"${buck}/bin/buck"' - substituteInPlace client/tests/buck_test.py \ - --replace '"buck"' '"${buck}/bin/buck"' - ''; - - buildInputs = [ pyre-bin ]; - nativeBuildInputs = [ rsync ]; # only required for build-pypi-package.sh - propagatedBuildInputs = with python3.pkgs; [ - docutils - typeshed - click-log - ipython - sqlalchemy - munch - xxhash - ujson - ]; - buildPhase = '' - bash scripts/build-pypi-package.sh --version ${pyre-version} --bundle-typeshed ${typeshed} - cp -r build/dist dist - ''; - checkPhase = '' - bash scripts/run-python-tests.sh - ''; -} diff --git a/pkgs/development/tools/pyre/pyre-bdist-wheel.patch b/pkgs/development/tools/pyre/pyre-bdist-wheel.patch deleted file mode 100644 index 1b6fea024e03d0..00000000000000 --- a/pkgs/development/tools/pyre/pyre-bdist-wheel.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/scripts/build-pypi-package.sh b/scripts/build-pypi-package.sh -index 1035591..bb8cbae 100755 ---- a/scripts/build-pypi-package.sh -+++ b/scripts/build-pypi-package.sh -@@ -98,7 +98,7 @@ rsync -avm --filter='- tests/' --filter='+ */' --filter='-! *.py' "${SCRIPTS_DIR - sed -i -e "/__version__/s/= \".*\"/= \"${PACKAGE_VERSION}\"/" "${BUILD_ROOT}/${MODULE_NAME}/version.py" - - # Copy binary files. --BINARY_FILE="${SCRIPTS_DIRECTORY}/../_build/default/main.exe" -+BINARY_FILE="NIX_BINARY_FILE" - if [[ ! -f "${BINARY_FILE}" ]]; then - echo "The binary file ${BINARY_FILE} does not exist." - echo "Have you run 'make' in the toplevel directory?" -@@ -146,7 +146,7 @@ def find_typeshed_files(base): - result.append((target, files)) - return result - --with open('README.md') as f: -+with open('README.md', encoding='utf8') as f: - long_description = f.read() - - setup( -@@ -205,20 +205,3 @@ fi - - # Build. - python3 setup.py bdist_wheel -- --# Move artifact outside the build directory. --mkdir -p "${SCRIPTS_DIRECTORY}/dist" --files_count="$(find "${BUILD_ROOT}/dist/" -type f | wc -l | tr -d ' ')" --[[ "${files_count}" == '1' ]] || \ -- die "${files_count} files created in ${BUILD_ROOT}/dist, but only one was expected" --source_file="$(find "${BUILD_ROOT}/dist/" -type f)" --destination="$(basename "${source_file}")" --destination="${destination/%-any.whl/-${WHEEL_DISTRIBUTION_PLATFORM}.whl}" --mv "${source_file}" "${SCRIPTS_DIRECTORY}/dist/${destination}" -- --# Cleanup. --cd "${SCRIPTS_DIRECTORY}" --rm -rf "${BUILD_ROOT}" -- --printf '\nAll done. Build artifact available at:\n %s\n' "${SCRIPTS_DIRECTORY}/dist/${destination}" --exit 0 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 73256b4b22e0d2..26f848c3b9552a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7858,8 +7858,6 @@ in fstar = callPackage ../development/compilers/fstar { }; - pyre = callPackage ../development/tools/pyre { }; - dotnetPackages = recurseIntoAttrs (callPackage ./dotnet-packages.nix {}); glslang = callPackage ../development/compilers/glslang {