-
Notifications
You must be signed in to change notification settings - Fork 48
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
Refactor: Relative imports / imports without try block #200
base: master
Are you sure you want to change the base?
Conversation
f75dc33
to
7448485
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After resolving the conflict and I'll merge this ASAP
- Fixed relative imports - Removed import handling via ImportError exception - Fixed CI by running via module, instead of file - Added / improved handling in __init__.py for unit tests
7448485
to
3f2fae1
Compare
Done, but it seems that these changes are not compatible with the new CI script. |
Are you sure |
I'll have to test locally later. |
Yes, they are just relative imports. I tested them in Proton via. some games in Steam. This also enables Pyright and transforms the code base from a bunch of independent files that somehow references each other to an actual project. I'm not sure how it even references |
Well, I can reproduce the error. Change the directory to gamefixes-steam, invoke python, then try to import with |
I guess another way is to use umu-launcher and run all the fixes through it which I have been avoiding. Because of course, it'll take a while though even when running it concurrently. |
This is expected behaviour in Python, but imports can get ugly pretty fast there anyways.
I don't think this is necessary, as pyright is a well known and maintained solution. Nonetheless, you would only need to run it once over the full set of fixes. The github workflow should give you a list of changed files, as far as I know. This could be used for incremental checks. EDIT: |
Cherry-picked and adopted from #152
The unit tests no longer require imports in a try block.
Also, the game fixes imports have been replaced to be relative, as this is necessary for static type checking.