all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults.
@ 2020-06-27 15:46 Vinicius Monego
  2020-06-27 15:46 ` [bug#42083] [PATCH 2/6] gnu: Add python-cfgv Vinicius Monego
                   ` (7 more replies)
  0 siblings, 8 replies; 25+ messages in thread
From: Vinicius Monego @ 2020-06-27 15:46 UTC (permalink / raw)
  To: 42082; +Cc: Vinicius Monego

* gnu/packages/check.scm (python-covdefaults): New variable.
---
 gnu/packages/check.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index c71edc7655..c2435a78af 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -1081,6 +1081,37 @@ same arguments.")
        `(("python2-mock" ,python2-mock)
          ,@(package-propagated-inputs base))))))
 
+(define-public python-covdefaults
+  (package
+    (name "python-covdefaults")
+    (version "1.1.0")
+    (source
+     (origin
+       ;; The PyPI tarball does not include tests.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/asottile/covdefaults")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv")
+             #t)))))
+    (propagated-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/asottile/covdefaults")
+    (synopsis "Coverage plugin to provide sensible default settings")
+    (description
+     "Covdefaults is a coverage plugin to provide sensible default settings.")
+    (license license:expat)))
+
 (define-public python-pytest-xdist
   (package
     (name "python-pytest-xdist")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42083] [PATCH 2/6] gnu: Add python-cfgv.
  2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
@ 2020-06-27 15:46 ` Vinicius Monego
  2020-07-20 21:17   ` Marius Bakke
  2020-06-27 15:46 ` [bug#42084] [PATCH 3/6] gnu: Add python-identify Vinicius Monego
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Vinicius Monego @ 2020-06-27 15:46 UTC (permalink / raw)
  To: 42083; +Cc: Vinicius Monego

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 300277f045..ac839a4e16 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17210,6 +17210,39 @@ Let's Encrypt.")
 (define-public python2-dns-lexicon
   (package-with-python2 python-dns-lexicon))
 
+(define-public python-cfgv
+  (package
+    (name "python-cfgv")
+    (version "3.1.0")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/asottile/cfgv")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vvkkqw92sak4b28bpscpppq483amy52ch2yqy1i2m23q7xjkabx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv")
+             #t)))))
+    (native-inputs
+     `(("python-covdefaults" ,python-covdefaults)
+       ("python-coverage" ,python-coverage)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/asottile/cfgv")
+    (synopsis "Validate configuration and produce human readable error messages")
+    (description
+     "This library helps to validate configuration and produce human readable
+error messages.")
+    (license license:expat)))
+
 (define-public python-commandlines
   (package
     (name "python-commandlines")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42084] [PATCH 3/6] gnu: Add python-identify.
  2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
  2020-06-27 15:46 ` [bug#42083] [PATCH 2/6] gnu: Add python-cfgv Vinicius Monego
@ 2020-06-27 15:46 ` Vinicius Monego
  2020-07-20 21:17   ` Marius Bakke
  2020-06-27 15:46 ` [bug#42085] [PATCH 4/6] gnu: Add python-nodeenv Vinicius Monego
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Vinicius Monego @ 2020-06-27 15:46 UTC (permalink / raw)
  To: 42084; +Cc: Vinicius Monego

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ac839a4e16..045ee833ff 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -161,6 +161,7 @@
   #:use-module (gnu packages terminals)
   #:use-module (gnu packages tex)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
@@ -17119,6 +17120,40 @@ library to allow local file system access via @code{file://} URLs.")
 (define-public python2-requests-file
   (package-with-python2 python-requests-file))
 
+(define-public python-identify
+  (package
+    (name "python-identify")
+    (version "1.4.20")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/chriskuehl/identify")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0ivafv83ivjgyan10yf0calbzraknps60n2v841n7jfazracr8v2"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv")
+             #t)))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-editdistance" ,python-editdistance)))
+    (home-page "https://github.com/chriskuehl/identify")
+    (synopsis "File identification library for Python")
+    (description
+     "File identification library for Python.  Given a file (or some information
+about a file), return a set of standardized tags identifying what the file is.")
+    (license license:expat)))
+
 (define-public python-tldextract
   (package
     (name "python-tldextract")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42085] [PATCH 4/6] gnu: Add python-nodeenv.
  2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
  2020-06-27 15:46 ` [bug#42083] [PATCH 2/6] gnu: Add python-cfgv Vinicius Monego
  2020-06-27 15:46 ` [bug#42084] [PATCH 3/6] gnu: Add python-identify Vinicius Monego
@ 2020-06-27 15:46 ` Vinicius Monego
  2020-07-20 21:25   ` Marius Bakke
  2020-06-27 15:46 ` [bug#42086] [PATCH 5/6] gnu: Add python-pytest-env Vinicius Monego
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Vinicius Monego @ 2020-06-27 15:46 UTC (permalink / raw)
  To: 42085; +Cc: Vinicius Monego

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

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")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42086] [PATCH 5/6] gnu: Add python-pytest-env.
  2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
                   ` (2 preceding siblings ...)
  2020-06-27 15:46 ` [bug#42085] [PATCH 4/6] gnu: Add python-nodeenv Vinicius Monego
@ 2020-06-27 15:46 ` Vinicius Monego
  2020-07-20 21:27   ` Marius Bakke
  2020-06-27 15:46 ` [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit Vinicius Monego
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Vinicius Monego @ 2020-06-27 15:46 UTC (permalink / raw)
  To: 42086; +Cc: Vinicius Monego

* gnu/packages/check.scm (python-pytest-env): New variable.
---
 gnu/packages/check.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index c2435a78af..f03d1f42fe 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -933,6 +933,26 @@ and many external plugins.")
         ("python-py" ,python2-py)
         ("python-wcwidth" ,python2-wcwidth))))))
 
+(define-public python-pytest-env
+  (package
+    (name "python-pytest-env")
+    (version "0.6.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-env" version))
+       (sha256
+        (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/MobileDynasty/pytest-env")
+    (synopsis "Pytest plugin that allows you to add environment variables")
+    (description
+     "This is a py.test plugin that enables you to set environment variables
+in the pytest.ini file.")
+    (license license:expat)))
+
 (define-public python-pytest-cov
   (package
     (name "python-pytest-cov")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit.
  2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
                   ` (3 preceding siblings ...)
  2020-06-27 15:46 ` [bug#42086] [PATCH 5/6] gnu: Add python-pytest-env Vinicius Monego
@ 2020-06-27 15:46 ` Vinicius Monego
  2020-07-20 21:36   ` Marius Bakke
  2020-07-20 21:13 ` [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Marius Bakke
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Vinicius Monego @ 2020-06-27 15:46 UTC (permalink / raw)
  To: 42087; +Cc: Vinicius Monego

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9eac0ff74f..972eb64d8e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16852,6 +16852,34 @@ Glob2 currently based on the glob code from Python 3.3.1.")
 (define-public python2-glob2
   (package-with-python2 python-glob2))
 
+(define-public python-pre-commit
+  (package
+    (name "python-pre-commit")
+    (version "2.5.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pre_commit" version))
+       (sha256
+        (base32 "1ivl921kdk9wga2cix4j9ydvs3dryqaaayq496pzjmz2y3w3qins"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f)) ;tests require python-tox >= 3.13
+    (propagated-inputs
+     `(("python-cfgv" ,python-cfgv)
+       ("python-identify" ,python-identify)
+       ("python-nodeenv" ,python-nodeenv)
+       ("python-pyyaml" ,python-pyyaml)
+       ("python-toml" ,python-toml)
+       ("python-virtualenv" ,python-virtualenv)))
+    (home-page "https://pre-commit.com/")
+    (synopsis "Framework for managing and maintaining multi-language pre-commit hooks")
+    (description
+     "Pre-commit is a multi-language package manager for pre-commit hooks.  You
+specify a list of hooks you want and pre-commit manages the installation and
+execution of any hook written in any language before every commit.")
+    (license license:expat)))
+
 (define-public python-gipc
   (package
     (name "python-gipc")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults.
  2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
                   ` (4 preceding siblings ...)
  2020-06-27 15:46 ` [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit Vinicius Monego
@ 2020-07-20 21:13 ` Marius Bakke
  2020-07-21 18:28   ` Vinicius Monego
  2020-07-24 12:01 ` [bug#42082] [PATCH v2 " Vinicius Monego
  2020-07-25  2:21 ` [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Brett Gilio
  7 siblings, 1 reply; 25+ messages in thread
From: Marius Bakke @ 2020-07-20 21:13 UTC (permalink / raw)
  To: Vinicius Monego, 42082; +Cc: Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 2406 bytes --]

Hi Vinicius,

Sorry for the slow response.  The series look great overall, but I have
a few nitpicks.  :-)

Vinicius Monego <monego@posteo.net> writes:

> * gnu/packages/check.scm (python-covdefaults): New variable.

We now have a 'python-check.scm' which is preferable to check.scm.  Can
you add this library there instead?

Ideally we'd move the current Python test libraries over too, but that's
another issue.

[...]
  
> +(define-public python-covdefaults
> +  (package
> +    (name "python-covdefaults")
> +    (version "1.1.0")
> +    (source
> +     (origin
> +       ;; The PyPI tarball does not include tests.
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/asottile/covdefaults")
> +             (commit (string-append "v" version))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (replace 'check
> +           (lambda _
> +             (invoke "pytest" "-vv")
> +             #t)))))

Note: invoke returns #t on success, so no need for the explicit return
(though it does not hurt).

> +    (propagated-inputs
> +     `(("python-coverage" ,python-coverage)
> +       ("python-pytest" ,python-pytest)))

Should pytest be propagated here?

Also, as this package is a plugin for coverage, maybe it should not
propagate coverage either.  The reason is that propagating prevents it
from being (easily) used with other versions of coverage.  Let's say
that a package needs a newer coverage than the default in Guix + this
plugin, propagation here would bring in the wrong coverage version.

> +    (home-page "https://github.com/asottile/covdefaults")
> +    (synopsis "Coverage plugin to provide sensible default settings")
> +    (description
> +     "Covdefaults is a coverage plugin to provide sensible default settings.")

I know it's a lot to ask :-) but can you try to expand on how it differs
from the apparently unreasonable defaults in coverage?  "Sensible" also
borders on "marketing speak", perhaps "opinionated" is a better term.

This was more text than I intended for an otherwise good-looking patch!
Will comment on the others too.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42083] [PATCH 2/6] gnu: Add python-cfgv.
  2020-06-27 15:46 ` [bug#42083] [PATCH 2/6] gnu: Add python-cfgv Vinicius Monego
@ 2020-07-20 21:17   ` Marius Bakke
  0 siblings, 0 replies; 25+ messages in thread
From: Marius Bakke @ 2020-07-20 21:17 UTC (permalink / raw)
  To: Vinicius Monego, 42083; +Cc: Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

Vinicius Monego <monego@posteo.net> writes:

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

[...]

> +    (synopsis "Validate configuration and produce human readable error messages")

Maybe just 'Configuration validation library'.

> +    (description
> +     "This library helps to validate configuration and produce human readable
> +error messages.")

*configuration files (I think?)

Otherwise LGTM, thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42084] [PATCH 3/6] gnu: Add python-identify.
  2020-06-27 15:46 ` [bug#42084] [PATCH 3/6] gnu: Add python-identify Vinicius Monego
@ 2020-07-20 21:17   ` Marius Bakke
  0 siblings, 0 replies; 25+ messages in thread
From: Marius Bakke @ 2020-07-20 21:17 UTC (permalink / raw)
  To: Vinicius Monego, 42084; +Cc: Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

Vinicius Monego <monego@posteo.net> writes:

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

LGTM!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42085] [PATCH 4/6] gnu: Add python-nodeenv.
  2020-06-27 15:46 ` [bug#42085] [PATCH 4/6] gnu: Add python-nodeenv Vinicius Monego
@ 2020-07-20 21:25   ` Marius Bakke
  2020-07-21 18:42     ` Vinicius Monego
  0 siblings, 1 reply; 25+ messages in thread
From: Marius Bakke @ 2020-07-20 21:25 UTC (permalink / raw)
  To: Vinicius Monego, 42085; +Cc: Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42086] [PATCH 5/6] gnu: Add python-pytest-env.
  2020-06-27 15:46 ` [bug#42086] [PATCH 5/6] gnu: Add python-pytest-env Vinicius Monego
@ 2020-07-20 21:27   ` Marius Bakke
  0 siblings, 0 replies; 25+ messages in thread
From: Marius Bakke @ 2020-07-20 21:27 UTC (permalink / raw)
  To: Vinicius Monego, 42086; +Cc: Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

Vinicius Monego <monego@posteo.net> writes:

> * gnu/packages/check.scm (python-pytest-env): New variable.

python-check.scm is better here too, even though pytest lives
elsewhere.

[...]

> +(define-public python-pytest-env
> +  (package
> +    (name "python-pytest-env")
> +    (version "0.6.2")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (pypi-uri "pytest-env" version))
> +       (sha256
> +        (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
> +    (build-system python-build-system)
> +    (propagated-inputs
> +     `(("python-pytest" ,python-pytest)))

As mentioned in another patch, it's good not to propagate the package
that this one "plugs in to", in order to allow using it with other
versions.

> +    (home-page "https://github.com/MobileDynasty/pytest-env")
> +    (synopsis "Pytest plugin that allows you to add environment variables")
> +    (description
> +     "This is a py.test plugin that enables you to set environment variables
> +in the pytest.ini file.")

@command{py.test} and @file{pytest.ini}.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit.
  2020-06-27 15:46 ` [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit Vinicius Monego
@ 2020-07-20 21:36   ` Marius Bakke
  2020-07-21 18:57     ` Vinicius Monego
  0 siblings, 1 reply; 25+ messages in thread
From: Marius Bakke @ 2020-07-20 21:36 UTC (permalink / raw)
  To: Vinicius Monego, 42087; +Cc: Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 2078 bytes --]

Vinicius Monego <monego@posteo.net> writes:

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

[...]
  
> +(define-public python-pre-commit
> +  (package
> +    (name "python-pre-commit")
> +    (version "2.5.1")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (pypi-uri "pre_commit" version))
> +       (sha256
> +        (base32 "1ivl921kdk9wga2cix4j9ydvs3dryqaaayq496pzjmz2y3w3qins"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:tests? #f)) ;tests require python-tox >= 3.13

Do they really require Tox directly?  Tox is fairly redundant in Guix,
as all it does is create an isolated environment for running tests,
which Guix already does.  So the usual approach is to copy the command
for running tests out of tox.ini and run it directly in the check
phase.  Is that an option here?

> +    (propagated-inputs
> +     `(("python-cfgv" ,python-cfgv)
> +       ("python-identify" ,python-identify)
> +       ("python-nodeenv" ,python-nodeenv)
> +       ("python-pyyaml" ,python-pyyaml)
> +       ("python-toml" ,python-toml)
> +       ("python-virtualenv" ,python-virtualenv)))

Does this program produce a regular executable?  I.e. it's not intended
for use as a library?  In that case you can simply add these as regular
inputs, and the executable will be "wrapped" with the correct
PYTHONPATH.

Also, maybe we can omit the python- prefix here too, and perhaps place
it in version-control.scm?

> +    (home-page "https://pre-commit.com/")
> +    (synopsis "Framework for managing and maintaining multi-language pre-commit hooks")
> +    (description
> +     "Pre-commit is a multi-language package manager for pre-commit hooks.  You
> +specify a list of hooks you want and pre-commit manages the installation and
> +execution of any hook written in any language before every commit.")

Woow, a package manager for pre-commit hooks, amazing.  LGTM.  :-)

Can you send a v2 series?  By the way, great job at enabling tests for
the other packages.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults.
  2020-07-20 21:13 ` [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Marius Bakke
@ 2020-07-21 18:28   ` Vinicius Monego
  2020-07-21 21:48     ` Marius Bakke
  0 siblings, 1 reply; 25+ messages in thread
From: Vinicius Monego @ 2020-07-21 18:28 UTC (permalink / raw)
  To: Marius Bakke, 42082

Em seg, 2020-07-20 às 23:13 +0200, Marius Bakke escreveu:
> Hi Vinicius,

Hello Marius,

Thanks for the tips!

> We now have a 'python-check.scm' which is preferable to
> check.scm.  Can
> you add this library there instead?

Sure. I overlooked that file. I sent another series of 6 pytest patches
before this, and will send a v2 for that as well.

> Should pytest be propagated here?
> 
> Also, as this package is a plugin for coverage, maybe it should not
> propagate coverage either.  The reason is that propagating prevents
> it
> from being (easily) used with other versions of coverage.  Let's say
> that a package needs a newer coverage than the default in Guix + this
> plugin, propagation here would bring in the wrong coverage version.

Oh, I thought that the pytest binary should be available as an
executable for the plugin to be used, similar to how APT has pytest as
a dependency for plugins. Maybe it's just me thinking in terms of
traditional package management.

The PyPI importer will propagate pytest by default, and it's common to
see it propagated in other plugins in check.scm. But now I see that
many plugins do not propagate it. Should pytest not be an input at all
(unless the plugin uses it for its own tests, in which case it should
be a native input)?

> I know it's a lot to ask :-) but can you try to expand on how it
> differs
> from the apparently unreasonable defaults in coverage?  "Sensible"
> also
> borders on "marketing speak", perhaps "opinionated" is a better term.

That's a slight rewording of the author's description in the
repository, and that's the only verbal information I could find about
the project. The differences can be seen in the README and in the
source code, but I don't know what to write about them, or even why the
changes are 'more sensible'.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42085] [PATCH 4/6] gnu: Add python-nodeenv.
  2020-07-20 21:25   ` Marius Bakke
@ 2020-07-21 18:42     ` Vinicius Monego
  0 siblings, 0 replies; 25+ messages in thread
From: Vinicius Monego @ 2020-07-21 18:42 UTC (permalink / raw)
  To: Marius Bakke, 42085

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.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit.
  2020-07-20 21:36   ` Marius Bakke
@ 2020-07-21 18:57     ` Vinicius Monego
  0 siblings, 0 replies; 25+ messages in thread
From: Vinicius Monego @ 2020-07-21 18:57 UTC (permalink / raw)
  To: Marius Bakke, 42087

Em seg, 2020-07-20 às 23:36 +0200, Marius Bakke escreveu:

> Do they really require Tox directly?  Tox is fairly redundant in
> Guix,
> as all it does is create an isolated environment for running tests,
> which Guix already does.  So the usual approach is to copy the
> command
> for running tests out of tox.ini and run it directly in the check
> phase.  Is that an option here?

I read CONTRIBUTING.md and those were the instructions. I was running
into weird error messages and assumed the cause was tox not being used.

But, nevermind. It was simply that, like in the previous packages, the
PyPI tarball does not include tests. I downloaded a git checkout and
now the tests are running, though with many deselections.

> Does this program produce a regular executable?  I.e. it's not
> intended
> for use as a library?  In that case you can simply add these as
> regular
> inputs, and the executable will be "wrapped" with the correct
> PYTHONPATH.

That's correct. It provides a regular executable.

> Also, maybe we can omit the python- prefix here too, and perhaps
> place
> it in version-control.scm?

That makes sense to me.

> Can you send a v2 series?

I will bump some versions, enable tests here and send a v2 by the
weekend.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults.
  2020-07-21 18:28   ` Vinicius Monego
@ 2020-07-21 21:48     ` Marius Bakke
  0 siblings, 0 replies; 25+ messages in thread
From: Marius Bakke @ 2020-07-21 21:48 UTC (permalink / raw)
  To: Vinicius Monego, 42082

[-- Attachment #1: Type: text/plain, Size: 2479 bytes --]

Vinicius Monego <monego@posteo.net> writes:

> Em seg, 2020-07-20 às 23:13 +0200, Marius Bakke escreveu:
>> Hi Vinicius,
>
> Hello Marius,
>
> Thanks for the tips!
>
>> We now have a 'python-check.scm' which is preferable to
>> check.scm.  Can
>> you add this library there instead?
>
> Sure. I overlooked that file. I sent another series of 6 pytest patches
> before this, and will send a v2 for that as well.

Excellent, thank you.

>> Should pytest be propagated here?
>> 
>> Also, as this package is a plugin for coverage, maybe it should not
>> propagate coverage either.  The reason is that propagating prevents
>> it
>> from being (easily) used with other versions of coverage.  Let's say
>> that a package needs a newer coverage than the default in Guix + this
>> plugin, propagation here would bring in the wrong coverage version.
>
> Oh, I thought that the pytest binary should be available as an
> executable for the plugin to be used, similar to how APT has pytest as
> a dependency for plugins. Maybe it's just me thinking in terms of
> traditional package management.
>
> The PyPI importer will propagate pytest by default, and it's common to
> see it propagated in other plugins in check.scm. But now I see that
> many plugins do not propagate it. Should pytest not be an input at all
> (unless the plugin uses it for its own tests, in which case it should
> be a native input)?

There are differing opinions on this matter :-) I would say that pytest
should _not_ be propagated in this case, so that the plugin can be used
with custom versions of pytest.  Others might say that the plugin is
useless without pytest, and so it _should_ be propagated.

I'll leave the final say to you.  :-)

>> I know it's a lot to ask :-) but can you try to expand on how it
>> differs
>> from the apparently unreasonable defaults in coverage?  "Sensible"
>> also
>> borders on "marketing speak", perhaps "opinionated" is a better term.
>
> That's a slight rewording of the author's description in the
> repository, and that's the only verbal information I could find about
> the project. The differences can be seen in the README and in the
> source code, but I don't know what to write about them, or even why the
> changes are 'more sensible'.

Right, not great.  We should at least try and stay neutral (see the
"Synopses and Descriptions" section of the manual).  So
s/sensible/opinionated/ is good enough for me.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH v2 1/6] gnu: Add python-covdefaults.
  2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
                   ` (5 preceding siblings ...)
  2020-07-20 21:13 ` [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Marius Bakke
@ 2020-07-24 12:01 ` Vinicius Monego
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 2/6] gnu: Add python-cfgv Vinicius Monego
                     ` (4 more replies)
  2020-07-25  2:21 ` [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Brett Gilio
  7 siblings, 5 replies; 25+ messages in thread
From: Vinicius Monego @ 2020-07-24 12:01 UTC (permalink / raw)
  To: 42082; +Cc: Vinicius Monego

* gnu/packages/python-check.scm (python-covdefaults): New variable.
---
Do not propagate pytest and coverage.

 gnu/packages/python-check.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 200bce6ced..be9b1def26 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -125,6 +125,37 @@ detect the absence of a cassette file and once again record all HTTP
 interactions, which will update them to correspond to the new API.")
     (license license:expat)))
 
+(define-public python-covdefaults
+  (package
+    (name "python-covdefaults")
+    (version "1.1.0")
+    (source
+     (origin
+       ;; The PyPI tarball does not include tests.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/asottile/covdefaults")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv"))))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/asottile/covdefaults")
+    (synopsis "Coverage plugin to provide opinionated default settings")
+    (description
+     "Covdefaults is a coverage plugin to provide opinionated default
+settings.")
+    (license license:expat)))
+
 (define-public python-pytest-vcr
   (package
     (name "python-pytest-vcr")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH v2 2/6] gnu: Add python-cfgv.
  2020-07-24 12:01 ` [bug#42082] [PATCH v2 " Vinicius Monego
@ 2020-07-24 12:01   ` Vinicius Monego
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 3/6] gnu: Add python-identify Vinicius Monego
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 25+ messages in thread
From: Vinicius Monego @ 2020-07-24 12:01 UTC (permalink / raw)
  To: 42082; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-cfgv): New variable.
---
Update synposys and description.

 gnu/packages/python-xyz.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 074ea394e1..0bc2b06cf5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17360,6 +17360,38 @@ Let's Encrypt.")
 (define-public python2-dns-lexicon
   (package-with-python2 python-dns-lexicon))
 
+(define-public python-cfgv
+  (package
+    (name "python-cfgv")
+    (version "3.1.0")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/asottile/cfgv")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vvkkqw92sak4b28bpscpppq483amy52ch2yqy1i2m23q7xjkabx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv"))))))
+    (native-inputs
+     `(("python-covdefaults" ,python-covdefaults)
+       ("python-coverage" ,python-coverage)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/asottile/cfgv")
+    (synopsis "Configuration validation library")
+    (description
+     "This library helps to validate configuration files and produce human
+readable error messages.")
+    (license license:expat)))
+
 (define-public python-commandlines
   (package
     (name "python-commandlines")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH v2 3/6] gnu: Add python-identify.
  2020-07-24 12:01 ` [bug#42082] [PATCH v2 " Vinicius Monego
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 2/6] gnu: Add python-cfgv Vinicius Monego
@ 2020-07-24 12:01   ` Vinicius Monego
  2020-07-25 16:33     ` Marius Bakke
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 4/6] gnu: Add python-nodeenv Vinicius Monego
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 25+ messages in thread
From: Vinicius Monego @ 2020-07-24 12:01 UTC (permalink / raw)
  To: 42082; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-identify): New variable.
---
Update to 1.4.25.

 gnu/packages/python-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0bc2b06cf5..87ea9fcaa2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -162,6 +162,7 @@
   #:use-module (gnu packages terminals)
   #:use-module (gnu packages tex)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
@@ -17269,6 +17270,39 @@ library to allow local file system access via @code{file://} URLs.")
 (define-public python2-requests-file
   (package-with-python2 python-requests-file))
 
+(define-public python-identify
+  (package
+    (name "python-identify")
+    (version "1.4.25")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/chriskuehl/identify")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1fqgci6skckcq0x5pnxh6k2qjzn1ndsrgha1j6wwv1ld4g9bd3hz"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv"))))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-editdistance" ,python-editdistance)))
+    (home-page "https://github.com/chriskuehl/identify")
+    (synopsis "File identification library for Python")
+    (description
+     "File identification library for Python.  Given a file (or some information
+about a file), return a set of standardized tags identifying what the file is.")
+    (license license:expat)))
+
 (define-public python-tldextract
   (package
     (name "python-tldextract")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH v2 4/6] gnu: Add python-nodeenv.
  2020-07-24 12:01 ` [bug#42082] [PATCH v2 " Vinicius Monego
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 2/6] gnu: Add python-cfgv Vinicius Monego
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 3/6] gnu: Add python-identify Vinicius Monego
@ 2020-07-24 12:01   ` Vinicius Monego
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 5/6] gnu: Add python-pytest-env Vinicius Monego
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 6/6] gnu: Add python-pre-commit Vinicius Monego
  4 siblings, 0 replies; 25+ messages in thread
From: Vinicius Monego @ 2020-07-24 12:01 UTC (permalink / raw)
  To: 42082; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-nodeenv): New variable.
---
I decided to leave this package in the same file and format of virtualenv.

Removed python-tox and python-flake8 from native inputs. Fixed synopsis.

 gnu/packages/python-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 87ea9fcaa2..a8bdc90f44 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17336,6 +17336,41 @@ 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"))))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-mock" ,python-mock)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://ekalinin.github.io/nodeenv/")
+    (synopsis "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")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH v2 5/6] gnu: Add python-pytest-env.
  2020-07-24 12:01 ` [bug#42082] [PATCH v2 " Vinicius Monego
                     ` (2 preceding siblings ...)
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 4/6] gnu: Add python-nodeenv Vinicius Monego
@ 2020-07-24 12:01   ` Vinicius Monego
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 6/6] gnu: Add python-pre-commit Vinicius Monego
  4 siblings, 0 replies; 25+ messages in thread
From: Vinicius Monego @ 2020-07-24 12:01 UTC (permalink / raw)
  To: 42082; +Cc: Vinicius Monego

* gnu/packages/python-check.scm (python-pytest-env): New variable.
---
Do not propagate pytest.

 gnu/packages/python-check.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index be9b1def26..d6e38bd88b 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -438,6 +438,26 @@ rounds that are calibrated to the chosen timer.")
      "This pytest plugin provides fixtures to simplify Flask app testing.")
     (license license:expat)))
 
+(define-public python-pytest-env
+  (package
+    (name "python-pytest-env")
+    (version "0.6.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-env" version))
+       (sha256
+        (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/MobileDynasty/pytest-env")
+    (synopsis "Pytest plugin that allows you to add environment variables")
+    (description
+     "This is a @code{py.test} plugin that enables you to set environment
+variables in the @file{pytest.ini} file.")
+    (license license:expat)))
+
 (define-public python-codacy-coverage
   (package
     (name "python-codacy-coverage")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH v2 6/6] gnu: Add python-pre-commit.
  2020-07-24 12:01 ` [bug#42082] [PATCH v2 " Vinicius Monego
                     ` (3 preceding siblings ...)
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 5/6] gnu: Add python-pytest-env Vinicius Monego
@ 2020-07-24 12:01   ` Vinicius Monego
  2020-07-25 16:38     ` bug#42082: " Marius Bakke
  4 siblings, 1 reply; 25+ messages in thread
From: Vinicius Monego @ 2020-07-24 12:01 UTC (permalink / raw)
  To: 42082; +Cc: Vinicius Monego

* gnu/packages/version-control.scm (pre-commit): New variable.
---
Enable tests. Update to 2.6.0.

Language tests require interpreters/compilers and build systems as inputs
and downloading packages online (e.g. 'go get'), hence disabled.

 gnu/packages/version-control.scm | 113 +++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 5151e63ee1..d36b7c013e 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2020 John D. Boy <jboy@bius.moe>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1418,6 +1419,118 @@ also walk each side of a merge and test those changes individually.")
 control to Git repositories.")
     (license license:gpl2)))
 
+(define-public pre-commit
+  (package
+    (name "pre-commit")
+    (version "2.6.0")
+    (source
+     (origin
+       ;; No tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/pre-commit/pre-commit")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "144hcnz8vz07nkx7hk8a3ac822186ardwxa8jnl6s8qvm5ip92f2"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'set-up-git
+           (lambda _
+             ;; Change from /homeless-shelter to /tmp for write permission.
+             (setenv "HOME" "/tmp")
+             ;; Environment variables used in the tests.
+             (setenv "GIT_AUTHOR_NAME" "Your Name")
+             (setenv "GIT_COMMITTER_NAME" "Your Name")
+             (setenv "GIT_AUTHOR_EMAIL" "you@example.com")
+             (setenv "GIT_COMMITTER_EMAIL" "you@example.com")
+             (invoke "git" "config" "--global" "user.name" "Your Name")
+             (invoke "git" "config" "--global" "user.email" "you@example.com")
+           #t))
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "tests" "-k"
+                     (string-append
+                     ;; Disable conda tests.
+                      "not test_conda_hook"
+                      " and not test_conda_with_additional_dependencies_hook"
+                      " and not test_local_conda_additional_dependencies"
+                      ;; Disable cpan tests.
+                      " and not test_local_perl_additional_dependencies"
+                      " and not test_perl_hook"
+                      ;; Disable Ruby tests.
+                      " and not test_additional_ruby_dependencies_installed"
+                      " and not test_install_rbenv"
+                      " and not test_install_rbenv_with_version"
+                      " and not test_run_a_ruby_hook"
+                      " and not test_run_ruby_hook_with_disable_shared_gems"
+                      " and not test_run_versioned_ruby_hook"
+                      ;; Disable Cargo tests
+                      " and not test_additional_rust_cli_dependencies_installed"
+                      " and not test_additional_rust_lib_dependencies_installed"
+                      " and not test_local_rust_additional_dependencies"
+                      " and not test_rust_hook"
+                      ;; Disable python2 test.
+                      " and not test_switch_language_versions_doesnt_clobber"
+                      ;; These tests try to open a network socket.
+                      " and not test_additional_golang_dependencies_installed"
+                      " and not test_additional_node_dependencies_installed"
+                      " and not test_golang_hook"
+                      " and not test_golang_hook_still_works_when_gobin_is_set"
+                      " and not test_local_golang_additional_dependencies"
+                      " and not test_main"
+                      " and not test_node_hook_with_npm_userconfig_set"
+                      " and not test_run_a_node_hook"
+                      " and not test_run_versioned_node_hook"
+                      ;; Tests failing with a permission error.
+                      ;; They try to write to the filesystem.
+                      " and not test_autoupdate_hook_disappearing_repo"
+                      " and not test_hook_disppearing_repo_raises"
+                      " and not test_img_conflict"
+                      " and not test_img_something_unstaged"
+                      " and not test_installed_from_venv"
+                      " and not test_too_new_version"
+                      " and not test_try_repo_uncommitted_changes"
+                      " and not test_versions_ok"
+                      ;; This test tries to activate a virtualenv
+                      " and not test_healthy_venv_creator"
+                      ;; Fatal error: Not a Git repository.
+                      " and not test_all_cmds"
+                      " and not test_try_repo"
+                      ;; No module named 'pip._internal.cli.main'
+                      " and not test_additional_dependencies_roll_forward"
+                      ; Assertion errors
+                      " and not test_install_existing_hooks_no_overwrite"
+                      " and not test_uninstall_restores_legacy_hooks"))))
+         (add-before 'reset-gzip-timestamps 'make-files-writable
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Make sure .gz files are writable so that the
+             ;; 'reset-gzip-timestamps' phase can do its work.
+             (let ((out (assoc-ref outputs "out")))
+               (for-each make-file-writable
+                         (find-files out "\\.gz$"))
+               #t))))))
+    (native-inputs
+     `(("git" ,git)
+       ("python-pytest" ,python-pytest)))
+    (inputs
+     `(("python-cfgv" ,python-cfgv)
+       ("python-identify" ,python-identify)
+       ("python-nodeenv" ,python-nodeenv)
+       ("python-pyyaml" ,python-pyyaml)
+       ("python-toml" ,python-toml)
+       ("python-virtualenv" ,python-virtualenv)))
+    (home-page "https://pre-commit.com/")
+    (synopsis "Framework for managing and maintaining multi-language pre-commit hooks")
+    (description
+     "Pre-commit is a multi-language package manager for pre-commit hooks.  You
+specify a list of hooks you want and pre-commit manages the installation and
+execution of any hook written in any language before every commit.")
+    (license license:expat)))
+
 (define (mercurial-patch name revision hash)
   (origin
     (method url-fetch)
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults.
  2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
                   ` (6 preceding siblings ...)
  2020-07-24 12:01 ` [bug#42082] [PATCH v2 " Vinicius Monego
@ 2020-07-25  2:21 ` Brett Gilio
  7 siblings, 0 replies; 25+ messages in thread
From: Brett Gilio @ 2020-07-25  2:21 UTC (permalink / raw)
  To: Vinicius Monego; +Cc: control, 42082

merge 42082 42083 42084 42085 42086 42087




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#42082] [PATCH v2 3/6] gnu: Add python-identify.
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 3/6] gnu: Add python-identify Vinicius Monego
@ 2020-07-25 16:33     ` Marius Bakke
  0 siblings, 0 replies; 25+ messages in thread
From: Marius Bakke @ 2020-07-25 16:33 UTC (permalink / raw)
  To: Vinicius Monego, 42082; +Cc: Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

Vinicius Monego <monego@posteo.net> writes:

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

[...]
> +    (description
> +     "File identification library for Python.  Given a file (or some information
> +about a file), return a set of standardized tags identifying what the file is.")

I turned this into "@code{identify} is a [...]".  Applied!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#42082: [PATCH v2 6/6] gnu: Add python-pre-commit.
  2020-07-24 12:01   ` [bug#42082] [PATCH v2 6/6] gnu: Add python-pre-commit Vinicius Monego
@ 2020-07-25 16:38     ` Marius Bakke
  0 siblings, 0 replies; 25+ messages in thread
From: Marius Bakke @ 2020-07-25 16:38 UTC (permalink / raw)
  To: Vinicius Monego, 42082-done; +Cc: Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 4043 bytes --]

Vinicius Monego <monego@posteo.net> writes:

> * gnu/packages/version-control.scm (pre-commit): New variable.
> ---
> Enable tests. Update to 2.6.0.
>
> Language tests require interpreters/compilers and build systems as inputs
> and downloading packages online (e.g. 'go get'), hence disabled.

Makes sense.

[...]
  
> +         (replace 'check
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (add-installed-pythonpath inputs outputs)
> +             (invoke "pytest" "tests" "-k"
> +                     (string-append
> +                     ;; Disable conda tests.
> +                      "not test_conda_hook"
> +                      " and not test_conda_with_additional_dependencies_hook"
> +                      " and not test_local_conda_additional_dependencies"
> +                      ;; Disable cpan tests.
> +                      " and not test_local_perl_additional_dependencies"
> +                      " and not test_perl_hook"
> +                      ;; Disable Ruby tests.
> +                      " and not test_additional_ruby_dependencies_installed"
> +                      " and not test_install_rbenv"
> +                      " and not test_install_rbenv_with_version"
> +                      " and not test_run_a_ruby_hook"
> +                      " and not test_run_ruby_hook_with_disable_shared_gems"
> +                      " and not test_run_versioned_ruby_hook"
> +                      ;; Disable Cargo tests
> +                      " and not test_additional_rust_cli_dependencies_installed"
> +                      " and not test_additional_rust_lib_dependencies_installed"
> +                      " and not test_local_rust_additional_dependencies"
> +                      " and not test_rust_hook"
> +                      ;; Disable python2 test.
> +                      " and not test_switch_language_versions_doesnt_clobber"
> +                      ;; These tests try to open a network socket.
> +                      " and not test_additional_golang_dependencies_installed"
> +                      " and not test_additional_node_dependencies_installed"
> +                      " and not test_golang_hook"
> +                      " and not test_golang_hook_still_works_when_gobin_is_set"
> +                      " and not test_local_golang_additional_dependencies"
> +                      " and not test_main"
> +                      " and not test_node_hook_with_npm_userconfig_set"
> +                      " and not test_run_a_node_hook"
> +                      " and not test_run_versioned_node_hook"
> +                      ;; Tests failing with a permission error.
> +                      ;; They try to write to the filesystem.
> +                      " and not test_autoupdate_hook_disappearing_repo"
> +                      " and not test_hook_disppearing_repo_raises"
> +                      " and not test_img_conflict"
> +                      " and not test_img_something_unstaged"
> +                      " and not test_installed_from_venv"
> +                      " and not test_too_new_version"
> +                      " and not test_try_repo_uncommitted_changes"
> +                      " and not test_versions_ok"
> +                      ;; This test tries to activate a virtualenv
> +                      " and not test_healthy_venv_creator"
> +                      ;; Fatal error: Not a Git repository.
> +                      " and not test_all_cmds"
> +                      " and not test_try_repo"
> +                      ;; No module named 'pip._internal.cli.main'
> +                      " and not test_additional_dependencies_roll_forward"
> +                      ; Assertion errors
> +                      " and not test_install_existing_hooks_no_overwrite"
> +                      " and not test_uninstall_restores_legacy_hooks"))))

Wooooow, nice work!

I've applied this and the other patches in the series.  Thanks again!  :-)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2020-07-25 16:39 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-27 15:46 [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Vinicius Monego
2020-06-27 15:46 ` [bug#42083] [PATCH 2/6] gnu: Add python-cfgv Vinicius Monego
2020-07-20 21:17   ` Marius Bakke
2020-06-27 15:46 ` [bug#42084] [PATCH 3/6] gnu: Add python-identify Vinicius Monego
2020-07-20 21:17   ` Marius Bakke
2020-06-27 15:46 ` [bug#42085] [PATCH 4/6] gnu: Add python-nodeenv Vinicius Monego
2020-07-20 21:25   ` Marius Bakke
2020-07-21 18:42     ` Vinicius Monego
2020-06-27 15:46 ` [bug#42086] [PATCH 5/6] gnu: Add python-pytest-env Vinicius Monego
2020-07-20 21:27   ` Marius Bakke
2020-06-27 15:46 ` [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit Vinicius Monego
2020-07-20 21:36   ` Marius Bakke
2020-07-21 18:57     ` Vinicius Monego
2020-07-20 21:13 ` [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Marius Bakke
2020-07-21 18:28   ` Vinicius Monego
2020-07-21 21:48     ` Marius Bakke
2020-07-24 12:01 ` [bug#42082] [PATCH v2 " Vinicius Monego
2020-07-24 12:01   ` [bug#42082] [PATCH v2 2/6] gnu: Add python-cfgv Vinicius Monego
2020-07-24 12:01   ` [bug#42082] [PATCH v2 3/6] gnu: Add python-identify Vinicius Monego
2020-07-25 16:33     ` Marius Bakke
2020-07-24 12:01   ` [bug#42082] [PATCH v2 4/6] gnu: Add python-nodeenv Vinicius Monego
2020-07-24 12:01   ` [bug#42082] [PATCH v2 5/6] gnu: Add python-pytest-env Vinicius Monego
2020-07-24 12:01   ` [bug#42082] [PATCH v2 6/6] gnu: Add python-pre-commit Vinicius Monego
2020-07-25 16:38     ` bug#42082: " Marius Bakke
2020-07-25  2:21 ` [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults Brett Gilio

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.