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
Jython support #105
Comments
Hi @fabioz -- thanks for the report. I have never used Jython and don't have the bandwidth to begin now, but I'd be happy to review a pull request if you can make this work in Jython as well as CPython. Presumably some if/else logic in setup.py? |
as far as i understood the scandir package cannot be supported on jython as it currently requires the c extension |
@RonnyPfannschmidt: scandir.py itself works fine without the C module installed, and falls back to a (slower!) Python version. That's handled here, for example: https://github.com/benhoyt/scandir/blob/master/scandir.py#L28-L31 But setup.py always tries to compile the extension module: https://github.com/benhoyt/scandir/blob/master/setup.py#L35 |
@benhoyt I don't personally use Jython either, but I do tests for the pydev debugger using pytest on Jython which now relies on |
if setup.py could opt out of building on missing compilers and /or unsupported pythons that would be fabulous |
I think that a fix here should be really simple and I wanted to prepare a pull request but I cannot reproduce the original issue. I am using virtual environment with Jython 2.7.1 and pip 18.0. When I try to build scandir manually, it just shows UserWarning and nothing more.
Pip doesn't even show any warning. Tested with installation from the local folder and also from PyPI.
scandir works and uses the Python implementation in all three cases
|
@frenzymadness at first glance this looks to me as if jython simly started to ignore c extensions - which is kind of horrific there should be a clear error if a extension is-requested but cant be build |
The steps I'm running to get the failure on travis (https://github.com/fabioz/PyDev.Debugger/blob/master/.travis.yml) are:
It seems that the pip being used in that case is some older (or maybe custom) version (1.6.dev1), so, I tried upgrading pip too with So, maybe there is some fix on Jython 2.7.1 itself -- although I can't really find it... the Jython download page: http://www.jython.org/downloads.html only points to 2.7.0. |
@fabioz I am using Jython 2.7.1 installed from distribution RPM on Fedora 28. |
@frenzymadness thanks... I was able to find a newer version on: http://repo1.maven.org/maven2/org/python/jython-installer/2.7.1/jython-installer-2.7.1.jar and with that version I get the same behavior you get ( |
Thanks folks. I've merged the commit to make extension optional and will follow up with a pip release when I get a chance. |
Done and on PyPI |
Right now, it seems doing a
pip install scandir
will fail on Jython with:error: Compiling extensions is not supported on Jython
As it seems like the library should work without extensions, I think there should be no issues in running it with Jython 2.7 (provided that it could be installed with pip).
Full output:
The text was updated successfully, but these errors were encountered: