aIbrahiim commented on code in PR #41494:
URL: https://github.com/apache/beam/pull/41494#discussion_r4736674456


##########
scripts/tools/update_ml_dependency_bounds.py:
##########
@@ -0,0 +1,425 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""Raises the exclusive upper bounds of ML dependencies.
+
+For every site listed in ml_dependency_bounds.yaml the script reads the current
+requirement from the repository files, compares it with the latest stable
+release on PyPI, and rewrites only the bound token that has to move. Tox
+environments and Gradle tasks that carry the version of the highest tested
+window are renamed together with the window.
+
+Run it from anywhere:
+
+  python scripts/tools/update_ml_dependency_bounds.py
+"""
+
+import argparse
+import http.client
+import json
+import re
+import sys
+import time
+import urllib.request
+from dataclasses import dataclass
+from dataclasses import field
+from pathlib import Path
+from typing import Callable
+from typing import Optional
+
+import yaml
+from packaging.requirements import Requirement
+from packaging.utils import canonicalize_name
+from packaging.version import InvalidVersion
+from packaging.version import Version
+
+PR_TITLE = 'Update ML dependency bounds'
+
+# Same wording as the PR created by update_python_dependencies.yml.
+PR_REVIEW_SENTENCE = (
+    'This PR was created by automation - by default this does not execute '
+    'tests due to a limitation in GitHub Actions. To review this PR, please '
+    '(1) review the contents to make sure all dependency upgrades are '
+    'formatted correctly, (2) close and reopen the PR (3) Approve/merge if '
+    'tests pass successfully.')
+
+TOKENIZERS_NOTE = (
+    'tokenizers stays below 0.22 in the same requirement list as '
+    'transformers in ml_base_core. The two can conflict. If a test fails '
+    'for that reason, hold transformers instead of raising tokenizers.')

Review Comment:
   because in ml_base_core we install transformers and tokenizers together and 
tokenizers is already capped on purpose (CLIP still uses cls=, there's a 
comment for that in setup.py so if a transformers bump starts needing a newer 
tokenizers bumping tokenizers would just break that path so I thought it is 
safer for the automation to hold the transformers bump instead of raising the 
tokenizers cap



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to