diff --git a/pkgs/development/python-modules/libcst/default.nix b/pkgs/development/python-modules/libcst/default.nix index 6f3f2d3def64..0b20a803904f 100644 --- a/pkgs/development/python-modules/libcst/default.nix +++ b/pkgs/development/python-modules/libcst/default.nix @@ -19,31 +19,31 @@ buildPythonPackage rec { pname = "libcst"; - version = "0.4.9"; + version = "1.0.1"; format = "pyproject"; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "instagram"; - repo = pname; + repo = "libcst"; rev = "refs/tags/v${version}"; - hash = "sha256-ikddvKsvXMNHMfA9jUhvyiDXII0tTs/rE97IGI/azgA="; + hash = "sha256-FgQE8ofRXQs/zHh7AKscXu0deN3IG+Nk/h+a09Co5R8="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; sourceRoot = "source/${cargoRoot}"; name = "${pname}-${version}"; - hash = "sha256-FWQGv3E5X+VEnTYD0uKN6W4USth8EQlEGbYgUAWZ5EQ="; + hash = "sha256-rPB3bAMdvjgsT3jkEDoWatW8LPwgIaFSbFPqiqANtBY="; }; cargoRoot = "native"; postPatch = '' - # test try to format files, which isn't necessary when consuming releases - sed -i libcst/codegen/generate.py \ - -e '/ufmt/c\ pass' + # avoid infinite recursion by not formatting the release files + substituteInPlace libcst/codegen/generate.py \ + --replace '"ufmt"' '"true"' ''; SETUPTOOLS_SCM_PRETEND_VERSION = version; @@ -70,8 +70,12 @@ buildPythonPackage rec { ]; preCheck = '' + # otherwise import libcst.native fails + cp build/lib.*/libcst/native.* libcst/ + ${python.interpreter} -m libcst.codegen.generate visitors ${python.interpreter} -m libcst.codegen.generate return_types + # Can't run all tests due to circular dependency on hypothesmith -> libcst rm -r {libcst/tests,libcst/codegen/tests,libcst/m*/tests} '';