diff mbox series

[bug#48289] gnu: Add python-pythonanywhere.

Message ID 20210508132849.26030-1-filip@lajszczak.dev
State Accepted
Headers show
Series [bug#48289] gnu: Add python-pythonanywhere. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Filip Lajszczak May 8, 2021, 1:28 p.m. UTC
* gnu/packages/python-xyz.scm (python-pythonanywhere): New variable.
---
 gnu/packages/python-xyz.scm | 47 +++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

Comments

M May 8, 2021, 9:16 p.m. UTC | #1
Filip Lajszczak schreef op za 08-05-2021 om 15:28 [+0200]:
> * gnu/packages/python-xyz.scm (python-pythonanywhere): New variable.
> [...]
> +   (arguments
> +    `(#:phases (modify-phases %standard-phases
> +      (add-before 'check 'change-home
> +       (lambda _
> +        (setenv "HOME" "/tmp") #t))

Phases do not need to return #t anymore; the warning you get if you 
remove it is misleading.  The warning will disappear once core-updates
is merged.

> +      (replace 'check
> +       (lambda _
> +        (invoke "pytest" "-m" "not slowtest") #t)))))

To support "guix build --without-tests" and cross-compilation, make this

> +      (replace 'check
> +       (lambda* (#:key tests? #:allow-other-keys)
> +        (when tests?
> +         (invoke "pytest" "-m" "not slowtest"))))

The native-inputs and propagated-inputs seem about right to me,
but I haven't tested.

Greetings,
Maxime
Filip Lajszczak May 9, 2021, 1:06 p.m. UTC | #2
On Sat, 8 May 2021 at 22:16, Maxime Devos <maximedevos@telenet.be> wrote:
> Phases do not need to return #t anymore; the warning you get if you
> remove it is misleading.  The warning will disappear once core-updates
> is merged.

Good to know!

>
> > +      (replace 'check
> > +       (lambda _
> > +        (invoke "pytest" "-m" "not slowtest") #t)))))
>
> To support "guix build --without-tests" and cross-compilation, make this
>
> > +      (replace 'check
> > +       (lambda* (#:key tests? #:allow-other-keys)
> > +        (when tests?
> > +         (invoke "pytest" "-m" "not slowtest"))))
>

Thanks for the review! I'm about to post a new version of the patch.

All the best,
Filip
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index de7c303b6c..083d26c212 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -99,6 +99,7 @@ 
 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2021 Ellis Kenyő <me@elken.dev>
 ;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
+;;; Copyright © 2021 Filip Lajszczak <filip@lajszczak.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -11455,6 +11456,52 @@  programmatically with command-line parsers like @code{getopt} and
 (define-public python2-docopt
   (package-with-python2 python-docopt))
 
+(define-public python-pythonanywhere
+  (package
+   (name "python-pythonanywhere")
+   (version "0.9.8")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+      (url "https://github.com/pythonanywhere/helper_scripts")
+      (commit (string-append "v" version))))
+     (file-name (git-file-name name version))
+     (sha256
+      (base32
+       "0yd0hk9awfk4kc99nn008by8jbz2h709qvzzixjyjhcg6xjmc2zh"))))
+   (build-system python-build-system)
+   (arguments
+    `(#:phases (modify-phases %standard-phases
+      (add-before 'check 'change-home
+       (lambda _
+        (setenv "HOME" "/tmp") #t))
+      (replace 'check
+       (lambda _
+        (invoke "pytest" "-m" "not slowtest") #t)))))
+   (native-inputs
+    `(("python-pytest" ,python-pytest)
+      ("python-psutil" ,python-psutil)
+      ("python-responses" ,python-responses)
+      ("python-pytest-mock" ,python-pytest-mock)))
+   (propagated-inputs
+    `(("python-dateutil" ,python-dateutil)
+      ("python-docopt" ,python-docopt)
+      ("python-packaging" ,python-packaging)
+      ("python-requests" ,python-requests)
+      ("python-schema" ,python-schema)
+      ("python-tabulate" ,python-tabulate)
+      ("python-typer" ,python-typer)))
+   (home-page
+    "https://github.com/pythonanywhere/helper_scripts/")
+   (synopsis
+    "PythonAnywhere helper tools for users")
+   (description
+    "PythonAnywhere helper tools for users.  Scripts, cli and python wrapper around API
+that allows to manage web apps and scheduled tasks.  Includes single-command deployment
+for Django Girls tutorial.")
+   (license license:expat)))
+
 (define-public python-pythondialog
   (package
     (name "python-pythondialog")