Unverified Commit 21c5e94d authored by Tom van Dijk's avatar Tom van Dijk
Browse files

python3Packages.tree-sitter: fetch from PyPi

This allows it to be updated according to the release cadence of the
entire ecosystem, not as github tags are pushed.

See: https://github.com/NixOS/nixpkgs/pull/425177
parent f033f93b
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -2,8 +2,7 @@
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  fetchPypi,
  pythonOlder,
  setuptools,
  tree-sitter-python,
@@ -20,12 +19,9 @@ buildPythonPackage rec {

  disabled = pythonOlder "3.10";

  src = fetchFromGitHub {
    owner = "tree-sitter";
    repo = "py-tree-sitter";
    tag = "v${version}";
    hash = "sha256-ZDt/8suteaAjGdk71l8eej7jDkkVpVDBIZS63SA8tsU=";
    fetchSubmodules = true;
  src = fetchPypi {
    inherit pname version;
    hash = "sha256-q9la9lyi9Pfso1Y0M5HtZp52Tzd0i1NSlG8A9/x45zQ=";
  };

  # see https://github.com/tree-sitter/py-tree-sitter/issues/330#issuecomment-2629403946
@@ -36,7 +32,6 @@ buildPythonPackage rec {
  build-system = [ setuptools ];

  nativeCheckInputs = [
    pytestCheckHook
    tree-sitter-python
    tree-sitter-rust
    tree-sitter-html
@@ -59,7 +54,7 @@ buildPythonPackage rec {
  meta = {
    description = "Python bindings to the Tree-sitter parsing library";
    homepage = "https://github.com/tree-sitter/py-tree-sitter";
    changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/${src.tag}";
    changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };