Merge pull request #244034 from SuperSandro2000/libcst

python310Packages.libcst: 0.4.9 -> 1.0.1
This commit is contained in:
Sandro 2023-07-24 00:20:46 +02:00 committed by GitHub
commit 639a297de5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}
'';