This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-0-test by this push:
     new cf2f19f8884 [v3-0-test] Remove sqlalchemy-spanner exclusion after it's 
been yanked. (#51433) (#51449)
cf2f19f8884 is described below

commit cf2f19f888410fdefd08dacea1494fd55d0b4a32
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Jun 5 16:47:49 2025 +0200

    [v3-0-test] Remove sqlalchemy-spanner exclusion after it's been yanked. 
(#51433) (#51449)
    
    The broken sqlalchemy-spanner 1.12.0 has been yanked:
    (cherry picked from commit ebde18e0a971a2cdda7641c09376e70a7aafdbcf)
    
    
    https: 
//github.com/googleapis/python-spanner-sqlalchemy/issues/682#issuecomment-2943731677
---
 scripts/in_container/run_generate_constraints.py | 29 ++++++++++++++++++------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/scripts/in_container/run_generate_constraints.py 
b/scripts/in_container/run_generate_constraints.py
index 6db4f349fba..edb8de1df96 100755
--- a/scripts/in_container/run_generate_constraints.py
+++ b/scripts/in_container/run_generate_constraints.py
@@ -205,14 +205,19 @@ def freeze_distributions_to_file(
 
 def download_latest_constraint_file(config_params: ConfigParams):
     constraints_url = (
-        "https://raw.githubusercontent.com/";
-        
f"{config_params.constraints_github_repository}/{config_params.default_constraints_branch}/"
-        f"{config_params.airflow_constraints_mode}-{config_params.python}.txt"
+        "https://api.github.com/repos/";
+        f"{config_params.constraints_github_repository}/contents/"
+        
f"{config_params.airflow_constraints_mode}-{config_params.python}.txt?ref={config_params.default_constraints_branch}"
     )
     # download the latest constraints file
     # download using requests
+    headers = {"Accept": "application/vnd.github.v3.raw"}
+    if os.environ.get("GITHUB_TOKEN"):
+        headers["Authorization"] = f"Bearer {os.environ.get('GITHUB_TOKEN')}"
+    else:
+        console.print("[bright_blue]No GITHUB_TOKEN - using non-authenticated 
request.")
     console.print(f"[bright_blue]Downloading constraints file from 
{constraints_url}")
-    r = requests.get(constraints_url, timeout=60)
+    r = requests.get(constraints_url, timeout=60, headers=headers)
     r.raise_for_status()
     with config_params.latest_constraints_file.open("w") as constraints_file:
         constraints_file.write(r.text)
@@ -344,10 +349,20 @@ def generate_constraints_pypi_providers(config_params: 
ConfigParams) -> None:
 
     # In case we have some problems with installing highest resolution of a 
dependency of one of our
     # providers in PyPI - we can exclude the buggy version here. For example 
this happened with
-    # sqlalchemy-spanner==1.4.0 which did not have `whl` file in PyPI and was 
not installable
+    # sqlalchemy-spanner==1.12.0 which did not have `whl` file in PyPI and was 
not installable
+    # and in this case we excluded it by adding ""sqlalchemy-spanner!=1.12.0" 
to the list below.
+    # In case we add exclusion here we should always link to the issue in the 
target dependency
+    # repository that tracks the problem with the dependency (we should create 
one if it does not exist).
+    #
+    # Example exclusion (not needed any more as sqlalchemy-spanner==1.12.0has 
been yanked in PyPI):
+    #
+    # additional_constraints_for_highest_resolution: list[str] = 
["sqlalchemy-spanner!=1.12.0"]
+    #
     # Current exclusions:
-    # * sqlalchemy-spanner: 
https://github.com/googleapis/python-spanner-sqlalchemy/issues/682
-    additional_constraints_for_highest_resolution = 
["sqlalchemy-spanner!=1.12.0"]
+    #
+    # * no exclusions
+    #
+    additional_constraints_for_highest_resolution: list[str] = []
 
     result = run_command(
         cmd=[

Reply via email to