Merge pull request #116496 from nbren12/fix-tensorflow-bin_2-master

This commit is contained in:
Sandro 2021-04-22 05:21:22 +02:00 committed by GitHub
commit 28f381bcf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 8 deletions

View file

@ -1,4 +1,5 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, click
@ -28,6 +29,8 @@ buildPythonPackage rec {
pytestCheckHook
];
disabledTests = lib.optionals stdenv.isDarwin [ "test_run_local_server" ];
meta = with lib; {
description = "Google Authentication Library: oauthlib integration";
homepage = "https://github.com/GoogleCloudPlatform/google-auth-library-python-oauthlib";

View file

@ -1,4 +1,5 @@
{ lib
{ stdenv
, lib
, buildPythonPackage
, fetchpatch
, fetchPypi
@ -48,6 +49,14 @@ buildPythonPackage rec {
"google.oauth2"
];
disabledTests = lib.optionals stdenv.isDarwin [
"test_request_with_timeout_success"
"test_request_with_timeout_failure"
"test_request_headers"
"test_request_error"
"test_request_basic"
];
meta = with lib; {
description = "Google Auth Python Library";
longDescription = ''

View file

@ -1,4 +1,5 @@
{ lib
{ stdenv
, lib
, buildPythonPackage
, fetchFromGitHub
, isPy27
@ -39,8 +40,10 @@ buildPythonPackage rec {
pytestCheckHook
];
# Don't run tests for Python 2.7
doCheck = !isPy27;
# 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);
pytestFlagsArray = [ "--ignore python2" ];
pythonImportsCheck = [ "httplib2" ];

View file

@ -96,10 +96,19 @@ in buildPythonPackage {
# Unpack the wheel file.
wheel unpack --dest unpacked ./*.whl
# 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)"
# 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"
# Pack the wheel file back up.
wheel pack ./unpacked/tensorflow*