azure-devops-python-api icon indicating copy to clipboard operation
azure-devops-python-api copied to clipboard

Using GitClient

Open Johney9 opened this issue 4 years ago • 1 comments

Hello, I'm trying to create a pull request status, but I'm getting the message:

AttributeError: 'GitClient' object has no attribute 'create_pull_request_status'

This is my condensed code:

from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
import argparse

def main():
    parser = _init_parser()
    args = parser.parse_args()
    credentials = BasicAuthentication('', args.token)
    connection = Connection(base_url=args.organization_url, creds=credentials)
    client = connection.clients.get_git_client()
    response = client.create_pull_request_status(status, args.project_id, args.pull_request_id)
    
if __name__ == "__main__":
    main()

What's odd to me is that the function should clearly exist: https://github.com/microsoft/azure-devops-python-api/blob/f5c89029b781799fc247f85059b1bcc8b53c2024/azure-devops/azure/devops/v6_0/git/git_client_base.py#L2249

I'm using azure-devops==6.0.0b4 msrest==0.6.21 oauthlib==3.1.1.

Any help would be appreciated!

Johney9 avatar Jan 17 '22 19:01 Johney9

Have you tried using clients_v6_0 instead of client

client = connection.clients_v6_0.get_git_client()

NJannasch avatar Jan 23 '22 19:01 NJannasch