-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use pathlib #176
Comments
pytest now also has a |
This should be relatively straightforward to introduce, at least in some places. If someone picks this up, please split it up into smaller changes/PRs (e.g. one per file or maybe subdirectory) rather than one big one. |
I'd like to try my hand at this if no one has started yet. |
I am interested in working here too. Would you guys tell me which ones you've already done so we won't be doing the same thing? |
I haven't heard back from @rbong so far, so I guess this is okay to take. Nothing has been done so far really. I'd recommend you start inside |
This is okay to take. I was still figuring out how I was going to split this up. |
Agreed, that's a good question. I'd like to avoid having one big refactoring PR, especially because that's likely to introduce even more conflicts with the already big PR backlog. Thus my suggestion to start with Inside |
Cool.I've started with scripts/asciidoc2html.py And can you tell how we can test to ensure that the changes that we make won't break anything? I figure the answer is somewhere in https://github.com/qutebrowser/qutebrowser/blob/master/doc/contributing.asciidoc#running-specific-tests but couldn't find tests for the scripts. |
There are only very few tests for scripts. For |
Hi. Would it be better to use pathlib for directory creation as well? And shall we retain use of |
I'd say so - pretty much anywhere.
Do you have a more concrete example? |
The If we convert What do you think? |
I'd prefer using the Performance-wise we might need to think about it in cases where the whole application is affected (e.g. |
Would it be good to add type hints? It would make stuff more readable and even be usable by mypy. |
Modified asciidoc2html script. Couldn't figure out using type hints there though. Can you have a look? |
What could be a suitable area to change next? Would changing |
@ju-sh Yeah, that'd be great! Hard to estimate how much effort it'd be - Maybe it would make sense to split the work into multiple PRs though, since there's still some manual work involved. From a quick look at the usages, what do you think about opening separate PRs for:
That would help keeping the changes reasonably small and easy to review. Not sure how well it'll work out in practice, though. Probably doesn't make much sense to add mypy type hints in the tests FWIW. |
Hi. Here's some info that might be helpful while making changes related to this issue.
Hope this is useful. Please correct or augment if there's a mistake or anything to add. |
@ju-sh Thanks, that'll be helpful if others want to jump in as well! The only thing I have to add is that @rbong @ju-sh Do you still intend to continue working on this, or is this something someone else could continue on? |
@The-Compiler Sorry it's been so long and late.. I couldn't find enough time to keep working towards finishing this task on a regular basis. Having more people working on this would be better. |
No worries, and thanks for getting the ball rolling! |
This means sessions need to be initialized after websettings, because initializing websettings also initializes QtWebEngine and thus qutescheme. This needs to happen before sessions.init() calls version.webengine_versions(). I don't think this should be a problem, as they are independent to each other. Fixes #5738 See #5359 Also switches sessions.init() to pathlib, see #176.
If anyone else wants to help with this, I've replaced almost everything and have multiple branches for this on my fork
I 'll also add type hints if I have the time (any help welcome ) |
Windows is just painful : https://bugs.python.org/issue32434 You get inconsistent behaviour of pathlib.exists and resolve when you feed them with a path that does not actually exists |
We could use pathlib to make some stuff cleaner/easier:
https://docs.python.org/3/library/pathlib.html
The text was updated successfully, but these errors were encountered: