-
Notifications
You must be signed in to change notification settings - Fork 1
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
Old python version support #1
Comments
In production environments, the system's dependencies are often quite outdated. However, in development, we often wish to utilize new language features to help us build a more robust software. This can be a challenging situation, where we need to find a balance between utilizing new technologies and ensuring compatibility with older systems. Fortunately, this library is relatively simple, and we can easily remove some of the new language features to make it compatible with lower versions of Python. Here is a short script which gets rid of all type hints and for f in $(find emcfile/ -name "*.py");
do
echo $f
strip-hints $f --inplace --to-empty
sed -i -e '/^from typing.*/a from typing import List' \
-e 's/\/,//g' \
-e 's/import numpy.typing.*//g' \
-e 's/npt.NDArray/List/g' $f
done To run this script, a python package is needed. |
I created a script based on your suggestion: https://github.com/JunCEEE/emcfile/blob/fix_py3.6/strip_hints.sh. And created a branch for python 3.6: https://github.com/JunCEEE/emcfile/tree/fix_py3.6 However, I got stuck in this error:
It seems that this syntax |
@JunCEEE You should use the lastest version. It is already fixed. |
Good job. I can install the package and run the tutorial quickly in the required environment.
However, many of the XFEL environments were deployed with an older python (e.g. 3.7). Would it be possible to make it compatible with older python versions (e.g. from 3.6)?
The error I got in python3.8:
The text was updated successfully, but these errors were encountered: