-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
💫 Improve compatibility checks for platform and Python version #983
Comments
Hi @ines , I don't know if you'd consider this a "good" example 😅 but I've used a separate |
Thanks, this is looks good! I like the underscore naming conventions, I think we should probably adopt this concept. Here's some of my work in progress btw: https:/explosion/spaCy/blob/develop/spacy/compat.py |
Already implemented in v1.8.0 – there's probably more to do and to fix, but for now, it's already working pretty well. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
To prevent Python 2/3 compatibility problems and improve performance on Windows, we need a better way of managing compatibility checks. Copying over my comment from #982:
Current state
sys
(unideal)json.dumps
usingsix
for Python version check (good, should be extended and standardised)Suggested solution
Introduce a
spacy.compat
module that includes replacements for all functions that require different versions depending on Python version or platform. Those functions should always be imported from that module instead of using them directly.spacy.compat
could also expose a more general function that returnsTrue
/False
for specific configurations. This should only be used in selected cases, for example to print specific error messages or warnings inspacy.cli
.Questions / Considerations
unicode
stuff,pathlib
transforms, ...The text was updated successfully, but these errors were encountered: