GNU bug report logs -
#41366
[PATCH 0/4] Add Importmagic
Previous Next
Reported by: Ryan Prior <rprior <at> protonmail.com>
Date: Sun, 17 May 2020 18:33:01 UTC
Severity: normal
Tags: patch
Done: jgart <jgart <at> dismail.de>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41366 in the body.
You can then email your comments to 41366 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sun, 17 May 2020 18:33:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ryan Prior <rprior <at> protonmail.com>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Sun, 17 May 2020 18:33:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Importmagic fixes Python imports automatically. It has a few dependencies
(sexpdata, epc) not yet packaged in Guix, and a corresponding Emacs mode.
Ryan Prior (4):
gnu: Add python-importmagic.
gnu: Add python-sexpdata.
gnu: Add python-epc.
gnu: Add emacs-importmagic.
gnu/packages/emacs-xyz.scm | 23 ++++++++++++++
gnu/packages/python-xyz.scm | 62 +++++++++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+)
--
2.17.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sun, 17 May 2020 18:43:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 41366 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/python-xyz.scm (python-sexpdata): New variable.
---
gnu/packages/python-xyz.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 131d8c6d35..58de95b21a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5769,6 +5769,25 @@ them as the version argument or in a SCM managed file.")
(define-public python2-setuptools-scm
(package-with-python2 python-setuptools-scm))
+(define-public python-sexpdata
+ (package
+ (name "python-sexpdata")
+ (version "0.0.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "sexpdata" version))
+ (sha256
+ (base32
+ "1q4lsjyzzqrdv64l0pv4ij9nd8gqhvxqcrpxc2xpxs652sk2gj0s"))))
+ (build-system python-build-system)
+ (home-page "https://github.com/jd-boyd/sexpdata")
+ (synopsis "S-expression parser for Python")
+ (description
+ "Sexpdata is an S-expression parser/serializer. It has load and dump
+functions like pickle, json or PyYAML module.")
+ (license license:bsd-3)))
+
(define-public python-pathlib2
(package
(name "python-pathlib2")
--
2.17.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sun, 17 May 2020 18:43:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 41366 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/python-xyz.el (python-importmagic): New variable.
---
gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c26a766d64..131d8c6d35 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -77,6 +77,7 @@
;;; Copyright © 2020 Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
;;; Copyright © 2020 Alex ter Weele <alex.ter.weele <at> gmail.com>
;;; Copyright © 2020 Matthew Kraai <kraai <at> ftbfs.org>
+;;; Copyright © 2020 Ryan Prior <rprior <at> protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -5897,6 +5898,25 @@ need to use the older and less efficient @code{pkg_resources} package.")
("python-contextlib2" ,python2-contextlib2-bootstrap)
("python-importlib-resources" ,python2-importlib-resources-bootstrap))))))
+(define-public python-importmagic
+ (package
+ (name "python-importmagic")
+ (version "0.1.7")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "importmagic" version))
+ (sha256
+ (base32
+ "1n7qxa1snj06aw45mcfz7bxc46zp7fxj687140g2k6jcnyjmfxrz"))))
+ (build-system python-build-system)
+ (home-page "https://github.com/alecthomas/importmagic")
+ (synopsis "Library for adding, removing and managing Python imports")
+ (description
+ "Importmagic is a Python library for automatically managing imports by
+finding unresolved symbols in Python code and their corresponding imports.")
+ (license license:bsd-3)))
+
(define-public python-jaraco-packaging
(package
(name "python-jaraco-packaging")
--
2.17.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sun, 17 May 2020 18:43:03 GMT)
Full text and
rfc822 format available.
Message #14 received at 41366 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/python-xyz.py (python-epc): New variable.
---
gnu/packages/python-xyz.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 58de95b21a..0ec672259b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8826,6 +8826,29 @@ functions to find and load entry points.")
(define-public python2-entrypoints
(package-with-python2 python-entrypoints))
+(define-public python-epc
+ (package
+ (name "python-epc")
+ (version "0.0.5")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "epc" version))
+ (sha256
+ (base32
+ "09bx1ln1bwa00917dndlgs4k589h8qx2x080xch5m58p92kjwkd1"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-sexpdata" ,python-sexpdata)))
+ (native-inputs
+ `(("python-nose" ,python-nose)))
+ (home-page "https://github.com/tkf/python-epc")
+ (synopsis "Remote procedure call (RPC) stack for Emacs Lisp and Python")
+ (description
+ "Python-EPC can call elisp functions from Python and Python functions
+from elisp.")
+ (license license:gpl3)))
+
(define-public python-nbconvert
(package
(name "python-nbconvert")
--
2.17.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sun, 17 May 2020 18:43:03 GMT)
Full text and
rfc822 format available.
Message #17 received at 41366 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/emacs-xyz.py (emacs-importmagic): New variable.
---
gnu/packages/emacs-xyz.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 4bbd482409..859417dc62 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -70,6 +70,7 @@
;;; Copyright © 2020 Alberto Eleuterio Flores Guerrero <barbanegra+guix <at> posteo.mx>
;;; Copyright © 2020 Marius Bakke <mbakke <at> fastmail.com>
;;; Copyright © 2020 pinoaffe <pinoaffe <at> airmail.cc>
+;;; Copyright © 2020 Ryan Prior <rprior <at> protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -16625,6 +16626,28 @@ provided by other Emacs packages dealing with pass:
image, rotate it, save modified images, and more.")
(license license:gpl3+))))
+(define-public emacs-importmagic
+ (package
+ (name "emacs-importmagic")
+ (version "20180520.303")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append "https://melpa.org/packages/importmagic-" version ".tar"))
+ (sha256
+ (base32 "0xk4i4x4836ksv2pr3aarpbkq6b5sz8c3y6f39fwf698v8zirhs9"))))
+ (build-system emacs-build-system)
+ (propagated-inputs
+ `(("emacs-epc" ,emacs-epc)
+ ("emacs-f" ,emacs-f)
+ ("python-epc" ,python-epc)
+ ("python-importmagic" ,python-importmagic)))
+ (home-page "https://github.com/anachronic/importmagic.el")
+ (synopsis "Fix Python imports")
+ (description "Importmagic.el fixes unresolved imports in Python buffers.")
+ (license license:gpl3)))
+
(define-public emacs-package-lint
(let ((commit "69bb89d00ba212b734c676ad056aa793c450b288"))
(package
--
2.17.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 19:03:02 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ryan Prior via Guix-patches via <guix-patches <at> gnu.org> writes:
> * gnu/packages/emacs-xyz.py (emacs-importmagic): New variable.
Thanks! This patch did not apply for me somehow, can you rebase on the
current master branch?
I applied the other three, all LGTM.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 19:03:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 19:28:02 GMT)
Full text and
rfc822 format available.
Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, May 23, 2020 7:02 PM, Marius Bakke <mbakke <at> fastmail.com> wrote:
> This patch did not apply for me somehow
Looks like a conflict in the copyright line. (Something something lawyers.) New patch attached!
> I applied the other three, all LGTM.
Thank you!
Ryan
[0001-gnu-Add-emacs-importmagic.patch (text/x-patch, attachment)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 19:28:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 20:01:02 GMT)
Full text and
rfc822 format available.
Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
Ryan Prior via Guix-patches via <guix-patches <at> gnu.org> writes:
> + (propagated-inputs
> + `(("emacs-epc" ,emacs-epc)
> + ("emacs-f" ,emacs-f)
> + ("python-epc" ,python-epc)
> + ("python-importmagic" ,python-importmagic)))
OOC, are you sure Python packages need to be propagated in this case?
Regards,
--
Nicolas Goaziou
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 20:01:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 20:42:01 GMT)
Full text and
rfc822 format available.
Message #38 received at submit <at> debbugs.gnu.org (full text, mbox):
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, May 23, 2020 8:00 PM, Nicolas Goaziou <mail <at> nicolasgoaziou.fr> wrote:
> OOC, are you sure Python packages need to be propagated in this case?
Hi Nicholas! I tried it with the python packages in "inputs" and impotmagic.el complained about not being able to find them. I'm going to be helping with maintenance of importmagic.el so maybe that's something I can fix on the package side?
At present this seems to work better. I don't know yet what the difference is between inputs and propagated-inputs when it comes to Python packages so maybe somebody else might have a better answer.
Ryan
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 20:42:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 21:13:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 41366 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ryan Prior <rprior <at> protonmail.com> writes:
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Saturday, May 23, 2020 8:00 PM, Nicolas Goaziou <mail <at> nicolasgoaziou.fr> wrote:
>
>> OOC, are you sure Python packages need to be propagated in this case?
>
> Hi Nicholas! I tried it with the python packages in "inputs" and impotmagic.el complained about not being able to find them. I'm going to be helping with maintenance of importmagic.el so maybe that's something I can fix on the package side?
>
> At present this seems to work better. I don't know yet what the difference is between inputs and propagated-inputs when it comes to Python packages so maybe somebody else might have a better answer.
The difference is that propagated-inputs will be installed to the
profile when you 'guix install emacs-importmagic'.
Propagating these will only work if the user already has 'python' in the
profile, which sets up PYTHONPATH.
For regular executables, we solve this by "wrapping" the executable with
PYTHONPATH to avoid the need for propagation.
Ideally we'd patch importmagic.el so that it automatically sets
PYTHONPATH referring to these two packages (prepending to any existing
PYTHONPATH). I think python-shell-interpreter also should use the
absolute file name of the "python" executable so it does not have to be
installed separately.
Do you think that can work?
Thanks for chiming in Nicolas, I had completely missed those propagated
Python packages. :-)
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41366
; Package
guix-patches
.
(Sat, 23 May 2020 21:20:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 41366 <at> debbugs.gnu.org (full text, mbox):
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, May 23, 2020 9:12 PM, Marius Bakke <mbakke <at> fastmail.com> wrote:
> Do you think that can work?
I'm going to look into it. Prepending the PYTHONPATH and manipulating the python-shell-interpreter doesn't sound like it should be tricky.
Do you by chance know of other Emacs packages in Guix which do this kind of patching so I can look at an example? I'll do some grepping around and see what I can find, or just try something and iterate from there.
Ryan
Reply sent
to
jgart <jgart <at> dismail.de>
:
You have taken responsibility.
(Thu, 16 Jan 2025 17:33:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ryan Prior <rprior <at> protonmail.com>
:
bug acknowledged by developer.
(Thu, 16 Jan 2025 17:33:02 GMT)
Full text and
rfc822 format available.
Message #52 received at 41366-done <at> debbugs.gnu.org (full text, mbox):
Hi Ryan,
Closing this issue as importmagic hasn't received updates for three
years and this functionaly is now part of Emacs proper:
https://github.com/anachronic/importmagic.el/issues/30
Thanks for your work on this nonetheless.
--
all the best,
jgart
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 14 Feb 2025 12:24:17 GMT)
Full text and
rfc822 format available.
This bug report was last modified 27 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.