-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move help message to the google auth code (#29888)
The "google-auth" 2.16.2 just released, removed the _HELP_MESSAGE that was imported by google provider auth util thus failing the imports in canary builds of ours attempting to upgrade to newver versions of released libraries. This PR inlines the original help message into our code to make it independent from google-auth package version used.
- Loading branch information
Showing
4 changed files
with
128 additions
and
8 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
airflow/_vendor/daemon/0001-Refactor-_get_candidate_file_descriptor_ranges-to-us.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
From dd2f3d76c32ed12d56ae18b8ecb7086a8d9b1180 Mon Sep 17 00:00:00 2001 | ||
From: Igor Kholopov <kholopovus@gmail.com> | ||
Date: Thu, 1 Dec 2022 18:34:30 +1100 | ||
Subject: [PATCH 01/15] =?UTF-8?q?Refactor=20=E2=80=98=5Fget=5Fcandidate=5F?= | ||
=?UTF-8?q?file=5Fdescriptor=5Franges=E2=80=99=20to=20use=20=E2=80=98range?= | ||
=?UTF-8?q?=E2=80=99=20objects.?= | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
This avoids the requirement for a concrete set of all the actual file | ||
descriptors. When the range is very large, this can greatly improve the memory | ||
requirements and execution time of this function. | ||
--- | ||
daemon/daemon.py | 43 ++++++++++++++++++++++--------------------- | ||
1 file changed, 22 insertions(+), 21 deletions(-) | ||
|
||
diff --git a/daemon/daemon.py b/daemon/daemon.py | ||
index 08245a4..d1673be 100644 | ||
--- a/daemon/daemon.py | ||
+++ b/daemon/daemon.py | ||
@@ -921,29 +921,30 @@ def _get_candidate_file_descriptor_ranges(exclude): | ||
in this process, excluding those integers in the `exclude` | ||
collection. | ||
""" | ||
- candidates_list = sorted(_get_candidate_file_descriptors(exclude)) | ||
+ _validate_fd_values(exclude) | ||
ranges = [] | ||
|
||
- def append_range_if_needed(candidate_range): | ||
- (low, high) = candidate_range | ||
- if (low < high): | ||
- # The range is not empty. | ||
- ranges.append(candidate_range) | ||
- | ||
- this_range = ( | ||
- (min(candidates_list), (min(candidates_list) + 1)) | ||
- if candidates_list else (0, 0)) | ||
- for fd in candidates_list[1:]: | ||
- high = fd + 1 | ||
- if this_range[1] == fd: | ||
- # This file descriptor extends the current range. | ||
- this_range = (this_range[0], high) | ||
- else: | ||
- # The previous range has ended at a gap. | ||
- append_range_if_needed(this_range) | ||
- # This file descriptor begins a new range. | ||
- this_range = (fd, high) | ||
- append_range_if_needed(this_range) | ||
+ remaining_range = _total_file_descriptor_range | ||
+ for exclude_fd in sorted(exclude): | ||
+ if (exclude_fd > remaining_range.stop): | ||
+ # This and all later exclusions are higher than the remaining | ||
+ # range. | ||
+ break | ||
+ if (exclude_fd < remaining_range.start): | ||
+ # The remaining range does not include the current exclusion. | ||
+ continue | ||
+ if (exclude_fd != remaining_range.start): | ||
+ # There is a candidate range below the current exclusion. | ||
+ ranges.append((remaining_range.start, exclude_fd)) | ||
+ # Narrow the remaining range to those above the current exclusion. | ||
+ remaining_range = range(exclude_fd + 1, remaining_range.stop) | ||
+ | ||
+ if (remaining_range.start < remaining_range.stop): | ||
+ # After excluding all the specified file descriptors, there is a | ||
+ # remaining range; append it as a candidate for closing file | ||
+ # descriptors. | ||
+ ranges.append((remaining_range.start, remaining_range.stop)) | ||
+ | ||
return ranges | ||
|
||
|
||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# daemon/module.mk | ||
# Part of ‘python-daemon’, an implementation of PEP 3143. | ||
# | ||
# This is free software, and you are welcome to redistribute it under | ||
# certain conditions; see the end of this file for copyright | ||
# information, grant of license, and disclaimer of warranty. | ||
|
||
# Makefile module for ‘daemon’ Python package. | ||
|
||
MODULE_DIR := $(CURDIR)/daemon | ||
|
||
CODE_MODULES += $(shell find ${MODULE_DIR}/ -name '*.py') | ||
|
||
|
||
# Copyright © 2006–2023 Ben Finney <ben+python@benfinney.id.au> | ||
# | ||
# This is free software: you may copy, modify, and/or distribute this work | ||
# under the terms of the GNU General Public License as published by the | ||
# Free Software Foundation; version 3 of that license or any later version. | ||
# No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details. | ||
|
||
|
||
# Local Variables: | ||
# mode: makefile | ||
# coding: utf-8 | ||
# End: | ||
# vim: fileencoding=utf-8 filetype=make : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters