Removes legacy Python 2 code, now that support has been deprecated.
Removes dependencies that were required for Python 2 support.
Updates the Python generator to use newer language features available in Python 3.
Updates the code formatting tools, resulting in cleaner SDK generation.
Does not introduce breaking changes to the public API.
Description
This PR makes several improvements to the Python SDK:
Removes the six dependency, which was only present for Python 2 compatibility. Imports and references to the library have been removed from the SDK codebase.
Improves the requirements.txt and test-requirements.txt files by imposing stricter version ranges to avoid potential future conflicts when new majors of dependencies are released.
Improves the setup.py file by removing the redundant dependency version manifest. It now imports the existing requirements.txt file, as the manifests are identical.
Cleans up imports, removing unused references and logically sorting lists.
Removes unnecessary typing imports, as we aren't using type aliases. References were to native types already supported in Python 3.10.
Disregard any failing tests on that pull request; these are due to changes in the code formatting rules mentioned above changes, and the version of urllib3 we're currently required to support.
[ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
[x] The correct base branch is being used, if not main
[ ] I have added tests to validate that the change in functionality is working as expected
This PR:
Description
This PR makes several improvements to the Python SDK:
six
dependency, which was only present for Python 2 compatibility. Imports and references to the library have been removed from the SDK codebase.requirements.txt
andtest-requirements.txt
files by imposing stricter version ranges to avoid potential future conflicts when new majors of dependencies are released.setup.py
file by removing the redundant dependency version manifest. It now imports the existingrequirements.txt
file, as the manifests are identical.typing
imports, as we aren't using type aliases. References were to native types already supported in Python 3.10.# noqa: ...
, etc.)# coding: utf-8
header line from source files, as this is the default assumed in Python 3.Besides this, it introduces a number of code formatting tools to produce a cleaner, more efficient SDK result:
There are no breaking changes to the public API.
References
You can review what the resulting SDK output looks like here: https://github.com/openfga/python-sdk/pull/75.
Disregard any failing tests on that pull request; these are due to changes in the code formatting rules mentioned above changes, and the version of
urllib3
we're currently required to support.Review Checklist
main