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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update YAPF #2464

Closed
gruns opened this issue May 4, 2018 · 5 comments
Closed

Update YAPF #2464

gruns opened this issue May 4, 2018 · 5 comments

Comments

@gruns
Copy link
Contributor

gruns commented May 4, 2018

coala-bears' YAPF (https://github.com/google/yapf) version is the old v0.16.0,
released over a year ago on Feb 5, 2017, when dinosaurs still roamed the earth
馃槉.

How should I upgrade YapfBear to the latest v0.21.0?

I was unable to find any coala documentation that describes how to upgrade a
Bear's dependencies. However, past commits, like

show the basic gist. Are these

  1. bear-requirements.txt
  2. YapfBear.py
  3. bear-requirements.yaml

the only files that need to be modifed to update YAPF to v0.21.0 (assuming all
tests pass gloriously, of course)?

@jayvdb
Copy link
Member

jayvdb commented May 4, 2018

Looks like you've roughly found the process.

You can just modify the Requirement in the bear, and then run .ci/generate_bear_requirements.py which updates bear-requirements.yaml, and then run moban which generates bear-requirements.txt

But editing them by hand should also work.

If the manual editing doesnt match the generated version, the CI will give you a diff to show you the alteration that is needed.

@gruns
Copy link
Contributor Author

gruns commented May 4, 2018

Two things:

  1. Running .ci/generate_bear_requirements.py removes memento_client and
    munkres3 from bear-requirements.yaml.
$ git diff bear-requirements.yaml
diff --git a/bear-requirements.yaml b/bear-requirements.yaml
index 84ba9a9..1e84213 100644
--- a/bear-requirements.yaml
+++ b/bear-requirements.yaml
@@ -151,10 +151,6 @@ pip_requirements:
     version: ~=3.4.0
   lxml:
     version: ==3.6.0
-  memento_client:
-    version: ~=0.6.1
-  munkres3:
-    version: ~=1.0
   mypy-lang:
     version: ~=0.4.6
   nbformat:
@@ -192,4 +188,4 @@ pip_requirements:
   yamllint:
     version: ~=1.6.1
   yapf:
-    version: ~=0.16.0
+    version: ~=0.21.0

I didn't touch anything related to memento_client or munkres3. Is this
expected and acceptable?

  1. Three unrelated tests fail.
$ pytest
...
E   AssertionError: 0 == 0 : The local bear 'ESLintBear' yields no result although it should.
...
E   AssertionError: 0 == 0 : The local bear 'GoVetBear' yields no result although it should.
...
E   AssertionError: 0 == 0 : The local bear 'GoVetBear' yields no result although it should.

These three tests fail with, or without, my changes. A simple

$ git clone git@github.com:coala/coala-bears.git
$ cd coala-bears/
$ pytest
...
E   AssertionError: 0 == 0 : The local bear 'ESLintBear' yields no result although it should.
E   AssertionError: 0 == 0 : The local bear 'GoVetBear' yields no result although it should.
E   AssertionError: 0 == 0 : The local bear 'GoVetBear' yields no result although it should.

yields these three errors.

For context, here's the complete diff:

$ git diff
diff --git a/bear-requirements.txt b/bear-requirements.txt
index 74fadd8..bb2e81d 100644
--- a/bear-requirements.txt
+++ b/bear-requirements.txt
@@ -37,4 +37,4 @@ scspell3k~=2.0
 vim-vint~=0.3.12
 vulture~=0.25.0
 yamllint~=1.6.1
-yapf~=0.16.0
+yapf~=0.21.0
diff --git a/bear-requirements.yaml b/bear-requirements.yaml
index 84ba9a9..1e84213 100644
--- a/bear-requirements.yaml
+++ b/bear-requirements.yaml
@@ -151,10 +151,6 @@ pip_requirements:
     version: ~=3.4.0
   lxml:
     version: ==3.6.0
-  memento_client:
-    version: ~=0.6.1
-  munkres3:
-    version: ~=1.0
   mypy-lang:
     version: ~=0.4.6
   nbformat:
@@ -192,4 +188,4 @@ pip_requirements:
   yamllint:
     version: ~=1.6.1
   yapf:
-    version: ~=0.16.0
+    version: ~=0.21.0
diff --git a/bears/python/YapfBear.py b/bears/python/YapfBear.py
index 4b2b10a..faa9384 100644
--- a/bears/python/YapfBear.py
+++ b/bears/python/YapfBear.py
@@ -12,7 +12,7 @@ from coalib.results.Diff import Diff
 class YapfBear(LocalBear):
     LANGUAGES = {'Python', 'Python 2', 'Python 3'}
     AUTHORS = {'The coala developers'}
-    REQUIREMENTS = {PipRequirement('yapf', '0.16.0')}
+    REQUIREMENTS = {PipRequirement('yapf', '0.21.0')}
     AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
     LICENSE = 'AGPL-3.0'
     CAN_FIX = {'Formatting'}

If items #1 and #2 above are expected, I'll create a PR for this diff and update
yapf to v0.21.0.

@jayvdb
Copy link
Member

jayvdb commented May 5, 2018

Item 1 is not expected. I have not seen/heard of that occurring, so I am not sure why that might occur. #2459 was just merged, and .travis.yml runs .ci/generate_bear_requirements.py, so anything temperamental should be seen there.

Anyway, can you manually re-add those lines. Your diff otherwise looks good.

Item 2 is not unexpected, and can be ignored. It means there is something different with your eslint and govet, compared to our CI, and it isnt surprising that could happen. Lots of factors involved, including different versions of go and node, eslint, and eslint plugins.

@gruns
Copy link
Contributor Author

gruns commented May 8, 2018

@jayvdb Awesome. See #2470.

gruns added a commit to gruns/coala-bears that referenced this issue May 8, 2018
gruns added a commit to gruns/coala-bears that referenced this issue May 8, 2018
gruns added a commit to gruns/coala-bears that referenced this issue May 9, 2018
gitmate-bot pushed a commit to gruns/coala-bears that referenced this issue May 9, 2018
@gruns
Copy link
Contributor Author

gruns commented May 9, 2018

Thank you for your help and input, @jayvdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants