unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mădălin Ionel Patrașcu" <madalinionel.patrascu@mdc-berlin.de>
To: <58490@debbugs.gnu.org>
Subject: [bug#58490] [PATCH 5/5] gnu: Add python-jupytext. X-Debbugs-Cc: rekado@elephly.net
Date: Thu, 13 Oct 2022 13:40:06 +0200	[thread overview]
Message-ID: <20221013114006.9513-5-madalinionel.patrascu@mdc-berlin.de> (raw)
In-Reply-To: <20221013114006.9513-1-madalinionel.patrascu@mdc-berlin.de>

* gnu/packages/python-xyz.scm (python-jupytext): New variable.
---
 gnu/packages/python-xyz.scm | 77 +++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6c111bcb82..51753e279a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -319,6 +319,83 @@ (define-public python-janus
 design}.")
     (license license:asl2.0)))
 
+(define-public python-jupytext
+  (package
+    (name "python-jupytext")
+    (version "1.14.1")
+    (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mwouts/jupytext")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0gqpvphrp2ja9ggadx0rrk0sqbpz6kqqg62qqmw4k17469lphc8c"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+       #:phases
+       #~(modify-phases %standard-phases
+           (add-after 'unpack 'relax-requirements
+             (lambda _
+               (substitute* "tests/utils.py"
+                 ;; is required isort > 5.3.0 but the authors made a confusion
+                 ;; between string comparations and version parsing comparasion
+                 (("or isort_version\\(\\) <= \"5\\.3\\.0\"")
+                   "")
+                 (("\"python_kernel\"")
+                   "\"python3\""))))
+           (replace 'check
+             (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+               ;; some tests fails when HOME=/homeless-shelter.
+               (setenv "HOME" "/tmp")
+               ;; OSError: [Errno 18] Invalid cross-device link
+               (setenv "TMPDIR" "/tmp")
+               (add-installed-pythonpath inputs outputs)
+               (when tests?
+                 (let ((disabled-tests
+                         (list "test_create_header_with_set_formats"
+                               "test_pre_commit_hook"
+                               "test_sync_with_pre_commit_hook")))
+                      (invoke "pytest" "-vv" "-k"
+                              (string-append "not "
+                                             (string-join disabled-tests
+                                                " and not "))))))))))
+    (native-inputs
+      (list git
+            python-autopep8
+            python-black
+            python-flake8
+            python-gitpython
+            python-isort
+            python-ipython-genutils
+            python-jupyter-server
+            python-pre-commit
+            python-pytest
+            python-pyaml
+            python-sphinx-gallery-0.7.0))
+    (propagated-inputs
+      (list python-markdown-it-py
+            python-mdit-py-plugins
+            python-nbformat))
+    (home-page "https://github.com/mwouts/jupytext")
+    (synopsis
+     "Jupyter notebooks as Markdown documents, Julia, Python or R scripts")
+    (description
+     "@code{Jupytext} is a plugin for @code{Jupyter} that can save @code{Jupyter
+notebooks} as either @code{Markdown} files or scripts in many languages.  Common
+use cases for @code{Jupytext} are:
+@itemize
+@item
+version control on Jupyter Notebooks
+@item
+editing, merging or refactoring notebooks in your favorite text editor
+@item
+applying Q&A checks on notebooks.
+@end itemize")
+    (license license:expat)))
+
 (define-public python-logzero
   (package
     (name "python-logzero")
-- 
2.37.3





  parent reply	other threads:[~2022-10-13 11:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 11:35 [bug#58490] gnu: Add python-mdurl, python-markdown-it-py, python-mdit-py-plugins, python-sphinx-gallery-0.7.0 and python-jupytext MadalinIonel.Patrascu
2022-10-13 11:40 ` [bug#58490] [PATCH 1/5] gnu: Add python-mdurl. X-Debbugs-Cc: rekado@elephly.net Mădălin Ionel Patrașcu
2022-10-13 11:40   ` [bug#58490] [PATCH 2/5] gnu: Add python-markdown-it-py. " Mădălin Ionel Patrașcu
2022-10-13 11:40   ` [bug#58490] [PATCH 3/5] gnu: Add python-mdit-py-plugins. " Mădălin Ionel Patrașcu
2022-10-13 11:40   ` [bug#58490] [PATCH 4/5] gnu: Add python-sphinx-gallery-0.7.0. " Mădălin Ionel Patrașcu
2022-10-13 11:40   ` Mădălin Ionel Patrașcu [this message]
2022-10-27 11:07 ` bug#58490: Add python-jupytext Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221013114006.9513-5-madalinionel.patrascu@mdc-berlin.de \
    --to=madalinionel.patrascu@mdc-berlin.de \
    --cc=58490@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).