2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, docutils, pygments
|
ydiff,gitAndTools.ydiff: unify
We were packaging ydiff twice!
In this patch, I've merged the two expressions into one, trying to
take the best of each. ydiff (top-level) didn't support being used as
a Python library, which is required by one other package (patroni), so
I chose gitAndTools.ydiff as the starting point, then moved in the
longDescription from the top-level one, as well as the code used to
run the tests.
While I was there, I fixed the tests, which were intended to be run by
the top-level ydiff but actually were not, because unlike mkDerivation
buildPythonApplication will not run `make test' by default.
Also, top-level ydiff previously propagated less and patchutils,
meaning they'd have been installed globally instead of just referenced
by ydiff. gitAndTools.ydiff just did nothing. Both also expected to
find git, hg, and svn in the environment, which was impure. So now
all these programs are referenced by store path from ydiff, for
purity.
2021-01-14 10:26:34 +00:00
|
|
|
, gitMinimal, mercurial, subversion, patchutils, less
|
|
|
|
}:
|
2020-02-10 13:11:56 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ydiff";
|
2020-08-16 17:31:20 +00:00
|
|
|
version = "1.2";
|
2020-02-10 13:11:56 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-08-16 17:31:20 +00:00
|
|
|
sha256 = "f5430577ecd30974d766ee9b8333e06dc76a947b4aae36d39612a0787865a121";
|
2020-02-10 13:11:56 +00:00
|
|
|
};
|
|
|
|
|
ydiff,gitAndTools.ydiff: unify
We were packaging ydiff twice!
In this patch, I've merged the two expressions into one, trying to
take the best of each. ydiff (top-level) didn't support being used as
a Python library, which is required by one other package (patroni), so
I chose gitAndTools.ydiff as the starting point, then moved in the
longDescription from the top-level one, as well as the code used to
run the tests.
While I was there, I fixed the tests, which were intended to be run by
the top-level ydiff but actually were not, because unlike mkDerivation
buildPythonApplication will not run `make test' by default.
Also, top-level ydiff previously propagated less and patchutils,
meaning they'd have been installed globally instead of just referenced
by ydiff. gitAndTools.ydiff just did nothing. Both also expected to
find git, hg, and svn in the environment, which was impure. So now
all these programs are referenced by store path from ydiff, for
purity.
2021-01-14 10:26:34 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace ydiff.py \
|
|
|
|
--replace "['git'" "['${gitMinimal}/bin/git'" \
|
|
|
|
--replace "['hg'" "['${mercurial}/bin/hg'" \
|
|
|
|
--replace "['svn'" "['${subversion}/bin/svn'" \
|
|
|
|
--replace "['filterdiff'" "['${patchutils}/bin/filterdiff'" \
|
|
|
|
--replace "['less'" "['${less}/bin/less'" # doesn't support PAGER from env
|
|
|
|
substituteInPlace tests/test_ydiff.py \
|
|
|
|
--replace /bin/rm rm \
|
|
|
|
--replace /bin/sh sh
|
|
|
|
patchShebangs setup.py
|
|
|
|
patchShebangs tests/*.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ docutils pygments ];
|
|
|
|
|
2020-02-10 13:11:56 +00:00
|
|
|
checkPhase = ''
|
ydiff,gitAndTools.ydiff: unify
We were packaging ydiff twice!
In this patch, I've merged the two expressions into one, trying to
take the best of each. ydiff (top-level) didn't support being used as
a Python library, which is required by one other package (patroni), so
I chose gitAndTools.ydiff as the starting point, then moved in the
longDescription from the top-level one, as well as the code used to
run the tests.
While I was there, I fixed the tests, which were intended to be run by
the top-level ydiff but actually were not, because unlike mkDerivation
buildPythonApplication will not run `make test' by default.
Also, top-level ydiff previously propagated less and patchutils,
meaning they'd have been installed globally instead of just referenced
by ydiff. gitAndTools.ydiff just did nothing. Both also expected to
find git, hg, and svn in the environment, which was impure. So now
all these programs are referenced by store path from ydiff, for
purity.
2021-01-14 10:26:34 +00:00
|
|
|
runHook preCheck
|
|
|
|
make doc-check reg # We don't want the linter or coverage check.
|
|
|
|
runHook postCheck
|
2020-02-10 13:11:56 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-02-10 13:11:56 +00:00
|
|
|
description = "View colored, incremental diff in workspace or from stdin with side by side and auto pager support (Was \"cdiff\")";
|
|
|
|
longDescription = ''
|
ydiff,gitAndTools.ydiff: unify
We were packaging ydiff twice!
In this patch, I've merged the two expressions into one, trying to
take the best of each. ydiff (top-level) didn't support being used as
a Python library, which is required by one other package (patroni), so
I chose gitAndTools.ydiff as the starting point, then moved in the
longDescription from the top-level one, as well as the code used to
run the tests.
While I was there, I fixed the tests, which were intended to be run by
the top-level ydiff but actually were not, because unlike mkDerivation
buildPythonApplication will not run `make test' by default.
Also, top-level ydiff previously propagated less and patchutils,
meaning they'd have been installed globally instead of just referenced
by ydiff. gitAndTools.ydiff just did nothing. Both also expected to
find git, hg, and svn in the environment, which was impure. So now
all these programs are referenced by store path from ydiff, for
purity.
2021-01-14 10:26:34 +00:00
|
|
|
Term based tool to view colored, incremental diff in a version
|
|
|
|
controlled workspace (supports Git, Mercurial, Perforce and Svn
|
|
|
|
so far) or from stdin, with side by side (similar to diff -y)
|
|
|
|
and auto pager support.
|
2020-02-10 13:11:56 +00:00
|
|
|
'';
|
|
|
|
homepage = "https://github.com/ymattw/ydiff";
|
|
|
|
license = licenses.bsd3;
|
ydiff,gitAndTools.ydiff: unify
We were packaging ydiff twice!
In this patch, I've merged the two expressions into one, trying to
take the best of each. ydiff (top-level) didn't support being used as
a Python library, which is required by one other package (patroni), so
I chose gitAndTools.ydiff as the starting point, then moved in the
longDescription from the top-level one, as well as the code used to
run the tests.
While I was there, I fixed the tests, which were intended to be run by
the top-level ydiff but actually were not, because unlike mkDerivation
buildPythonApplication will not run `make test' by default.
Also, top-level ydiff previously propagated less and patchutils,
meaning they'd have been installed globally instead of just referenced
by ydiff. gitAndTools.ydiff just did nothing. Both also expected to
find git, hg, and svn in the environment, which was impure. So now
all these programs are referenced by store path from ydiff, for
purity.
2021-01-14 10:26:34 +00:00
|
|
|
maintainers = (with maintainers; [ leenaars ]) ++ teams.deshaw.members;
|
2020-02-10 13:11:56 +00:00
|
|
|
};
|
|
|
|
}
|