|
| 1 | +# Copyright 2018 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +"""Common configs for compatibility_lib.""" |
| 16 | + |
| 17 | + |
| 18 | +def _format_url(repo_name, setuppy_path=''): |
| 19 | + url = 'git%2Bgit://github.com/{}.git'.format(repo_name) |
| 20 | + if setuppy_path != '': |
| 21 | + url = '{}%23subdirectory={}'.format(url, setuppy_path) |
| 22 | + return url |
| 23 | + |
| 24 | + |
| 25 | +# IGNORED_DEPENDENCIES are not direct dependencies for many packages and are |
| 26 | +# not installed via pip, resulting in unresolvable high priority warnings. |
| 27 | +IGNORED_DEPENDENCIES = [ |
| 28 | + 'pip', |
| 29 | + 'setuptools', |
| 30 | + 'wheel', |
| 31 | +] |
| 32 | + |
| 33 | +PKG_LIST = [ |
| 34 | + 'google-api-core', |
| 35 | + 'google-api-python-client', |
| 36 | + 'google-auth', |
| 37 | + 'google-cloud-bigquery', |
| 38 | + 'google-cloud-bigquery-datatransfer', |
| 39 | + 'google-cloud-bigtable', |
| 40 | + 'google-cloud-container', |
| 41 | + 'google-cloud-core', |
| 42 | + 'google-cloud-datastore', |
| 43 | + 'google-cloud-dns', |
| 44 | + 'google-cloud-error-reporting', |
| 45 | + 'google-cloud-firestore', |
| 46 | + 'google-cloud-language', |
| 47 | + 'google-cloud-logging', |
| 48 | + 'google-cloud-monitoring', |
| 49 | + 'google-cloud-pubsub', |
| 50 | + 'google-cloud-resource-manager', |
| 51 | + 'google-cloud-runtimeconfig', |
| 52 | + 'google-cloud-spanner', |
| 53 | + 'google-cloud-speech', |
| 54 | + 'google-cloud-storage', |
| 55 | + 'google-cloud-trace', |
| 56 | + 'google-cloud-translate', |
| 57 | + 'google-cloud-videointelligence', |
| 58 | + 'google-cloud-vision', |
| 59 | + 'google-resumable-media', |
| 60 | + 'apache-beam[gcp]', |
| 61 | + 'google-apitools', |
| 62 | + 'googleapis-common-protos', |
| 63 | + 'grpc-google-iam-v1', |
| 64 | + 'grpcio', |
| 65 | + 'gsutil', |
| 66 | + 'opencensus', |
| 67 | + 'protobuf', |
| 68 | + 'protorpc', |
| 69 | + 'tensorboard', |
| 70 | + 'tensorflow', |
| 71 | + 'gcloud', |
| 72 | +] |
| 73 | + |
| 74 | +WHITELIST_PKGS = PKG_LIST |
| 75 | + |
| 76 | +WHITELIST_URLS = { |
| 77 | + _format_url('googleapis/google-cloud-python', 'asset'): 'gcloud', |
| 78 | + _format_url('googleapis/google-cloud-python', 'automl'): 'gcloud', |
| 79 | + _format_url('googleapis/google-cloud-python', 'dataproc'): 'gcloud', |
| 80 | + _format_url('googleapis/google-cloud-python', 'dlp'): 'gcloud', |
| 81 | + _format_url('googleapis/google-cloud-python', 'iot'): 'gcloud', |
| 82 | + _format_url('googleapis/google-cloud-python', 'kms'): 'gcloud', |
| 83 | + _format_url('googleapis/google-cloud-python', 'legacy/google-cloud'): |
| 84 | + 'gcloud', |
| 85 | + _format_url('googleapis/google-cloud-python', 'ndb'): 'gcloud', |
| 86 | + _format_url('googleapis/google-cloud-python', 'oslogin'): 'gcloud', |
| 87 | + _format_url('googleapis/google-cloud-python', 'redis'): 'gcloud', |
| 88 | + _format_url('googleapis/google-cloud-python', 'securitycenter'): 'gcloud', |
| 89 | + _format_url('googleapis/google-cloud-python', 'tasks'): 'gcloud', |
| 90 | + _format_url('googleapis/google-cloud-python', 'test_utils'): 'gcloud', |
| 91 | + _format_url('googleapis/google-cloud-python', 'texttospeech'): 'gcloud', |
| 92 | + _format_url('googleapis/google-cloud-python', 'websecurityscanner'): |
| 93 | + 'gcloud', |
| 94 | + _format_url('googleapis/google-cloud-python', 'api_core'): |
| 95 | + 'google-api-core', |
| 96 | + _format_url('googleapis/google-cloud-python', 'bigquery'): |
| 97 | + 'google-cloud-bigquery', |
| 98 | + _format_url('googleapis/google-cloud-python', 'bigquery_datatransfer'): |
| 99 | + 'google-cloud-bigquery-datatransfer', |
| 100 | + _format_url('googleapis/google-cloud-python', 'bigtable'): |
| 101 | + 'google-cloud-bigtable', |
| 102 | + _format_url('googleapis/google-cloud-python', 'container'): |
| 103 | + 'google-cloud-container', |
| 104 | + _format_url('googleapis/google-cloud-python', 'core'): |
| 105 | + 'google-cloud-core', |
| 106 | + _format_url('googleapis/google-cloud-python', 'datastore'): |
| 107 | + 'google-cloud-datastore', |
| 108 | + _format_url('googleapis/google-cloud-python', 'dns'): 'google-cloud-dns', |
| 109 | + _format_url('googleapis/google-cloud-python', 'error_reporting'): |
| 110 | + 'google-cloud-error-reporting', |
| 111 | + _format_url('googleapis/google-cloud-python', 'firestore'): |
| 112 | + 'google-cloud-firestore', |
| 113 | + _format_url('googleapis/google-cloud-python', 'language'): |
| 114 | + 'google-cloud-language', |
| 115 | + _format_url('googleapis/google-cloud-python', 'logging'): |
| 116 | + 'google-cloud-logging', |
| 117 | + _format_url('googleapis/google-cloud-python', 'monitoring'): |
| 118 | + 'google-cloud-monitoring', |
| 119 | + _format_url('googleapis/google-cloud-python', 'pubsub'): |
| 120 | + 'google-cloud-pubsub', |
| 121 | + _format_url('googleapis/google-cloud-python', 'resource_manager'): |
| 122 | + 'google-cloud-resource-manager', |
| 123 | + _format_url('googleapis/google-cloud-python', 'runtimeconfig'): |
| 124 | + 'google-cloud-runtimeconfig', |
| 125 | + _format_url('googleapis/google-cloud-python', 'spanner'): |
| 126 | + 'google-cloud-spanner', |
| 127 | + _format_url('googleapis/google-cloud-python', 'speech'): |
| 128 | + 'google-cloud-speech', |
| 129 | + _format_url('googleapis/google-cloud-python', 'storage'): |
| 130 | + 'google-cloud-storage', |
| 131 | + _format_url('googleapis/google-cloud-python', 'trace'): |
| 132 | + 'google-cloud-trace', |
| 133 | + _format_url('googleapis/google-cloud-python', 'translate'): |
| 134 | + 'google-cloud-translate', |
| 135 | + _format_url('googleapis/google-cloud-python', 'videointelligence'): |
| 136 | + 'google-cloud-videointelligence', |
| 137 | + _format_url('googleapis/google-cloud-python', 'vision'): |
| 138 | + 'google-cloud-vision', |
| 139 | + _format_url('googleapis/google-api-python-client'): |
| 140 | + 'google-api-python-client', |
| 141 | + _format_url('googleapis/google-auth-library-python'): 'google-auth', |
| 142 | + _format_url('GoogleCloudPlatform/google-resumable-media-python'): |
| 143 | + 'google-resumable-media', |
| 144 | + _format_url('apache/beam', 'sdks/python'): 'apache-beam[gcp]', |
| 145 | + _format_url('google/apitools'): 'google-apitools', |
| 146 | + _format_url('GoogleCloudPlatform/gsutil'): 'gsutil', |
| 147 | + _format_url('census-instrumentation/opencensus-python'): 'opencensus', |
| 148 | + _format_url('protocolbuffers/protobuf', 'python'): 'protobuf', |
| 149 | + _format_url('google/protorpc'): 'protorpc', |
| 150 | + _format_url('tensorflow/tensorflow', 'tensorflow/tools/pip_package'): |
| 151 | + 'tensorflow', |
| 152 | + _format_url('tensorflow/tensorflow', |
| 153 | + 'tensorflow/contrib/tpu/profiler/pip_package'): 'tensorflow', |
| 154 | + # TODO: The following projects do not use setup.py |
| 155 | + # googleapis-common-protos |
| 156 | + # grpc-google-iam-v1 |
| 157 | + # grpcio |
| 158 | + # tensorboard - not sure what the build process is |
| 159 | + # _format_url('tensorflow/tensorboard', 'tensorboard/pip_package'): |
| 160 | + # 'tensorboard', |
| 161 | +} |
| 162 | + |
| 163 | +# TODO: Find top 30 packages by download count in BigQuery table. |
| 164 | +THIRD_PARTY_PACKAGE_LIST = [ |
| 165 | + 'requests', |
| 166 | + 'flask', |
| 167 | + 'django', |
| 168 | +] |
| 169 | + |
| 170 | +PKG_PY_VERSION_NOT_SUPPORTED = { |
| 171 | + 2: ['tensorflow', ], |
| 172 | + 3: ['apache-beam[gcp]', 'gsutil', ], |
| 173 | +} |
0 commit comments