Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Simplify nested f-string to fix pydoc-markdown parsing #6717

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions openhands/resolver/interfaces/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def get_headers(self):
}

def get_base_url(self):
return f'https://gitlab.com/api/v4/projects/{quote(f'{self.owner}/{self.repo}', safe="")}'
project_path = quote(f'{self.owner}/{self.repo}', safe="")
return f'https://gitlab.com/api/v4/projects/{project_path}'

def get_authorize_url(self):
return f'https://{self.username}:{self.token}@gitlab.com/'
Expand All @@ -45,9 +46,9 @@ def get_download_url(self):
return f'{self.base_url}/issues'

def get_clone_url(self):
username_and_token = (
f'{self.username}:{self.token}' if self.username else f'{self.token}'
)
username_and_token = self.token
if self.username:
username_and_token = f'{self.username}:{self.token}'
return f'https://{username_and_token}@gitlab.com/{self.owner}/{self.repo}.git'

def get_graphql_url(self):
Expand Down Expand Up @@ -360,7 +361,8 @@ def download_pr_metadata(
}
"""

variables = {'projectPath': f'{self.owner}/{self.repo}', 'pr': f'{pull_number}'}
project_path = f'{self.owner}/{self.repo}'
variables = {'projectPath': project_path, 'pr': str(pull_number)}

response = requests.post(
self.get_graphql_url(),
Expand Down
Loading