Azure / azure-cli-dev-tools

Developer utilities for Azure CLI command module and extension developers.
MIT License
80 stars 113 forks source link

Installing aaz-dev-tools fails with Werkzeug.URLs vs markupsafe compatibility issue. #429

Open andrew-lee-1089 opened 10 months ago

andrew-lee-1089 commented 10 months ago

I am following https://eng.ms/docs/cloud-ai-platform/azure-core/azure-management-and-platforms/control-plane-bburns/azure-cli-tools-azure-cli-powershell-and-terraform/azure-cli-tools/teams_docs/azcli_docs/setup_for_codegen on WSL,

I hit am error running:

(azcli) developer@DESKTOP-10GJ18A ~/ado $ pip install $(curl https://api.github.com/repos/Azure/aaz-dev-tools/releases/latest -s | grep -o "https.*.whl")
Collecting aaz-dev==2.5.1
  Downloading https://github.com/Azure/aaz-dev-tools/releases/download/v2.5.1/aaz_dev-2.5.1-py3-none-any.whl (1.1 MB)
     |████████████████████████████████| 1.1 MB 6.7 MB/s
Collecting inflect~=5.3.0
  Downloading inflect-5.3.0-py3-none-any.whl (32 kB)
Collecting click~=8.1.2
  Downloading click-8.1.7-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 4.2 MB/s
Collecting schematics~=2.1.1
  Downloading schematics-2.1.1-py2.py3-none-any.whl (63 kB)
     |████████████████████████████████| 63 kB 1.7 MB/s
Collecting pyyaml==5.3.1
  Downloading PyYAML-5.3.1.tar.gz (269 kB)
     |████████████████████████████████| 269 kB 28.2 MB/s
Collecting flask~=2.1.3
  Downloading Flask-2.1.3-py3-none-any.whl (95 kB)
     |████████████████████████████████| 95 kB 2.7 MB/s
Collecting msrestazure~=0.6.4
  Using cached msrestazure-0.6.4-py2.py3-none-any.whl (40 kB)
Requirement already satisfied: packaging>=21.3 in ./azcli/lib/python3.8/site-packages (from aaz-dev==2.5.1) (23.2)
Collecting Jinja2~=3.0.3
  Using cached Jinja2-3.0.3-py3-none-any.whl (133 kB)
Collecting MarkupSafe~=2.0.1
  Downloading MarkupSafe-2.0.1-cp38-cp38-manylinux2010_x86_64.whl (30 kB)
Collecting lxml~=4.9.2
  Downloading lxml-4.9.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.1 MB)
     |████████████████████████████████| 7.1 MB 16.4 MB/s
Collecting cachelib~=0.5.0
  Downloading cachelib-0.5.0-py3-none-any.whl (15 kB)
Collecting jsonschema~=4.17.1
  Downloading jsonschema-4.17.3-py3-none-any.whl (90 kB)
     |████████████████████████████████| 90 kB 6.6 MB/s
Collecting xmltodict~=0.12.0
  Downloading xmltodict-0.12.0-py2.py3-none-any.whl (9.2 kB)
Collecting fuzzywuzzy~=0.18.0
  Downloading fuzzywuzzy-0.18.0-py2.py3-none-any.whl (18 kB)
Collecting pytest~=6.2.0
  Downloading pytest-6.2.5-py3-none-any.whl (280 kB)
     |████████████████████████████████| 280 kB 36.4 MB/s
Collecting itsdangerous>=2.0
  Downloading itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting importlib-metadata>=3.6.0; python_version < "3.10"
  Downloading importlib_metadata-7.0.1-py3-none-any.whl (23 kB)
Collecting Werkzeug>=2.0
  Downloading werkzeug-3.0.1-py3-none-any.whl (226 kB)
     |████████████████████████████████| 226 kB 24.5 MB/s
Requirement already satisfied: msrest<2.0.0,>=0.6.0 in ./azcli/lib/python3.8/site-packages (from msrestazure~=0.6.4->aaz-dev==2.5.1) (0.7.1)
Collecting adal<2.0.0,>=0.6.0
  Using cached adal-1.2.7-py2.py3-none-any.whl (55 kB)
Requirement already satisfied: six in ./azcli/lib/python3.8/site-packages (from msrestazure~=0.6.4->aaz-dev==2.5.1) (1.16.0)
Collecting importlib-resources>=1.4.0; python_version < "3.9"
  Downloading importlib_resources-6.1.1-py3-none-any.whl (33 kB)
Collecting attrs>=17.4.0
  Downloading attrs-23.2.0-py3-none-any.whl (60 kB)
     |████████████████████████████████| 60 kB 4.8 MB/s
Collecting pkgutil-resolve-name>=1.3.10; python_version < "3.9"
  Using cached pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB)
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
  Downloading pyrsistent-0.20.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)
     |████████████████████████████████| 121 kB 15.1 MB/s
Collecting toml
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: py>=1.8.2 in ./azcli/lib/python3.8/site-packages (from pytest~=6.2.0->aaz-dev==2.5.1) (1.11.0)
Requirement already satisfied: pluggy<2.0,>=0.12 in ./azcli/lib/python3.8/site-packages (from pytest~=6.2.0->aaz-dev==2.5.1) (1.3.0)
Requirement already satisfied: iniconfig in ./azcli/lib/python3.8/site-packages (from pytest~=6.2.0->aaz-dev==2.5.1) (2.0.0)
Collecting zipp>=0.5
  Downloading zipp-3.17.0-py3-none-any.whl (7.4 kB)
Requirement already satisfied: azure-core>=1.24.0 in ./azcli/lib/python3.8/site-packages (from msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (1.29.6)
Requirement already satisfied: certifi>=2017.4.17 in ./azcli/lib/python3.8/site-packages (from msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (2023.11.17)
Requirement already satisfied: isodate>=0.6.0 in ./azcli/lib/python3.8/site-packages (from msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (0.6.1)
Requirement already satisfied: requests~=2.16 in ./azcli/lib/python3.8/site-packages (from msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (2.31.0)
Requirement already satisfied: requests-oauthlib>=0.5.0 in ./azcli/lib/python3.8/site-packages (from msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (1.3.1)
Requirement already satisfied: python-dateutil<3,>=2.1.0 in ./azcli/lib/python3.8/site-packages (from adal<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (2.8.2)
Collecting PyJWT<3,>=1.0.0
  Downloading PyJWT-2.8.0-py3-none-any.whl (22 kB)
Requirement already satisfied: cryptography>=1.1.0 in ./azcli/lib/python3.8/site-packages (from adal<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (41.0.7)
Requirement already satisfied: anyio<5.0,>=3.0 in ./azcli/lib/python3.8/site-packages (from azure-core>=1.24.0->msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (4.2.0)
Requirement already satisfied: typing-extensions>=4.6.0 in ./azcli/lib/python3.8/site-packages (from azure-core>=1.24.0->msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (4.9.0)
Requirement already satisfied: idna<4,>=2.5 in ./azcli/lib/python3.8/site-packages (from requests~=2.16->msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (3.6)
Requirement already satisfied: charset-normalizer<4,>=2 in ./azcli/lib/python3.8/site-packages (from requests~=2.16->msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (3.3.2)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./azcli/lib/python3.8/site-packages (from requests~=2.16->msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (2.1.0)
Requirement already satisfied: oauthlib>=3.0.0 in ./azcli/lib/python3.8/site-packages (from requests-oauthlib>=0.5.0->msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (3.2.2)
Requirement already satisfied: cffi>=1.12 in ./azcli/lib/python3.8/site-packages (from cryptography>=1.1.0->adal<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (1.16.0)
Requirement already satisfied: sniffio>=1.1 in ./azcli/lib/python3.8/site-packages (from anyio<5.0,>=3.0->azure-core>=1.24.0->msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (1.3.0)
Requirement already satisfied: exceptiongroup>=1.0.2; python_version < "3.11" in ./azcli/lib/python3.8/site-packages (from anyio<5.0,>=3.0->azure-core>=1.24.0->msrest<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (1.2.0)
Requirement already satisfied: pycparser in ./azcli/lib/python3.8/site-packages (from cffi>=1.12->cryptography>=1.1.0->adal<2.0.0,>=0.6.0->msrestazure~=0.6.4->aaz-dev==2.5.1) (2.21)
Building wheels for collected packages: pyyaml
  Building wheel for pyyaml (setup.py) ... done
  Created wheel for pyyaml: filename=PyYAML-5.3.1-cp38-cp38-linux_x86_64.whl size=45918 sha256=b551cbc50e7dfa54eb2132d18252dd5edad5f35ad6bc844eb67e684290f6847c
  Stored in directory: /home/developer/.cache/pip/wheels/13/90/db/290ab3a34f2ef0b5a0f89235dc2d40fea83e77de84ed2dc05c
Successfully built pyyaml
ERROR: werkzeug 3.0.1 has requirement MarkupSafe>=2.1.1, but you'll have markupsafe 2.0.1 which is incompatible.
Installing collected packages: inflect, click, schematics, pyyaml, itsdangerous, zipp, importlib-metadata, MarkupSafe, Jinja2, Werkzeug, flask, PyJWT, adal, msrestazure, lxml, cachelib, importlib-resources, attrs, pkgutil-resolve-name, pyrsistent, jsonschema, xmltodict, fuzzywuzzy, toml, pytest, aaz-dev
  Attempting uninstall: pyyaml
    Found existing installation: PyYAML 6.0.1
    Uninstalling PyYAML-6.0.1:
      Successfully uninstalled PyYAML-6.0.1
  Attempting uninstall: MarkupSafe
    Found existing installation: MarkupSafe 2.1.3
    Uninstalling MarkupSafe-2.1.3:
      Successfully uninstalled MarkupSafe-2.1.3
  Attempting uninstall: Jinja2
    Found existing installation: Jinja2 3.1.2
    Uninstalling Jinja2-3.1.2:
      Successfully uninstalled Jinja2-3.1.2
  Attempting uninstall: pytest
    Found existing installation: pytest 7.4.4
    Uninstalling pytest-7.4.4:
      Successfully uninstalled pytest-7.4.4
Successfully installed Jinja2-3.0.3 MarkupSafe-2.0.1 PyJWT-2.8.0 Werkzeug-3.0.1 aaz-dev-2.5.1 adal-1.2.7 attrs-23.2.0 cachelib-0.5.0 click-8.1.7 flask-2.1.3 fuzzywuzzy-0.18.0 importlib-metadata-7.0.1 importlib-resources-6.1.1 inflect-5.3.0 itsdangerous-2.1.2 jsonschema-4.17.3 lxml-4.9.4 msrestazure-0.6.4 pkgutil-resolve-name-1.3.10 pyrsistent-0.20.0 pytest-6.2.5 pyyaml-5.3.1 schematics-2.1.1 toml-0.10.2 xmltodict-0.12.0 zipp-3.17.0

Despite it saying that aaz-dev was successfully deplyoed if I ran:

(azcli) developer@DESKTOP-10GJ18A ~/ado/aaz (main) $ aaz-dev
Traceback (most recent call last):
  File "/home/developer/ado/azcli/bin/aaz-dev", line 5, in <module>
    from aaz_dev.app.main import main
  File "/home/developer/ado/azcli/lib/python3.8/site-packages/aaz_dev/app/main.py", line 2, in <module>
    from aaz_dev.app.app import cli
  File "/home/developer/ado/azcli/lib/python3.8/site-packages/aaz_dev/app/app.py", line 3, in <module>
    from flask import Flask, jsonify
  File "/home/developer/ado/azcli/lib/python3.8/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/home/developer/ado/azcli/lib/python3.8/site-packages/flask/app.py", line 27, in <module>
    from . import cli
  File "/home/developer/ado/azcli/lib/python3.8/site-packages/flask/cli.py", line 17, in <module>
    from .helpers import get_debug_flag
  File "/home/developer/ado/azcli/lib/python3.8/site-packages/flask/helpers.py", line 14, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/home/developer/ado/azcli/lib/python3.8/site-packages/werkzeug/urls.py)

I get that python packaging is a pile of poo, the workaround here is to run pip install Werkzeug==2.2.2