New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-remote-hg: fix; refactor #93298
git-remote-hg: fix; refactor #93298
Conversation
This package needs to use the same Python as Mercurial, but the released version doesn't support Python 3.
This exposes mercurial as a Python library. Packages that call into Mercurial from Python can now do so in a less hacky way.
@@ -1,36 +1,38 @@ | |||
{ stdenv, lib, fetchFromGitHub, mercurial, makeWrapper | |||
{ stdenv, lib, fetchFromGitHub, python3Packages, makeWrapper | |||
, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt, libxml2 | |||
}: | |||
|
|||
stdenv.mkDerivation rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use buildPythonApplication? This brings in wrapPython and does that postFixup thingy etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff LGTM
doCheck = false; | ||
|
||
installFlags = [ "HOME=\${out}" "install-doc" ]; | ||
pythonPath = with python3Packages; [ mercurial ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that it's a pythonApplication
pythonPath = with python3Packages; [ mercurial ]; | |
propagatedBuilInputs = with python3Packages; [ mercurial ]; |
but it doesn't really matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come it needs to be propagated? This isn’t a library, so it should only be used through the executable wrapper, which includes Mercurial anyway, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's how python packaging works on nixpkgs https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md#buildpythonapplication-function, the transitive python package set is constructed off of propagated python packages.
buildPythonApplication
will "end" this propagation to other packages which use git-remote-hg
This is much cleaner than constructing PYTHONPATH using interpolated subshells.
ffc6945
to
8c05e03
Compare
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)