-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Problem with pkg_resources in pytest 3.0 and Jython #1853
Comments
Hmm that's weird, doesn't Jython have the |
based on his maven config, it seems like he never added setuptools does it work when adding setuptools (i wont install maven on my box) |
@RonnyPfannschmidt setuptools is being used from the Maven plugin that install all the python packages, it doesn't need to be included in the POM file. @nicoddemus Jython does have the pkg_resources module. Thanks both for your comments so far :) We have just found this error comes from the Maven plugin that install all the python modules. It uses a very old version of setuptools (0.6) which is the one causing the problem. We can update that plugin, but we were suspecting maybe other people had the same problem and you would consider making a change in the next release to only install pkg_resources when necessary, like you did in the past here, for example. |
@raquel-ucl so if setuptools is there, why is it not availiable? pytest itself should even work with a broken old one like 0.6 since its only trying for entrypoints |
Sorry, I might have wrongly assumed such old version of setuptools might not include it. Then I don't understand why the error is happening :( |
When we depend on |
@raquel-ucl I'm not familiar with Jython or Maven at all - but could it be possible that that tool itself has setuptools available, but doesn't include it in the generated |
Fixed in #1854 |
I am working on a Jython project that is built with Maven and uses
py.test
. All was going fine up until the newpy.test 3.0
release. I keep on getting this error, which I can't really explain and dissappears if I usepy.test<3.0
:I have looked briefly in your code and I'll submit a small PR to move the import sentence in
_python/config.py
to inside the method that uses it. I think that'd solve the problem.Reproduce like this:
I'm using Maven 3.3.9 and Java 8. In order to reproduce this problem, you can install those and clone my work repo.
Then run the build:
This will automatically download the latest py.test (3.0) to be included in the deliverable JAR (plus many other things), and run some tests, which will fail with the above error message.
Note you can get rid of all these downloaded stuff by removing the packages from your maven folder in your home directory called
.m2
and thetarget
folder in the clone directory.The text was updated successfully, but these errors were encountered: