16 # coupled downsteam dependencies
20 buildPythonPackage rec {
25 src = fetchFromGitHub {
28 rev = "refs/tags/${version}";
29 hash = "sha256-mUlzfYmq1FE3X1/2o7sYJzMgwHRI4ib4EMhpg83VvrI=";
33 # Remove vendored Windows PE binaries
34 # Note: These are unused but make the package unreproducible.
35 find -type f -name '*.exe' -delete
52 # pip uses a custom sphinx extension and unusual conf.py location, mimic the internal build rather than attempting
53 # to fit sphinxHook see https://github.com/pypa/pip/blob/0778c1c153da7da457b56df55fb77cbba08dfb0c/noxfile.py#L129-L148
57 # remove references to sphinx extentions only required for html doc generation
58 # sphinx.ext.intersphinx requires network connection or packaged object.inv files for python and pypug
59 # sphinxcontrib.towncrier is not currently packaged
60 for ext in sphinx.ext.intersphinx sphinx_copybutton sphinx_inline_tabs sphinxcontrib.towncrier myst_parser; do
61 substituteInPlace html/conf.py --replace '"'$ext'",' ""
64 PYTHONPATH=$src/src:$PYTHONPATH sphinx-build -v \
65 -d build/doctrees/man \
67 -d build/doctrees/man \
74 nativeCheckInputs = [ mock scripttest virtualenv pretend pytest ];
76 # Pip wants pytest, but tests are not distributed
80 installManPage docs/build/man/*
82 installShellCompletion --cmd pip \
83 --bash <($out/bin/pip completion --bash --no-cache-dir) \
84 --fish <($out/bin/pip completion --fish --no-cache-dir) \
85 --zsh <($out/bin/pip completion --zsh --no-cache-dir)
88 passthru.tests = { inherit pip-tools; };
91 description = "The PyPA recommended tool for installing Python packages";
92 license = with lib.licenses; [ mit ];
93 homepage = "https://pip.pypa.io/";
94 changelog = "https://pip.pypa.io/en/stable/news/#v${lib.replaceStrings [ "." ] [ "-" ] version}";