18 buildPythonPackage rec {
22 src = fetchFromGitHub {
26 sha256 = "1dgjbbhy228w2zbfq5pf0hkai7742zw8mmybnzjdc9l6pw7360rq";
30 # Hard code GDB path (used to attach to process)
32 src = ./hardcode-gdb.patch;
37 src = ./hardcode-version.patch;
41 # Fix importing debugpy in:
42 # - test_nodebug[module-launch(externalTerminal)]
43 # - test_nodebug[module-launch(integratedTerminal)]
45 # NOTE: The import failures seen in these tests without the patch
46 # will be seen if a user "installs" debugpy by adding it to PYTHONPATH.
47 # To avoid this issue, debugpy should be installed using python.withPackages:
48 # python.withPackages (ps: with ps; [ debugpy ])
49 ./fix-test-pythonpath.patch
52 # Remove pre-compiled "attach" libraries and recompile for host platform
53 # Compile flags taken from linux_and_mac/compile_linux.sh & linux_and_mac/compile_mac.sh
56 cd src/debugpy/_vendored/pydevd/pydevd_attach_to_process
57 rm *.so *.dylib *.dll *.exe *.pdb
58 ${stdenv.cc}/bin/c++ linux_and_mac/attach.cpp -Ilinux_and_mac -fPIC -nostartfiles ${{
59 "x86_64-linux" = "-shared -m64 -o attach_linux_amd64.so";
60 "i686-linux" = "-shared -m32 -o attach_linux_x86.so";
61 "x86_64-darwin" = "-std=c++11 -lc -D_REENTRANT -dynamiclib -arch x86_64 -o attach_x86_64.dylib";
62 "i686-darwin" = "-std=c++11 -lc -D_REENTRANT -dynamiclib -arch i386 -o attach_x86.dylib";
63 }.${stdenv.hostPlatform.system}}
73 ] ++ lib.optionals (!isPy27) [
78 # Override default arguments in pytest.ini
79 pytestFlagsArray = [ "--timeout=0" "-n=$NIX_BUILD_CORES" ];
81 disabledTests = lib.optionals isPy27 [
82 # django 1.11 is the last version to support Python 2.7
83 # and is no longer built in nixpkgs
86 # gevent fails to import zope.interface with Python 2.7
91 description = "An implementation of the Debug Adapter Protocol for Python";
92 homepage = "https://github.com/microsoft/debugpy";
93 license = licenses.mit;
94 maintainers = with maintainers; [ metadark ];
95 platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "i686-darwin" ];