azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Reduce dependencies for azure-core

Open georgewfisher opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

I would love to use the azure.identity package but it has dependencies via azure-core that conflict with other projects and this is frustrating. In my particular case the conflict is with typing-extensions which although sounds useful to development, is not related to Azure at all and should not be present in azure-core. Given this is a core library it should an extreme minimum of dependencies, otherwise it cannot be used flexibly.

pkg_resources.ContextualVersionConflict: (typing-extensions 4.3.0 (/usr/local/lib/python3.8/site-packages), Requirement.parse('typing-extensions<4,>=3.10'), {'apache-superset'})

Describe the solution you'd like Review dependencies in azure.core and eliminate all dependencies (typing-extensions, six) that are not directly related to Azure functionality.

Describe alternatives you've considered The alternative is to rewrite parts of the Azure Identity library from scratch. I have done this, and it works. I'd rather not have to do this.

georgewfisher avatar Aug 02 '22 21:08 georgewfisher

Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Azure.Core:0.4729176,Extensions:0.14902386,Azure.Identity:0.11857724'

azure-sdk avatar Aug 02 '22 21:08 azure-sdk

Thanks for the feedback, we’ll investigate asap.

xiangyan99 avatar Aug 03 '22 16:08 xiangyan99

Hi, Is the Issue is resolved? Because I'm also getting the same error while importing the module named as Feathr. Till now this error was not coming. image

Uditanshu1612 avatar Oct 18 '22 07:10 Uditanshu1612

No. It is not solved yet.

You can get more details in https://github.com/Azure/azure-sdk-for-python/pull/22891#issuecomment-1280969123.

xiangyan99 avatar Oct 18 '22 15:10 xiangyan99

@georgewfisher, about dependencies, first of all I agree on your intent 100%. We have recoded some parsing and things ourselves precisely to have as low dependencies as we could. About what remains:

  • We will definitely remove six, but we found instances of packages that use six directly and have dependencies on azure-core without themselves having a dependency on six. This is bad, they shouldn't have been in this situation, but they are, so we'll remove six when we feel it's unlikely anyone got trouble. We're fixing those packages. azure-core code itself do not rely on six anymore.
  • We don't plan to remove typing_extensions. This is honestly a standard library addition at this point, which is heavily supported by Python core developers. We don't see this dependency as problematic. I acknowledge the feedback that we might have jumped to v4 a little fast though, but now that we jumped we won't come back. We're doing this because a lot of people have strong feedback and expectations on typing quality nowadays, and it all starts with azure-core. It's difficult to get all customers 100% happy, but having a recent typing-extensions is making more happy people than sad people.
  • We would like to remove requests, and we did the work in azure-core that if you are async only, you can uninstall requests and still everything is working fine. We fall into the first bucket where removing requests would make some downstream packages fail. We keep a very low minimal boundary of requests on purpose to not block anyone (right now it's 2.18.4, from August 2017, which is 5 years old at time of this answer).

Side note, I see that apache-superset is now expecting typing-extensions >=4: https://github.com/apache/superset/blob/12f2b0f8e7d31ced91ebbc602704e7f08fd5ae76/setup.py#L126

@Uditanshu1612 your issue is not related to the initial issue here. From your screenshot, the feathr package is putting an upper boundary on azure-core to 1.22.1, we're not responsible for the choice of feathr developpers to put a limit on what version you can install. I believe looking at other issues like https://github.com/Azure/azure-sdk-for-python/pull/22891, that they did so because of typing-extensions. I would hope the feathr team can accept typing-extensions v4 soon. If you are aware this is problematic for them, let us know.

Thanks!

lmazuel avatar Aug 14 '23 18:08 lmazuel

Closing this issue, as I think we adressed the points discussed.

lmazuel avatar Jan 12 '24 22:01 lmazuel