diff mbox series

[bug#42085,4/6] gnu: Add python-nodeenv.

Message ID 20200627154645.64264-4-monego@posteo.net
State Accepted
Headers show
Series [bug#42082,1/6] gnu: Add python-covdefaults. | expand

Checks

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

Commit Message

Vinicius Monego June 27, 2020, 3:46 p.m. UTC
* gnu/packages/python-xyz.scm (python-nodeenv): New variable.
---
 gnu/packages/python-xyz.scm | 38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

Comments

Marius Bakke July 20, 2020, 9:25 p.m. UTC | #1
Vinicius Monego <monego@posteo.net> writes:

> * gnu/packages/python-xyz.scm (python-nodeenv): New variable.

We often omit the python- prefix for packages that are not used as a
library, i.e. Python packages that produce a "normal program".  Is that
the case here?

Perhaps it would make sense to place this in (gnu packages node) as
simply "nodeenv"?

[...]

> +    (native-inputs
> +     `(("python-coverage" ,python-coverage)
> +       ("python-flake8" ,python-flake8)
> +       ("python-mock" ,python-mock)
> +       ("python-pytest" ,python-pytest)
> +       ("python-tox" ,python-tox)))

'python-tox' can probably be removed since we call out to pytest
directly.  Some packages needlessly test for it though, in that case you
can remove it from requirements-dev.txt with substitute*.

> +    (home-page "https://ekalinin.github.io/nodeenv/")
> +    (synopsis "Tool to create isolated node.js environments")

s/Tool to c/C/
Vinicius Monego July 21, 2020, 6:42 p.m. UTC | #2
Em seg, 2020-07-20 às 23:25 +0200, Marius Bakke escreveu:

> We often omit the python- prefix for packages that are not used as a
> library, i.e. Python packages that produce a "normal program".  Is
> that
> the case here?

It does provide an executable. It's a tool like virtualenv, but for
Node packages instead of Python.

> Perhaps it would make sense to place this in (gnu packages node) as
> simply "nodeenv"?

IIUC the {language} modules are for packages affiliated with the
foundation behind the language, or other compiler or interpreter
implementations. That's not the case here.

> > +    (native-inputs
> > +     `(("python-coverage" ,python-coverage)
> > +       ("python-flake8" ,python-flake8)
> > +       ("python-mock" ,python-mock)
> > +       ("python-pytest" ,python-pytest)
> > +       ("python-tox" ,python-tox)))
> 
> 'python-tox' can probably be removed since we call out to pytest
> directly.  Some packages needlessly test for it though, in that case
> you
> can remove it from requirements-dev.txt with substitute*.

Removed. I also removed flake8, since it's only used in the tox.ini
file.
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 045ee833ff..9eac0ff74f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17187,6 +17187,44 @@  Public Suffix List's private domains as well.")
 (define-public python2-tldextract
   (package-with-python2 python-tldextract))
 
+(define-public python-nodeenv
+  (package
+    (name "python-nodeenv")
+    (version "1.4.0")
+    (source
+     (origin
+       ;; There's no tarball in PyPI.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ekalinin/nodeenv")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0y443icx0w7jlzmxmmcm4q8dqfiwgafbb9cp8jpm68mbqxbz40a7"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             ;; This test fails. It tries to open a network socket.
+             (invoke "pytest" "-vv" "-k" "not test_smoke")
+             #t)))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-flake8" ,python-flake8)
+       ("python-mock" ,python-mock)
+       ("python-pytest" ,python-pytest)
+       ("python-tox" ,python-tox)))
+    (home-page "https://ekalinin.github.io/nodeenv/")
+    (synopsis "Tool to create isolated node.js environments")
+    (description
+     "Nodeenv (node.js virtual environment) is a tool to create isolated
+node.js environments.  It creates an environment that has its own installation
+directories, that doesn't share libraries with other node.js virtual
+environments.")
+    (license license:bsd-3)))
+
 (define-public python-pynamecheap
   (package
     (name "python-pynamecheap")