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

View File

@ -1,4 +1,5 @@
{ lib { stdenv
, lib
, buildPythonPackage , buildPythonPackage
, fetchpatch , fetchpatch
, fetchPypi , fetchPypi
@ -48,6 +49,14 @@ buildPythonPackage rec {
"google.oauth2" "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; { meta = with lib; {
description = "Google Auth Python Library"; description = "Google Auth Python Library";
longDescription = '' longDescription = ''

View File

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

View File

@ -96,10 +96,19 @@ in buildPythonPackage {
# Unpack the wheel file. # Unpack the wheel file.
wheel unpack --dest unpacked ./*.whl wheel unpack --dest unpacked ./*.whl
# Tensorflow has a hard dependency on gast==0.2.2, but we relax it to # Tensorflow wheels tightly constrain the versions of gast, tensorflow-estimator and scipy.
# gast==0.3.2. # This code relaxes these requirements:
substituteInPlace ./unpacked/tensorflow*/tensorflow_core/tools/pip_package/setup.py --replace "gast == 0.2.2" "gast == 0.3.2" substituteInPlace ./unpacked/tensorflow*/tensorflow_core/tools/pip_package/setup.py \
substituteInPlace ./unpacked/tensorflow*/tensorflow_*.dist-info/METADATA --replace "gast (==0.2.2)" "gast (==0.3.2)" --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. # Pack the wheel file back up.
wheel pack ./unpacked/tensorflow* wheel pack ./unpacked/tensorflow*