[PATCH 6/6] gnu: Add python-pre-commit.

  • Done
  • quality assurance status badge
Details
3 participants
  • Brett Gilio
  • Marius Bakke
  • Vinicius Monego
Owner
unassigned
Submitted by
Vinicius Monego
Severity
normal
Merged with
V
V
Vinicius Monego wrote on 27 Jun 2020 17:46
(address . guix-patches@gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20200627154645.64264-6-monego@posteo.net
* gnu/packages/python-xyz.scm (python-pre-commit): New variable.
---
gnu/packages/python-xyz.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (41 lines)
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
M
M
Marius Bakke wrote on 20 Jul 2020 23:36
(name . Vinicius Monego)(address . monego@posteo.net)
87o8o9hnrq.fsf@gnu.org
Vinicius Monego <monego@posteo.net> writes:

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

[...]
Toggle quote (14 lines)
> +(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?

Toggle quote (8 lines)
> + (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?

Toggle quote (7 lines)
> + (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.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl8WDmkACgkQoqBt8qM6
VPp8PwgAkqQWqUdEDgFvQtFDc3oNMlRPFKPghhG8Tjx8uKkPEfANECLq3PIxy+5G
O93fzO1/B/5zEynv/N3teIJkLfcQLe8C1SSQtNlJsN/dRRh5uULGiBs6cSZpH7f5
5pRfA2LXuM28NI8w9fppoPhLoZHWUsbnI38MZgvf+YlP9HunEcoJRnQQACaDwKdR
iRk+DUlSQbmLp+C+aIzsc+ie8eykZoWjdBPJdFXvnpViQulkYtmFKs/xijCxtJpV
FN8D70UssPHIgScXsRbJUUB5B1uXkXvEYciYkRPg7WPGsaRUyrYOPfuqH8w7hjiH
DnoGbqTUoQmxsKROk9cGJpy+UK+7iw==
=d+5M
-----END PGP SIGNATURE-----

V
V
Vinicius Monego wrote on 21 Jul 2020 20:57
52c2671a6aeffc4aa22bba631a871965317b7217.camel@posteo.net
Em seg, 2020-07-20 às 23:36 +0200, Marius Bakke escreveu:

Toggle quote (8 lines)
> 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.

Toggle quote (7 lines)
> 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.

Toggle quote (4 lines)
> Also, maybe we can omit the python- prefix here too, and perhaps
> place
> it in version-control.scm?

That makes sense to me.

Toggle quote (2 lines)
> Can you send a v2 series?

I will bump some versions, enable tests here and send a v2 by the
weekend.
B
B
Brett Gilio wrote on 25 Jul 2020 04:21
Re: [bug#42082] [PATCH 1/6] gnu: Add python-covdefaults.
(name . Vinicius Monego)(address . monego@posteo.net)
87r1t02v2m.fsf@gnu.org
merge 42082 42083 42084 42085 42086 42087
?