Skip to content

Sip import fix #30

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Sip import fix #30

wants to merge 12 commits into from

Conversation

draperjames
Copy link
Owner

@zbarge try testing out this fork when you get the chance and let me know how it work for you. I haven't had any problems.

James Draper added 3 commits December 15, 2016 02:26
changed compat.py to rely on the qtpy package and deleted some of the
files listed in #7
Added qtpy to reqirements, cleaned up compat.py
@zbarge
Copy link
Collaborator

zbarge commented Dec 15, 2016

OK about to test now.

@draperjames
Copy link
Owner Author

If anything breaks in your env would you mind listing it here?

@zbarge
Copy link
Collaborator

zbarge commented Dec 16, 2016

It works OK for me - i get 9 failed tests though and "cannot import sip" still

@zbarge
Copy link
Collaborator

zbarge commented Dec 16, 2016

test accept/reject for CSVDialogs:

qapp = <PySide.QtGui.QApplication object at 0x00000000069AAE08>
request = <SubRequest 'qtbot' for <Function 'test_accept_reject'>>

@pytest.yield_fixture
def qtbot(qapp, request):
    """
    Fixture used to create a QtBot instance for using during testing.

    Make sure to call addWidget for each top-level widget you create to ensure
    that they are properly closed after the test ends.
    """
    result = QtBot(qapp)
    no_capture = request.node.get_marker('qt_no_exception_capture') or \
                 request.config.getini('qt_no_exception_capture')
    if no_capture:
        yield result  # pragma: no cover
    else:
        with capture_exceptions() as exceptions:
            yield result
        if exceptions:
          pytest.fail(format_captured_exceptions(exceptions))

E Failed: Qt exceptions in virtual methods:
E ________________________________________________________________________________
E File "C:\Users\Zeke\Google Drive\dev\python\qtpandas\qtpandas\views\CSVDialogs.py", line 657, in rejected
E self.exported.emit(False)
E
E TypeError: Value types used on meta functions (including signals) need to be registered on meta type: QBool
E ________________________________________________________________________________

@zbarge
Copy link
Collaborator

zbarge commented Dec 16, 2016

same test accept reject

Traceback (most recent call last):
File "C:\Users\Zeke\Google Drive\dev\python\qtpandas\qtpandas\views\CSVDialogs.py", line 657, in rejected
self.exported.emit(False)
TypeError: Value types used on meta functions (including signals) need to be registered on meta type: QBool
F
self = <tests.test_CSVDialogs.TestCSVExportWidget object at 0x00000000067F15F8>
qtbot = <pytestqt.plugin.QtBot object at 0x00000000067F1198>

def test_accept_reject(self, qtbot):
    csvwidget = CSVExportDialog()
    qtbot.addWidget(csvwidget)
    csvwidget.show()

    buttons = csvwidget.findChildren(QtGui.QPushButton)
    for button in buttons:
        qtbot.mouseClick(button, QtCore.Qt.LeftButton)
        if button.text() == 'Export Data':
            assert csvwidget.isVisible() == True
        else:
          assert csvwidget.isVisible() == False

E assert True == False
E + where True = <built-in method isVisible of CSVExportDialog object at 0x0000000006807048>()
E + where <built-in method isVisible of CSVExportDialog object at 0x0000000006807048> = <qtpandas.views.CSVDialogs.CSVExportDialog object at 0x0000000006807048>.isVisible

test_CSVDialogs.py:269: AssertionError

@zbarge
Copy link
Collaborator

zbarge commented Dec 16, 2016

F
def test_TimestampFormat():
model = DataFrameModel()
assert model.timestampFormat == Qt.ISODate
newFormat = "yy-MM-dd hh:mm"
model.timestampFormat = newFormat
assert model.timestampFormat == newFormat

    with pytest.raises(TypeError) as excinfo:
      model.timestampFormat = "yy-MM-dd hh:mm"

E Failed: DID NOT RAISE <class 'TypeError'>

test_DataFrameModel.py:66: Failed

HOTTIP: delete one thing at a time
Don't be like me if you need to remove somethings do it methodically.
Moved the contents of test/main.py to test/test_DataFrameModelManager.py
that way I can actually run the tests after a fresh install. Commented
out some requirements in setup.py.
@draperjames
Copy link
Owner Author

Okay try to do a fresh install of this last commit. I managed to get all of the tests to at least open at last count I have 5 failed, 147 passed, 2 errors.

@@ -1,4 +1,3 @@
recursive-include qtpandas *.py
recursive-include qtpandas/_lib *
recursive-include qtpandas/i18n *.qm
Copy link
Owner Author

Choose a reason for hiding this comment

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

Deleted this line b/c I deleted the corresponding directory.

from PySide.QtCore import Slot, Signal


QtCore = QtCore_
Copy link
Owner Author

Choose a reason for hiding this comment

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

What's the difference b/t _QtCore and QtCore_?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think there would be any difference just looks like the variable name the author chose.

@@ -8,41 +8,3 @@
lib = os.path.join(BASEDIR, '_lib', 'magic')
Copy link
Owner Author

Choose a reason for hiding this comment

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

All of this should probably be deleted.

@zbarge
Copy link
Collaborator

zbarge commented Dec 17, 2016

I just fetched the latest and im testing it now and failing 9/154.

I think we should change the signals to regular python types, right now there are strings like the following:

Line 501 qtpandas/qtpandas/views/CSVDialogs.py
exported = Signal('QBool')

I want to change 'QBool' to bool on all the signals. Do you know any reason why I shouldn't do that?

Error in test:

E ________________________________________________________________________________
E File "C:\Users\Zeke\Google Drive\dev\python\qtpandas\qtpandas\views\CSVDialogs.py", line 657, in rejected
E self.exported.emit(False)
E
E TypeError: Value types used on meta functions (including signals) need to be registered on meta type: QBool

@draperjames
Copy link
Owner Author

The only reason I can think is that Qbool might be some kind of C++ implementation of a bool. IDK go ahead and try it. I'll poke around and see what I can find about Qbool.

James Draper added 2 commits December 17, 2016 19:10
I realized that I changed 'QBool' to 'bool' when it probably should have
been just bool.
@@ -120,7 +120,7 @@ def _initUI(self):
layout.addWidget(self.otherSeparatorLineEdit)
self.setLayout(layout)

@Slot('QBool')
@Slot('bool')
Copy link
Collaborator

@zbarge zbarge Dec 18, 2016

Choose a reason for hiding this comment

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

I meant bool as in the python type rather than a string that says 'bool' - sorry lol.. @draperjames

@draperjames
Copy link
Owner Author

Yeah it has worked pretty well for me. I also went back to the original pandas-qt repo and installed it in a python27 env, ran pytest on tests, it hit error pretty early on in in the cycle and exited pytest. So now I'm thinking that I either cocked-up the install or we have actually made some real improvements!

@draperjames draperjames mentioned this pull request Dec 19, 2016
5 tasks
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.

2 participants