mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
python3Packages.importmagic: fix build
This commit is contained in:
parent
0a14706530
commit
6353656e54
@ -13,19 +13,24 @@ buildPythonPackage rec {
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "3f7757a5b74c9a291e20e12023bb3bf71bc2fa3adfb15a08570648ab83eaf8d8";
|
||||
hash = "sha256-P3dXpbdMmikeIOEgI7s79xvC+jrfsVoIVwZIq4Pq+Ng=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# https://github.com/alecthomas/importmagic/issues/67
|
||||
./python-312.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ six ];
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
pythonImportsCheck = [ "importmagic" ];
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "Python Import Magic - automagically add, remove and manage imports";
|
||||
homepage = "https://github.com/alecthomas/importmagic";
|
||||
license = licenses.bsd0;
|
||||
maintainers = with maintainers; [ onny ];
|
||||
license = lib.licenses.bsd0;
|
||||
maintainers = with lib.maintainers; [ onny ];
|
||||
};
|
||||
}
|
||||
|
24
pkgs/development/python-modules/importmagic/python-312.patch
Normal file
24
pkgs/development/python-modules/importmagic/python-312.patch
Normal file
@ -0,0 +1,24 @@
|
||||
--- a/importmagic/index.py
|
||||
+++ b/importmagic/index.py
|
||||
@@ -8,18 +8,14 @@
|
||||
import logging
|
||||
import re
|
||||
from contextlib import contextmanager
|
||||
-from distutils import sysconfig
|
||||
+import sysconfig
|
||||
|
||||
from importmagic.util import parse_ast
|
||||
|
||||
|
||||
LIB_LOCATIONS = sorted(set((
|
||||
- (sysconfig.get_python_lib(standard_lib=True), 'S'),
|
||||
- (sysconfig.get_python_lib(plat_specific=True), '3'),
|
||||
- (sysconfig.get_python_lib(standard_lib=True, prefix=sys.prefix), 'S'),
|
||||
- (sysconfig.get_python_lib(plat_specific=True, prefix=sys.prefix), '3'),
|
||||
- (sysconfig.get_python_lib(standard_lib=True, prefix='/usr/local'), 'S'),
|
||||
- (sysconfig.get_python_lib(plat_specific=True, prefix='/usr/local'), '3'),
|
||||
+ (sysconfig.get_path('stdlib'), 'S'),
|
||||
+ (sysconfig.get_path('platlib'), '3'),
|
||||
)), key=lambda l: -len(l[0]))
|
||||
|
||||
# Regex matching modules that we never attempt to index.
|
Loading…
Reference in New Issue
Block a user