Cast `url_for() output to str`

Starlette 0.26.0 has changed the return type of `HTTPConnection.url_for()`
from `str` to `URL`, which breaks the Galaxy package mypy tests:

```
mypy . --enable-incomplete-feature=Unpack
galaxy/webapps/galaxy/api/__init__.py:180: error: Incompatible types in
assignment (expression has type "str", variable has type "URL")  [assignment]
                    url = f"{url}?{urlencode(query_params)}"
                          ^
Found 1 error in 1 file (checked 255 source files)
```
This commit is contained in:
Nicola Soranzo
2023-03-12 17:02:47 +00:00
parent 273b68679e
commit 94fab1b320
+1 -1
View File
@@ -173,7 +173,7 @@ class UrlBuilder:
query_params = path_params.pop("query_params", None)
try:
if qualified:
url = self.request.url_for(name, **path_params)
url = str(self.request.url_for(name, **path_params))
else:
url = self.request.app.url_path_for(name, **path_params)
if query_params: