Skip to content
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

numexpr work arround #1948

Closed
wants to merge 3 commits into from
Closed

numexpr work arround #1948

wants to merge 3 commits into from

Conversation

kif
Copy link
Member

@kif kif commented Sep 14, 2023

I am not especially happy to put in place such work around, I find it pretty ugly but something is needed while waiting for the issue to be fixed upstream.

What I did, theer is a hook to import numexpr from third_party where numexpr is locally patch (or not) to tell it not to sanitize the input. Unfortunately, this has to be done in 2 different ways, using the environment variable for numexpr.evaluate and patching the class for numexpr.NumExpr. Apparently it works. If you have a better idea, I would be happy to hear it.

@kif kif requested review from t20100 and loichuder September 14, 2023 12:07
@loichuder
Copy link
Member

Since there is only one problematic version, would it be possible instead in the requirements of the project to disallow the version 2.8.6 of numexpr ?

Like putting numexpr != 2.8.6 in requirements.txt and other relevant places ?

@t20100
Copy link
Member

t20100 commented Sep 14, 2023

@loichuder proposition is a lot simpler.
Using numexpr!=2.8.6 in install_requires should do the job:

pyFAI/setup.py

Lines 982 to 991 in 177f7db

install_requires = [
numpy_requested_version,
"h5py",
"fabio>=0.5",
"matplotlib",
"scipy",
"numexpr",
# for the use of pkg_resources on script launcher
"setuptools<60.0.0",
"silx>=1.1"]

@kif
Copy link
Member Author

kif commented Sep 14, 2023

setup.py is no more used (left for legacy reason, to be remove in next actual release). The same is true for requirements.txt, so I am not in favour of this option.

@t20100
Copy link
Member

t20100 commented Sep 14, 2023

setup.py is no more used

Indeed, but the same applies for pyproject.toml:

pyFAI/pyproject.toml

Lines 39 to 47 in 177f7db

dependencies = [
'numpy',
'h5py',
'fabio',
'silx',
'numexpr',
'scipy',
'matplotlib'
]

@kif
Copy link
Member Author

kif commented Sep 15, 2023

Replaced by solution #1950

@kif kif closed this Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants