-
Notifications
You must be signed in to change notification settings - Fork 69
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
scandir doesn't gracefully handle non-available compiler #73
Comments
How do other packages handle this? I'm not particularly interested (and don't have the time!) to learn how to create binary builds and wheels for different platforms. What's the actual cause of the gcc problem here? |
I don't know about other packages, but what I do for ruamel.yaml is try and compile a small program (which also tests if the library libyaml is installed), and if that doesn't work ext_modules in setup.py is set to None. It don't try to do this test-compile if '--version' is in sys.argv, or '--restructuredtext' or 'sdist' as those indicate invocations by pip that are done during my build process that don't involve actual installation (you probably only have to compile when pip calls setup.py with Testing what happens when the compiler is not there can easily be faked by temporarily setting the environment variables |
I think I'm going to close this -- I think it should fail hard on a missing compiler, as the main purpose of scandir is to speed things up. You lose a lot of that speed benefit if it falls back to the pure Python implementation, which is really not "scandir proper". |
I just ran into this trying to install I don't have a good answer for creating cross-platform wheels, though. I've been lucky enough to be able to rely on universal wheels for my own python packages. |
Fwiw, |
The following
Dockerfile
(getpip.py
in directorypip
coming from https://pip.pypa.io/en/stable/installing/ ):gives a compile error that breaks any packages depending on scandir
AFAIK code using scandir will still work with the default
os.walk()
so transparent fall-back seems to be in order in case compilation cannot work.The alternative would be to provide version specific whl files (e.g. using manylinux) with some noop wheels for 3.5 and higher.
The text was updated successfully, but these errors were encountered: