feat(python): Relax strict urllib3 version pin #SCD-642#1048
Conversation
There was a problem hiding this comment.
Pull request overview
Relaxes the previously strict urllib3 upper pin in the generated Python client templates while still excluding the problematic urllib3==2.6.0.
Changes:
- Updates
setup.mustachetemplates to accepturllib3<3while excluding2.6.0. - Updates
requirements.mustachetemplates to accepturllib3<3while excluding2.6.0. - Updates README dependency examples to match the relaxed constraint.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| openapi-generator/templates/python/setup.mustache | Relax urllib3 constraint in generated setup.py requirements. |
| openapi-generator/templates/python/requirements.mustache | Relax urllib3 constraint in generated requirements.txt. |
| openapi-generator/templates/python/python-experimental/setup.mustache | Mirrors relaxed urllib3 constraint for experimental generator. |
| openapi-generator/templates/python/python-experimental/requirements.mustache | Mirrors relaxed urllib3 constraint for experimental requirements. |
| openapi-generator/templates/python/python-experimental/README_onlypackage.mustache | Updates documented dependency range for urllib3. |
| openapi-generator/templates/python/README_onlypackage.mustache | Updates documented dependency range for urllib3. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # http://pypi.python.org/pypi/setuptools | ||
|
|
||
| REQUIRES = ["urllib3>=1.15,<2.6", "six >= 1.10", "certifi", "python-dateutil"] | ||
| REQUIRES = ["urllib3>=1.15,<3,!=2.6.0", "six >= 1.10", "certifi", "python-dateutil"] |
There was a problem hiding this comment.
The urllib3 lower bound here (>=1.15) is inconsistent with the requirements.mustache lower bound (>=1.15.1) and the README examples (>=1.15). This makes it harder to reason about the actual supported range and can lead to mismatched installs depending on which artifact a consumer uses. Recommend standardizing the urllib3 specifier (same lower bound + exclusions) across setup/requirements/README templates.
| REQUIRES = ["urllib3>=1.15,<3,!=2.6.0", "six >= 1.10", "certifi", "python-dateutil"] | |
| REQUIRES = ["urllib3>=1.15.1,<3,!=2.6.0", "six >= 1.10", "certifi", "python-dateutil"] |
| python_dateutil >= 2.5.3 | ||
| setuptools >= 21.0.0 | ||
| urllib3 >= 1.15.1, < 2.6 | ||
| urllib3 >= 1.15.1, < 3, != 2.6.0 |
There was a problem hiding this comment.
The version specifier formatting differs between templates (e.g., urllib3>=1.15,<3,!=2.6.0 in setup.mustache vs urllib3 >= 1.15.1, < 3, != 2.6.0 here). While both are valid, keeping consistent spacing/formatting across generated artifacts improves readability and reduces churn in downstream diffs. Consider adopting one canonical style (with or without spaces) across all templates.
| urllib3 >= 1.15.1, < 3, != 2.6.0 | |
| urllib3>=1.15.1,<3,!=2.6.0 |
Due to temporarily broken urllib3 (v2.6.0) dependencies, we pinned the version in our Python library. As the urllib maintainers rolled back the change, we don't need to keep the pin anymore, so I relaxed the constraint.