lol

python3Packages.importmagic: fix build (#356666)

authored by

Jonas Heinrich and committed by
GitHub
f93401ee f58d0771

+33 -4
+9 -4
pkgs/development/python-modules/importmagic/default.nix
··· 13 13 14 14 src = fetchPypi { 15 15 inherit pname version; 16 - sha256 = "3f7757a5b74c9a291e20e12023bb3bf71bc2fa3adfb15a08570648ab83eaf8d8"; 16 + hash = "sha256-P3dXpbdMmikeIOEgI7s79xvC+jrfsVoIVwZIq4Pq+Ng="; 17 17 }; 18 + 19 + patches = [ 20 + # https://github.com/alecthomas/importmagic/issues/67 21 + ./python-312.patch 22 + ]; 18 23 19 24 propagatedBuildInputs = [ six ]; 20 25 ··· 22 27 23 28 pythonImportsCheck = [ "importmagic" ]; 24 29 25 - meta = with lib; { 30 + meta = { 26 31 description = "Python Import Magic - automagically add, remove and manage imports"; 27 32 homepage = "https://github.com/alecthomas/importmagic"; 28 - license = licenses.bsd0; 29 - maintainers = with maintainers; [ onny ]; 33 + license = lib.licenses.bsd0; 34 + maintainers = with lib.maintainers; [ onny ]; 30 35 }; 31 36 }
+24
pkgs/development/python-modules/importmagic/python-312.patch
··· 1 + --- a/importmagic/index.py 2 + +++ b/importmagic/index.py 3 + @@ -8,18 +8,14 @@ 4 + import logging 5 + import re 6 + from contextlib import contextmanager 7 + -from distutils import sysconfig 8 + +import sysconfig 9 + 10 + from importmagic.util import parse_ast 11 + 12 + 13 + LIB_LOCATIONS = sorted(set(( 14 + - (sysconfig.get_python_lib(standard_lib=True), 'S'), 15 + - (sysconfig.get_python_lib(plat_specific=True), '3'), 16 + - (sysconfig.get_python_lib(standard_lib=True, prefix=sys.prefix), 'S'), 17 + - (sysconfig.get_python_lib(plat_specific=True, prefix=sys.prefix), '3'), 18 + - (sysconfig.get_python_lib(standard_lib=True, prefix='/usr/local'), 'S'), 19 + - (sysconfig.get_python_lib(plat_specific=True, prefix='/usr/local'), '3'), 20 + + (sysconfig.get_path('stdlib'), 'S'), 21 + + (sysconfig.get_path('platlib'), '3'), 22 + )), key=lambda l: -len(l[0])) 23 + 24 + # Regex matching modules that we never attempt to index.