MicrosoftDocs / vsts-rest-api-specs

MIT License
166 stars 115 forks source link

ModuleNotFoundError: No module named 'azure.devops.v7_1.git.git_client' #597

Closed avivtabak closed 1 year ago

avivtabak commented 1 year ago

There is an error when calling git_client in Python SDK version 7.1.0b1

from azure.devops.connection import Connection
connection = Connection(base_url=org_url, creds=credentials)
git_client = self.connection.clients_v7_1.get_git_client()

This will raise an exception because the imports are wrong in client_factory.py:

def get_git_client(self): """get_git_client. Gets the 7.1 version of the GitClient :rtype: :class: """ return self._connection.get_client('azure.devops.v7_1.git.git_client.GitClient')

Suggestion for correction: return self._connection.get_client('azure.devops.v7_1.git.git_client_base.GitClientBase')

also inazure/devops/v7_1/git/init.py:11 you need to change from: from .git_client import GitClient to from .git_client_base import GitClientBase

thanks

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

MYacineK commented 1 year ago

Exactlyt the same error, exactly the same modifications done, and worked fine for me. Thank you @avivtabak

nechvatalp commented 1 year ago

Hello, thanks for reporting, this issue should be resolved in newer versions of the Python SDK. Best place to report such issues would be on the repository for python sdk https://github.com/microsoft/azure-devops-python-api