Change:
Describe the bug Tensorflow binary builds don't work on mac os. (neither do the source build, but that's a separate issue) To Reproduce $ nix-build '<nixpkgs' --show-trace -A python37Packages.tensorflow-bin_2 this derivation will be built: /nix/store/cc5p6r864smaf5mm8bqb9dbp6d7jkb3x-python3.7-tensorflow- building '/nix/store/cc5p6r864smaf5mm8bqb9dbp6d7jkb3x-python3.7-tensorflow-'... Sourcing python-recompile-bytecode- Sourcing python-remove-tests-dir-hook Sourcing python-catch-conflicts- Sourcing python-remove-bin-bytecode- Sourcing wheel setup hook Using wheelUnpackPhase Sourcing pip-install-hook Using pipInstallPhase Sourcing python-imports-check- Using pythonImportsCheckPhase Sourcing python-namespaces-hook unpacking sources Executing wheelUnpackPhase Finished executing wheelUnpackPhase patching sources configuring /private/tmp/nix-build-python3.7-tensorflow- /private/tmp/nix-build-python3.7-tensorflow- Unpacking to: unpacked/tensorflow-2.1.0...OK substitute(): ERROR: file '--replace' does not exist error: --- Error
--------------------------------------------------------------------------- nix-build builder for '/nix/store/cc5p6r864smaf5mm8bqb9dbp6d7jkb3x-python3.7-tensorflow-' failed with exit code 1 host os: multi-user?: sandbox: version: channels(noah): nixpkgs: yaml attribute: module:

Discussion:
{ lib <ins> , stdenv </ins> , buildPythonPackage , fetchPypi , click

pytestCheckHook ]; <ins> disabledTests = lib.optionals stdenv.isDarwin [ "test_run_local_server" ]; </ins> meta = with lib; { description = "Google Authentication Library: oauthlib integration"; homepage = "https://github.com/GoogleCloudPlatform/google-auth-library-python-oauthlib";

<del> { lib </del> <ins> { stdenv , lib </ins> , buildPythonPackage , fetchpatch , fetchPypi

"google.oauth2" ]; <ins> disabledTests = lib.optionals stdenv.isDarwin [ "test_request_with_timeout_success" "test_request_with_timeout_failure" "test_request_headers" "test_request_error" "test_request_basic" ]; </ins> meta = with lib; { description = "Google Auth Python Library"; longDescription = ''

<del> { lib </del> <ins> { stdenv , lib </ins> , buildPythonPackage , fetchFromGitHub , isPy27

pytestCheckHook ]; <del> # Don't run tests for Python 2.7 doCheck = !isPy27; </del> <ins> # Don't run tests for Python 2.7 or Darwin # Nearly 50% of the test suite requires local network access # which isn't allowed on sandboxed Darwin builds doCheck = !(isPy27 || stdenv.isDarwin); </ins> pytestFlagsArray = [ "--ignore python2" ]; pythonImportsCheck = [ "httplib2" ];

# Unpack the wheel file. wheel unpack --dest unpacked ./*.whl <del> # Tensorflow has a hard dependency on gast==0.2.2, but we relax it to # gast==0.3.2. substituteInPlace ./unpacked/tensorflow*/tensorflow_core/tools/pip_package/setup.py --replace "gast == 0.2.2" "gast == 0.3.2" substituteInPlace ./unpacked/tensorflow*/tensorflow_*.dist-info/METADATA --replace "gast (==0.2.2)" "gast (==0.3.2)" </del> <ins> # Tensorflow wheels tightly constrain the versions of gast, tensorflow-estimator and scipy. # This code relaxes these requirements: substituteInPlace ./unpacked/tensorflow*/tensorflow_core/tools/pip_package/setup.py  --replace "tensorflow_estimator >= 2.1.0rc0, < 2.2.0" "tensorflow_estimator"  --replace "tensorboard >= 2.1.0, < 2.2.0" "tensorboard"  --replace "gast == 0.2.2" "gast"   --replace "scipy == 1.2.2" "scipy" substituteInPlace ./unpacked/tensorflow*/tensorflow*.dist-info/METADATA   --replace "gast (==0.2.2)" "gast"  --replace "tensorflow-estimator (<2.2.0,>=2.1.0rc0)" "tensorflow_estimator"  --replace "tensorboard (<2.2.0,>=2.1.0)" "tensorboard"  --replace "scipy (==1.4.1)" "scipy" </ins> # Pack the wheel file back up. wheel pack ./unpacked/tensorflow*