Skip to content
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

fix docs live-preview.sh script #3789

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nix/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ in rec {
yapf = pkgs.python37Packages.yapf;

pex = pkgs.python37Packages.pex;
pipenv = pkgs.pipenv;
pipenv = import ./tools/pipenv {
lib = pkgs.stdenv.lib;
python3 = python3;
};

sphinx = pkgs.python37.withPackages (ps: [ps.sphinx ps.sphinx_rtd_theme]);
sphinx-build = sphinx;
Expand Down
59 changes: 59 additions & 0 deletions nix/tools/pipenv/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# copied from
# https://raw.githubusercontent.com/NixOS/nixpkgs/1c406512eb6331ca4d75e0d63298c5e0e7009fdd/pkgs/development/tools/pipenv/default.nix
# then modified to disable check phase (line 46)

{ lib
, python3
}:

with python3.pkgs;

let

runtimeDeps = [
certifi
setuptools
pip
virtualenv
virtualenv-clone
];

pythonEnv = python3.withPackages(ps: with ps; [ virtualenv ]);

in buildPythonApplication rec {
pname = "pipenv";
version = "2018.11.26";

src = fetchPypi {
inherit pname version;
sha256 = "0ip8zsrwmhrankrix0shig9g8q2knmr7b63sh7lqa8a5x03fcwx6";
};

LC_ALL = "en_US.UTF-8";

postPatch = ''
# pipenv invokes python in a subprocess to create a virtualenv
# it uses sys.executable which will point in our case to a python that
# does not have virtualenv.
substituteInPlace pipenv/core.py \
--replace "vistir.compat.Path(sys.executable).absolute().as_posix()" "vistir.compat.Path('${pythonEnv.interpreter}').absolute().as_posix()"
'';

nativeBuildInputs = [ invoke parver ];

propagatedBuildInputs = runtimeDeps;

doCheck = false;
checkPhase = ''
export HOME=$(mktemp -d)
cp -r --no-preserve=mode ${wheel.src} $HOME/wheel-src
$out/bin/pipenv install $HOME/wheel-src
'';

meta = with lib; {
description = "Python Development Workflow for Humans";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ berdario ];
};
}