[pyqt5to6] store enums to allow usage without QGIS #59992
+114
−56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a first attempt to use this script without QGIS or PyQt6 available.
This would allow to create an easily installable package and create a pre-commit hook so it could be easily integrated to facilitate the transition.
But it seems a bit more complicated than thought.
Especially here:
https://github.com/3nids/qgis-pyqt5to6/blob/7fc059c5a41f7538f39e9ff7ac86a920aa2e315a/pyqt5to6/pyqt5to6.py#L455
https://github.com/3nids/qgis-pyqt5to6/blob/7fc059c5a41f7538f39e9ff7ac86a920aa2e315a/pyqt5to6/pyqt5to6.py#L657-L668
The idea would be to store everything in json files that would be used when QGIS/PyQt6 are not available.
@nyalldawson do you think it's possible in a reasonnable effort to do so?