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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💚 Add pylint in CI #39 #40

Merged
merged 102 commits into from Aug 23, 2020
Merged

💚 Add pylint in CI #39 #40

merged 102 commits into from Aug 23, 2020

Conversation

tkoyama010
Copy link
Member

@tkoyama010 tkoyama010 commented Jul 27, 2020

See #39
image

@tkoyama010 tkoyama010 marked this pull request as draft July 27, 2020 09:43
@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #40 into master will increase coverage by 2.92%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
+ Coverage   95.00%   97.92%   +2.92%     
==========================================
  Files           5        5              
  Lines         440      434       -6     
==========================================
+ Hits          418      425       +7     
+ Misses         22        9      -13     

@tkoyama010 tkoyama010 changed the title Add pylint in CI #39 🚧 Add pylint in CI #39 Jul 29, 2020
@GuillaumeFavelier
Copy link
Contributor

Do you need help with this @tkoyama010 ? I could push to the PR if you want.

@tkoyama010
Copy link
Member Author

@GuillaumeFavelier It will take time to resolve the error, so I appreciate your help. Thanks ☺

@GuillaumeFavelier
Copy link
Contributor

Locally it's 8.87/10 but on Github Actions it's actually 7.40/10. One way to fix this is probably to install the requirements_test.txt.

@GuillaumeFavelier
Copy link
Contributor

I set up python correctly with all dependencies but apparently python-lint is built with docker so it did not change anything.

In this context, I have no solution to fix:

pyvistaqt/plotting.py:47:0: E0401: Unable to import 'numpy' (import-error)
pyvistaqt/plotting.py:48:0: E0401: Unable to import 'vtk' (import-error)
pyvistaqt/plotting.py:50:0: E0401: Unable to import 'scooby' (import-error)
pyvistaqt/plotting.py:52:0: E0401: Unable to import 'vtk.qt.QVTKRenderWindowInteractor' (import-error)
pyvistaqt/plotting.py:53:0: E0401: Unable to import 'PyQt5' (import-error)
pyvistaqt/plotting.py:54:0: E0401: Unable to import 'PyQt5.QtCore' (import-error)
pyvistaqt/plotting.py:55:0: E0401: Unable to import 'PyQt5.QtWidgets' (import-error)
pyvistaqt/plotting.py:69:0: E0401: Unable to import 'pyvista' (import-error)
pyvistaqt/plotting.py:70:0: E0401: Unable to import 'pyvista.utilities' (import-error)
pyvistaqt/plotting.py:71:0: E0401: Unable to import 'pyvista.plotting.plotting' (import-error)
pyvistaqt/plotting.py:72:0: E0401: Unable to import 'pyvista.plotting.theme' (import-error)

If someone has an idea, please chime in. Meanwhile, I'll restore the workflow how it was.

@tkoyama010
Copy link
Member Author

tkoyama010 commented Jul 29, 2020

Pylint said that plotting.py code is too big (C0302).
https://github.com/pyvista/pyvistaqt/runs/923356349?check_suite_focus=true#step:4:14

According to this diagram. We should split this to BackgroundPlotter and MainWindow. How do @GuillaumeFavelier @akaszynski
@banesullivan @larsoner think?

"""
Diagram
^^^^^^^
.. code-block:: none
BackgroundPlotter
+-- QtInteractor
|-- QVTKRenderWindowInteractor
| +-- QWidget
+-- BasePlotter
MainWindow
+-- QMainWindow

@GuillaumeFavelier
Copy link
Contributor

BackgroundPlotter depends on MainWindow but not the other way around. We could put the MainWindow class into a window.py file? Same idea for Counter in counter.py.

ScaleAxesDialog and FileDialog could go into dialog.py.
DoubleSlider and RangeGroup could be moved too I think.

@tkoyama010
Copy link
Member Author

Thak you for reading this PR 🙇 Since it is currently difficult to satisfy all of the pylint criteria, we may want to determine which errors and warnings to ignore.

@banesullivan
Copy link
Member

I'm in favor of @GuillaumeFavelier's suggestions for splitting up the modules

@GuillaumeFavelier
Copy link
Contributor

@tkoyama010 I let you resolve the conflicts the way you prefer :)

@GuillaumeFavelier GuillaumeFavelier mentioned this pull request Jul 31, 2020
@tkoyama010
Copy link
Member Author

As we know pylint is the hardest code checker. Let's resolve pycodestyle in #45 and flake8 in #46 first 🚀 It will also reduce the error of pylint too.

pyvistaqt/plotting.py Outdated Show resolved Hide resolved
pyvistaqt/plotting.py Outdated Show resolved Hide resolved
@tkoyama010 tkoyama010 changed the title Add pylint in CI #39 💚 Add pylint in CI #39 Aug 16, 2020
@tkoyama010 tkoyama010 marked this pull request as draft August 18, 2020 08:49
@tkoyama010 tkoyama010 marked this pull request as ready for review August 18, 2020 09:26
@GuillaumeFavelier
Copy link
Contributor

@tkoyama010 this is fairly big contribution, I may take some time to review this one.

Meanwhile, I detected a regression in an IPython environment. The following is still needed for example:

from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import QTimer, pyqtSignal
from PyQt5.QtWidgets import QAction, QFrame, QMenuBar, QVBoxLayout

I will commit to restore this plus some minor changes.

@tkoyama010
Copy link
Member Author

@GuillaumeFavelier Thanks for your review. I am sorry that I could not find erorr of ipython. Could we add Ipython test and check it in CI? (It maybe another issue.)

@GuillaumeFavelier
Copy link
Contributor

Could we add Ipython test and check it in CI? (It maybe another issue.)

+100 for this, in another PR though :)

Copy link
Contributor

@GuillaumeFavelier GuillaumeFavelier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this is good to go 👍

What about the other @pyvista/developers ?

Copy link
Member

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no issues with this. Let me know if you're good with merging this.

@tkoyama010
Copy link
Member Author

Thanks @akaszynski I am ready for merge 🚀

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

Successfully merging this pull request may close these issues.

None yet

5 participants