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

Remove Python 2.7 syntax and undeclared dependency #86

Merged
merged 6 commits into from
Jan 3, 2024

Conversation

mjpieters
Copy link
Contributor

@mjpieters mjpieters commented Oct 6, 2023

This PR applies some general clean-ups to the codebase:

  • Upgrade Python syntax use with pyupgrade. The project requires Python 3.7 or
    newer so older syntax is no longer needed.
  • Remove unused imports; this includes an undeclared dependency on six.
  • Use __all__ to explicitly mark imports as exported, removing the need to
    silence Flake8 linting.
  • Simplify loop over openapi types dictionary.

These changes should lower the support burden of the codebase and fixes #85

The removed lines no longer have an effect in a Python 3 codebase.
- re is not used anywhere in the model generated code
- inspect.getfullargspec is available from Python 3.4 onwards
This removes the need to disable flake8 in these modules.
The value of each key-value pair is ignored, just loop over the keys.
These modules are indirectly imported, but documentation shows these
need to be explicitly available for consumers of this library.

Without adding client and models to the exported names here, type
checkers and linters will flag using `onepasswordconnectsdk.client` and
`onepasswordconnectsdk.models` as invalid.
Copy link
Contributor

@volodymyrZotov volodymyrZotov left a comment

Choose a reason for hiding this comment

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

Great code clean up!

@volodymyrZotov volodymyrZotov merged commit bf1c6fa into 1Password:main Jan 3, 2024
@mjpieters mjpieters deleted the pyupgrade branch January 5, 2024 15:46
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.

Undeclared dependency: six (in generated code)
2 participants