diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml index 472a81218..53d823bc6 100644 --- a/sdks/python/pyproject.toml +++ b/sdks/python/pyproject.toml @@ -12,7 +12,10 @@ include = ["dropbox_sign/py.typed"] [tool.poetry.dependencies] python = "^3.8" -urllib3 = ">= 1.25.3, < 3.0.0" +urllib3 = [ + { version = ">= 2.8.0, < 3.0.0", python = ">=3.10" }, + { version = ">= 1.25.3, < 3.0.0", python = "<3.10" }, +] python-dateutil = ">= 2.8.2" pydantic = ">= 2" typing-extensions = ">= 4.7.1" diff --git a/sdks/python/requirements.txt b/sdks/python/requirements.txt index 67f7f68df..c5d71d486 100644 --- a/sdks/python/requirements.txt +++ b/sdks/python/requirements.txt @@ -1,4 +1,5 @@ -urllib3 >= 1.25.3, < 3.0.0 +urllib3 >= 2.8.0, < 3.0.0; python_version >= "3.10" +urllib3 >= 1.25.3, < 3.0.0; python_version < "3.10" python_dateutil >= 2.8.2 pydantic >= 2 typing-extensions >= 4.7.1 diff --git a/sdks/python/setup.py b/sdks/python/setup.py index ed66905fd..eafe3b87c 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -26,7 +26,8 @@ VERSION = "1.11-dev" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ - "urllib3 >= 1.25.3, < 3.0.0", + "urllib3 >= 2.8.0, < 3.0.0; python_version >= '3.10'", + "urllib3 >= 1.25.3, < 3.0.0; python_version < '3.10'", "python-dateutil >= 2.8.2", "pydantic >= 2", "typing-extensions >= 4.7.1", diff --git a/sdks/python/templates/README_onlypackage.mustache b/sdks/python/templates/README_onlypackage.mustache index 2b8bd82e1..f01667685 100644 --- a/sdks/python/templates/README_onlypackage.mustache +++ b/sdks/python/templates/README_onlypackage.mustache @@ -26,7 +26,12 @@ This python library package is generated without supporting files like setup.py To be able to use it, you will need these dependencies in your own package that uses this library: +{{^useCustomTemplateCode}} * urllib3 >= 1.25.3, < 3.0.0 +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +* urllib3 >= 2.8.0, < 3.0.0 (Python 3.10+) or >= 1.25.3, < 3.0.0 (Python 3.8 and 3.9) +{{/useCustomTemplateCode}} * python-dateutil >= 2.8.2 {{#asyncio}} * aiohttp >= 3.8.4 diff --git a/sdks/python/templates/pyproject.mustache b/sdks/python/templates/pyproject.mustache index 8dab7dec7..5539d1468 100644 --- a/sdks/python/templates/pyproject.mustache +++ b/sdks/python/templates/pyproject.mustache @@ -12,7 +12,15 @@ include = ["{{packageName}}/py.typed"] [tool.poetry.dependencies] python = "^3.8" +{{^useCustomTemplateCode}} urllib3 = ">= 1.25.3, < 3.0.0" +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +urllib3 = [ + { version = ">= 2.8.0, < 3.0.0", python = ">=3.10" }, + { version = ">= 1.25.3, < 3.0.0", python = "<3.10" }, +] +{{/useCustomTemplateCode}} python-dateutil = ">= 2.8.2" {{#asyncio}} aiohttp = ">= 3.8.4" diff --git a/sdks/python/templates/requirements.mustache b/sdks/python/templates/requirements.mustache index 82746ec22..ee1e9efae 100644 --- a/sdks/python/templates/requirements.mustache +++ b/sdks/python/templates/requirements.mustache @@ -1,4 +1,10 @@ +{{^useCustomTemplateCode}} urllib3 >= 1.25.3, < 3.0.0 +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +urllib3 >= 2.8.0, < 3.0.0; python_version >= "3.10" +urllib3 >= 1.25.3, < 3.0.0; python_version < "3.10" +{{/useCustomTemplateCode}} python_dateutil >= 2.8.2 {{#asyncio}} aiohttp >= 3.8.4 diff --git a/sdks/python/templates/setup.mustache b/sdks/python/templates/setup.mustache index be7880b0a..1c4359641 100644 --- a/sdks/python/templates/setup.mustache +++ b/sdks/python/templates/setup.mustache @@ -17,7 +17,13 @@ NAME = "{{{projectName}}}" VERSION = "{{packageVersion}}" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ +{{^useCustomTemplateCode}} "urllib3 >= 1.25.3, < 3.0.0", +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + "urllib3 >= 2.8.0, < 3.0.0; python_version >= '3.10'", + "urllib3 >= 1.25.3, < 3.0.0; python_version < '3.10'", +{{/useCustomTemplateCode}} "python-dateutil >= 2.8.2", {{#asyncio}} "aiohttp >= 3.8.4",