GNU bug report logs - #42087
[PATCH 6/6] gnu: Add python-pre-commit.

Previous Next

Package: guix-patches;

Reported by: Vinicius Monego <monego <at> posteo.net>

Date: Sat, 27 Jun 2020 15:48:04 UTC

Severity: normal

Tags: patch

Merged with 42082, 42083, 42084, 42085, 42086

Done: Marius Bakke <marius <at> gnu.org>

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 42087 in the body.
You can then email your comments to 42087 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#42087; Package guix-patches. (Sat, 27 Jun 2020 15:48:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vinicius Monego <monego <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 27 Jun 2020 15:48:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Vinicius Monego <monego <at> posteo.net>
Subject: [PATCH 6/6] gnu: Add python-pre-commit.
Date: Sat, 27 Jun 2020 12:46:45 -0300
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#42087; Package guix-patches. (Mon, 20 Jul 2020 21:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 42087 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Vinicius Monego <monego <at> posteo.net>, 42087 <at> debbugs.gnu.org
Cc: Vinicius Monego <monego <at> posteo.net>
Subject: Re: [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit.
Date: Mon, 20 Jul 2020 23:36:41 +0200
[Message part 1 (text/plain, inline)]
Vinicius Monego <monego <at> 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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#42087; Package guix-patches. (Tue, 21 Jul 2020 18:58:01 GMT) Full text and rfc822 format available.

Message #11 received at 42087 <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: Marius Bakke <marius <at> gnu.org>, 42087 <at> debbugs.gnu.org
Subject: Re: [bug#42087] [PATCH 6/6] gnu: Add python-pre-commit.
Date: Tue, 21 Jul 2020 15:57:14 -0300
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.





Merged 42082 42083 42084 42085 42086 42087. Request was from Brett Gilio <brettg <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 25 Jul 2020 02:22:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Aug 2020 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.