diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-09-12 08:14:37 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-09-12 08:14:37 +0000 |
commit | 7d648ac22d941d0c7efdd987315ae0ddf9932ba0 (patch) | |
tree | 51a3e8126722c5a52a9a1e7e40b4eeaf4610db0b /nixpkgs/pkgs/development/python-modules/pip/default.nix | |
parent | aa4353b499e6950b7333578f936455a628145c31 (diff) | |
parent | db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b (diff) | |
download | nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.gz nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.bz2 nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.lz nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.xz nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.zst nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.zip |
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pip/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pip/default.nix | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pip/default.nix b/nixpkgs/pkgs/development/python-modules/pip/default.nix index bc06cb39e247..484a15e85876 100644 --- a/nixpkgs/pkgs/development/python-modules/pip/default.nix +++ b/nixpkgs/pkgs/development/python-modules/pip/default.nix @@ -10,6 +10,9 @@ , pretend , pytest +# docs +, sphinx + # coupled downsteam dependencies , pip-tools }: @@ -36,18 +39,50 @@ buildPythonPackage rec { installShellFiles setuptools wheel + + # docs + sphinx ]; + outputs = [ + "out" + "man" + ]; + + # pip uses a custom sphinx extension and unusual conf.py location, mimic the internal build rather than attempting + # to fit sphinxHook see https://github.com/pypa/pip/blob/0778c1c153da7da457b56df55fb77cbba08dfb0c/noxfile.py#L129-L148 + postBuild = '' + cd docs + + # remove references to sphinx extentions only required for html doc generation + # sphinx.ext.intersphinx requires network connection or packaged object.inv files for python and pypug + # sphinxcontrib.towncrier is not currently packaged + for ext in sphinx.ext.intersphinx sphinx_copybutton sphinx_inline_tabs sphinxcontrib.towncrier myst_parser; do + substituteInPlace html/conf.py --replace '"'$ext'",' "" + done + + PYTHONPATH=$src/src:$PYTHONPATH sphinx-build -v \ + -d build/doctrees/man \ + -c html \ + -d build/doctrees/man \ + -b man \ + man \ + build/man + cd .. + ''; + nativeCheckInputs = [ mock scripttest virtualenv pretend pytest ]; # Pip wants pytest, but tests are not distributed doCheck = false; postInstall = '' + installManPage docs/build/man/* + installShellCompletion --cmd pip \ - --bash <($out/bin/pip completion --bash) \ - --fish <($out/bin/pip completion --fish) \ - --zsh <($out/bin/pip completion --zsh) + --bash <($out/bin/pip completion --bash --no-cache-dir) \ + --fish <($out/bin/pip completion --fish --no-cache-dir) \ + --zsh <($out/bin/pip completion --zsh --no-cache-dir) ''; passthru.tests = { inherit pip-tools; }; |