coala / coala-bears

Bears for coala
https://coala.io/
GNU Affero General Public License v3.0
294 stars 580 forks source link

pip fails to upgrade six on python3.4 #2885

Open abhishalya opened 5 years ago

abhishalya commented 5 years ago

jsonschema has dropped support for Python3.4 as reported on gitter by @bkhanale.

The failure is here.

shivank1234 commented 5 years ago

What do we have to do here in a nutshell @abhishalya ?

abhishalya commented 5 years ago

The internal dependency seems to be conflicting, one of the reasons maybe the one I mentioned in the issue. We need a workaround, finally the goal is to make CI green.

I would request you to work on your own fork before submitting a PR, since if you activate travis on your PR you could check the build status (without the need of creating a PR).

shivank1234 commented 5 years ago

Cool I'll work upon it

AkshJain99 commented 5 years ago

@abhishalya so did you find a solution to fix this ? i too faced the travis failed

abhishalya commented 5 years ago

@abhishalya so did you find a solution to fix this ?

@AkshJain99 No, I haven't worked upon it yet. I guess @shivank1234 wanted to work on this issue.

i too faced the travis failed

Where do you face this issue?

AkshJain99 commented 5 years ago

i got this issue while adding one bear, for python 3.5 and 3.6 its working good but for python 3.4 itz not working

abhishalya commented 5 years ago

Ah, this should be closed via https://github.com/coala/coala-bears/pull/2890 @KVGarg.

KVGarg commented 5 years ago

@abhishalya Adding six~=1.11.0 to bear-requirements.txt is making Travis CI a perfect green. Have a look https://travis-ci.com/KVGarg/coala-bears/builds/104618212 But I guess adding a new dependency to bear-requirements.txt won't be accepted IMO. I think this change is needed to be done in the coala-core repository because the error also says that there is a version conflict with dependency installed by the coala repository.

abhishalya commented 5 years ago

@KVGarg No, we can't do that. six is not our direct dependency (not coala or coala-bears). Its indirect.

You are free to research on it, I'll could only work on this tomorrow. If you fixed it you can append the changes to your PR.

KVGarg commented 5 years ago

After updating the versions of several packages acc. to openSuse Build log the error shouldn't have been raised because there many packages that has a requirement of six>=1.11.0 but the package gets installed without satisfying this condition on travis CI. IDK why is this happening ? HTTPolice, jsonschema, packaging etc. are dependencies that currently require six>=1.11.0.

KVGarg commented 5 years ago

After spending hours on it, I'm just able to find only one workaround to solve this problem - pip install six -U in the travis.yml packaging~=16.8 has a requirement of six (any version) HTTPolice~=0.7.0 has a requirement of six~=1.10.0 jsonschema~=3.0.1 has a requirement of six~=1.11.0

six>=1.11.0 isn't getting installed anywhere in the program by any dependency. The virtual env created already includes package six which is being used by Travis CI and hence doesn't install any new of six. And when we create venv using base Python3.4 version six~=1.10.0 is included which is causing a conflict error.

KVGarg commented 5 years ago

@abhishalya did you find any solution to this problem?

abhishalya commented 5 years ago

@abhishalya did you find any solution to this problem?

Sorry I was busy with my classes. Besides your findings are incorrect. pip won't install a package unless its told. Creating a new virtualenv in python3.4 won't include six by default (I verified this myself). The six is being used by many of the requirements, and is being installed by one of them first. I'll experiment few things today and will let you know.

KVGarg commented 5 years ago

Creating a new virtualenv in python3.4 won't include six by default

Yeah, it's not getting included. Few days back I created a new env for coala-bears at that time it included six now I created a new env and it's not including 😄 Maybe I used some diff. instruction to create a new env.

abhishalya commented 5 years ago

The six >= 1.11.0 dependency is as follows:

coala-bears==0.12.0.dev99999999999999
  - nbformat [required: ~=4.1]
    - jsonschema [required: >=2.4,!=2.5.0]
      - six [required: >=1.11.0]

Hence the dependency is third-order and idk why it gets ignores somehow. The six is never checked for version >= 1.11.0. To install six >= 1.11.0, I tried the following methods but the results were not satisfying:

  1. Change the order of the requirements giving nbformat the highest priority.
  2. Delete the cache on travis.
  3. Use pip install --no-cache-dir -r requirements.txt in install section.
  4. Locally try to install requirements on a Python3.4 virtualenv.

Step 1, 2 and 3 resulted in same results. The six 1.10.0 was already satisfied when installing requirements (idk why though). When doing step 4 six 1.12.0 was getting installed, which was expected. So, till now I think the only option is to include six in requirements.txt file.

If anyone has any suggestions please comment here, I would like to know what I am missing here.

KVGarg commented 5 years ago

Satisfied with your research. I was able to figure out these findings and finded a workaround of either installing six>=1.11.0 Or upgrading the current version of six using pip. Till now, I guess these are the only two possible solutions for making the CI green.

sladyn98 commented 5 years ago

@KVGarg Upgrading the current version of six resulted in a travis red.I tried it out in one of the builds but I am not too sure.IMO adding it to the bear requirements.txt seems a bit more sane option.

abhishalya commented 5 years ago

Upgrading six on travis is not a very good option since it has the most chance of breaking the function of other dependencies. We need to keep the version for six manually updated with the requirements in coala-bears (through which we could avoid breakages).

Upgrading the current version of six resulted in a travis red

This seems a bit odd to me. Do you mean that six 1.12.0 is incompatible? Could you link the build log here.

KVGarg commented 5 years ago

IMO adding it to the bear requirements.txt seems a bit more sane option.

👍

abhishalya commented 5 years ago

Irrelevant now due to https://github.com/coala/coala-bears/pull/2910

jayvdb commented 5 years ago

Problem still exists. PR was wrong because bear-requirements.txt is generated from the metadata inside the bears.

test-requirements.txt is where we do fixes for our CI, working around pip oddities. And that needs to be done in mobans repo so that the fixes are available in all our repos. Issue raised there https://gitlab.com/coala/mobans/issues/110 , and has a PR.

abhishalya commented 5 years ago

test-requirements.txt is where we do fixes for our CI, working around pip oddities. And that needs to be done in mobans repo so that the fixes are available in all our repos. Issue raised there https://gitlab.com/coala/mobans/issues/110 , and has a PR.

Yep, I got that now :)