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

aas.backend: Support urllib3 version 2 #294

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Conversation

JGrothoff
Copy link
Contributor

The previous version contraint urllib3>=1.26,<2.0 is verry restrictive.
I need to use the SDK in a project together with other libs (e.g. gradio) that require urlib3 >= 2.

I widened the version constraint according to urllib3 migration guide and did't see any deprecation warnings (hopefully i turned them on correctly).

@@ -108,7 +108,7 @@ def _parse_source(cls, source: str) -> str:

@classmethod
def do_request(cls, url: str, method: str = "GET", additional_headers: Dict[str, str] = {},
body: Optional[bytes] = None) -> Dict[str, Any]:
body: Optional[bytes] = None) -> MutableMapping[str, Any]:
Copy link
Contributor Author

@JGrothoff JGrothoff Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing the return type to the more generic MutableMappingwe could also add HTTPHeaderDict as Union.
Alternatively we can leave Dict return type and transform the response.headers into a normal dict in line 158. However this produces additional overhead, e.g.:
return {key: value for key, value in response.headers.items()}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong opinion on which type should be used here.

@s-heppner
Copy link
Contributor

Hi @JGrothoff thank you for your contribution!

I'm happy to introduce urllib3 >= 2 to our SDK. Just as it so happened we switched from setup.py and requirements.txt to the more modern approach of using pyproject.toml (See #290). Could you adapt your PR accordingly, please?

@JGrothoff
Copy link
Contributor Author

Hi @s-heppner, thank you for the review. I adapted the files accordingly.

Copy link
Contributor

@s-heppner s-heppner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much for your contribution!

@s-heppner s-heppner merged commit aeeb59e into eclipse-basyx:main Sep 20, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants