From patchwork Mon Apr 25 03:57:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 38858 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 856EF27BBEA; Mon, 25 Apr 2022 05:22:01 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B5A3E27BBE9 for ; Mon, 25 Apr 2022 05:22:00 +0100 (BST) Received: from localhost ([::1]:44938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niqEZ-0001b5-Ll for patchwork@mira.cbaines.net; Mon, 25 Apr 2022 00:21:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nipvh-00081j-U8 for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:31 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nipvh-0001pC-8o for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:29 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nipvh-0008I6-6C for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:29 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55104] [PATCH 096/232] gnu: Add python-pydevd. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Apr 2022 04:02:29 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55104 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55104@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 55104-submit@debbugs.gnu.org id=B55104.165085934631812 (code B ref 55104); Mon, 25 Apr 2022 04:02:29 +0000 Received: (at 55104) by debbugs.gnu.org; 25 Apr 2022 04:02:26 +0000 Received: from localhost ([127.0.0.1]:60949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nipvd-0008Gr-FQ for submit@debbugs.gnu.org; Mon, 25 Apr 2022 00:02:26 -0400 Received: from mail-qt1-f171.google.com ([209.85.160.171]:38424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nipuE-0007uw-Fq for 55104@debbugs.gnu.org; Mon, 25 Apr 2022 00:00:59 -0400 Received: by mail-qt1-f171.google.com with SMTP id d14so9575993qtw.5 for <55104@debbugs.gnu.org>; Sun, 24 Apr 2022 21:00:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rJdieNm5BdsMuvsIcMOidcLiVzvTtNq3RR1B7DocMCM=; b=oGm29FKfg7BnEaRcVuNixQDaCw9ivZh+koH9m5G2CFPwMwpziykMR06DOdgMJfH3Cp q9gm9o5MMfkA5xFg/xqywgw7LvIv0PZz+mbhqYVkGPtQvQKSAcnbLYUxFSmt8summC4s S5mgRmmTV2ZK7C1byHVqaVdGanrcPZ5q2+1+CPBxm/EHKv5WWWuady30++bnlViNQEH2 UZmsXRPlsnVRuLuOmEEiEREkXmvL5bUnhXAI20XRkbJBxp8xEr9doeNJ77/ONXfzEtPz PwewFeWhKEJqvYETNzR9rTBLsAboi9EjwkkdYAep8HAcSQogQrwDgVQkHb1D6HiLt+Gn GFZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rJdieNm5BdsMuvsIcMOidcLiVzvTtNq3RR1B7DocMCM=; b=2iGNerysowihxp5mQeyawKBzU4S0k96IUVtAa0BVcopxuU+pAzOJ1aRT94U0ohT1uu Et/AQ5ermwy1EHE+nS8v1xrnzWnYwDy5OzPPAYYknSrmCK/8E9//3fg6Qlty6/FVUtbi YNQ6cQC4GkoBNWyOtiw6d11HK+pqgURU/uPRlvUsBBVhY4GyZK6g2Q0zOu/2xbglIiBy Cen3zntAkkVuPkOT2cPGUuDuKhNgtckSsjBoRf+t7rahCkj7iePaaxN1VsLpyRen25tn w6AhwJE0SkjhYcGoseogWrpWJ890eo4cez5o2edYv+1VtAp9hsyNSDBcBxV78pZquyzU S8MQ== X-Gm-Message-State: AOAM530igSij9Ptz9i4Q1VXBholiRY49fQqzGa1nDpt2fvr63Rp5fjw2 ejlfB+A1eMiEzwdkKU+td2g9xrnNhRAa/Q== X-Google-Smtp-Source: ABdhPJyt0QGo/ETLqlcxdLcR44zqfr6TIgwbtL5Oh1xduT78k22RAw3dH0umoFCPHVsBjlCHrXcmBg== X-Received: by 2002:a05:622a:8b:b0:2e0:75f0:c18d with SMTP id o11-20020a05622a008b00b002e075f0c18dmr10942846qtw.488.1650859252504; Sun, 24 Apr 2022 21:00:52 -0700 (PDT) Received: from localhost.localdomain (dsl-150-232.b2b2c.ca. [66.158.150.232]) by smtp.gmail.com with ESMTPSA id w82-20020a376255000000b0069ee3f0ae63sm4478142qkb.45.2022.04.24.21.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 21:00:52 -0700 (PDT) From: Maxim Cournoyer Date: Sun, 24 Apr 2022 23:57:02 -0400 Message-Id: <20220425035918.25683-96-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220425035918.25683-1-maxim.cournoyer@gmail.com> References: <20220425035918.25683-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-xyz.scm (python-pydevd): New variable. --- gnu/packages/python-xyz.scm | 102 ++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index d987c9cbcd..83c2d472c9 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -157,6 +157,7 @@ (define-module (gnu packages python-xyz) #:use-module (gnu packages file) #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gdb) #:use-module (gnu packages gcc) #:use-module (gnu packages geo) #:use-module (gnu packages ghostscript) @@ -13016,6 +13017,107 @@ (define-public python-file (define-public python2-file (package-with-python2 python-file)) +(define-public python-pydevd + ;; Use the latest commit, which includes cleanups that removes Python 2 + ;; syntax that would fail to build. + (let ((revision "0") + (commit "47e298499ef19563bb2ef5941a57046a35ae6868")) + (package + (name "python-pydevd") + (version (git-version "2.8.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/fabioz/PyDev.Debugger") + (commit commit))) + (modules '((guix build utils))) + (snippet '(begin + ;; Delete pre-built binaries. + (for-each delete-file (find-files "." "\\.(so|dylib|dll)")) + ;; This source is generated via Cython. + (delete-file "_pydevd_bundle/pydevd_cython.c"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1yd017dh6xgxrqcyf8kk8jrr0a3zw895yfjih0z5jghyf0rck38q")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-tests + (lambda _ + (substitute* "tests_python/test_convert_utilities.py" + ;; Add missing trailing '/'. + (("'\\\\\\\\usr\\\\\\\\bin\\\\\\\\') == '/usr/bin" all) + (string-append all "/"))))) + (add-after 'unpack 'patch-command-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "_pydevd_bundle/pydevd_api.py" + (("'kill'") + (format #f "~s" (search-input-file inputs "bin/kill"))) + (("'pgrep'") + (format #f "~s" (search-input-file inputs "bin/pgrep")))))) + (add-after 'unpack 'generate-sources + (lambda _ + (setenv "PYTHONPATH" (getcwd)) + (invoke "python" "build_tools/build.py"))) + (add-after 'unpack 'adjust-attach-binary-name + (lambda _ + (substitute* + '("pydevd_tracing.py" + "pydevd_attach_to_process/add_code_to_python_process.py") + (("def get_(target|python_helper_lib)_filename.*" all) + (format #f "~a return ~s~%" all + (string-append #$output "/lib/attach.so")))))) + (add-after 'unpack 'patch-gdb + (lambda* (#:key inputs #:allow-other-keys) + (substitute* + "pydevd_attach_to_process/add_code_to_python_process.py" + (("'gdb',") + (format #f "~s," (search-input-file inputs "bin/gdb")))))) + (add-after 'build 'build-attach-linux-binary + (lambda _ + (invoke #+(cxx-for-target) "-shared" "-o" "attach.so" + "-fPIC" "-nostartfiles" + "pydevd_attach_to_process/linux_and_mac/attach.cpp"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "PYDEVD_USE_CYTHON" "YES") + (invoke "pytest" "-vv" + "-n" (number->string (parallel-job-count)) + "-k" + (string-append + ;; the GUI event loop requires an X server. + "not test_gui_event_loop_custom " + ;; This test validates that 'pydevd' is not in the + ;; exception message, but it is due to being part + ;; of the build file name present in the message. + "and not test_evaluate_exception_trace"))))) + (add-after 'install 'install-attach-binary + (lambda _ + (install-file "attach.so" + (string-append #$output "/lib")))) + ;; Some modules aren't designed to be loadable by themselves, such + ;; as 'pydev_app_engine_debug_startup' and fail. + (delete 'sanity-check)))) + (native-inputs + (list python-cython + python-numpy + python-psutil + python-pytest + python-pytest-xdist + python-trio + python-untangle)) + (inputs (list coreutils gdb procps)) + (home-page "https://github.com/fabioz/PyDev.Debugger/") + (synopsis "Python debugger") + (description "PyDev.Debugger is a capable Python debugger used in PyDev +and other @acronym{IDEs, Integrated Development Environments}.") + (license license:epl1.0)))) + (define-public python-debian (package (name "python-debian")