Skip to content

Conversation

@Avasam
Copy link
Collaborator

@Avasam Avasam commented Dec 31, 2022

utils.colored's signature now correctly reflects termcolor.colored
Attempt in scripts/runtests.py to deduplicate the same fallback (using utils module in an outside folder).
I think the solution is fine, but you tell me. VSCode can pick-up the source just fine, mypy might need an extra mypy_path="tests" to remove # type: ignore[import] at line 13.
Edit: Apparently it wasn't a great solution (see comments below)

@AlexWaygood
Copy link
Member

Eeeeee, I have a strong aversion to mucking about with sys.path 😅 I've heard lots of horror stories about where that gets you...

@Avasam
Copy link
Collaborator Author

Avasam commented Dec 31, 2022

[...] I've heard lots of horror stories about where that gets you...

I'll trust your experience on that !
If there's no better solution, it's not that bad of a code duplication, so I can go back to using a fallback (but the one with proper signature).
I was thinking eventually it could use the test scripts directly from within python, instead of having to call a subprocess.

@AlexWaygood
Copy link
Member

If there's no better solution, it's not that bad of a code duplication, so I can go back to using a fallback (but the one with proper signature).

Yeah, that sounds fine to me for now :)

@AlexWaygood AlexWaygood merged commit 46f0d91 into python:main Dec 31, 2022
@Avasam Avasam deleted the termcolor.colored-type-declaration branch December 31, 2022 23:17
@AlexWaygood AlexWaygood changed the title Accurate, deduplicated, termcolor.colored fallback A more accurate termcolor.colored fallback Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants