moinwiki / moin

MoinMoin Wiki Development (2.0+), unstable, for production please use 1.9.x.
https://moinmo.in/
Other
307 stars 92 forks source link

PyCharm does not break on breakpoints when there is a wikiconfig_editme #750

Closed RogerHaase closed 6 years ago

RogerHaase commented 6 years ago

Set up PyCharm to do debugging using breakpoints on a fresh moin clone.

Add wikiconfig_local.py and wikiconfig_editme.py files to do more debugging. PyCharm no longer breaks on breakpoints.

Seems related to restructuring of code after move to git.

ThomasWaldmann commented 6 years ago

The problem might be how moin is installed into the virtualenv:

RogerHaase commented 6 years ago

tried pip install -e . on a repo after python quickinstall.py and m extras. The problem persists. Per the output the only action was to uninstall and reinstall the same version of moin.

    C:\GIT\moin>activate

    (moin-venv-python) C:\GIT\moin>pip install -e .
    Obtaining file:///C:/GIT/moin
    Requirement already satisfied: blinker>=1.1 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf54
    aaf) (1.4)
    Requirement already satisfied: docutils>=0.8.1 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2c
    f54aaf) (0.14)
    Requirement already satisfied: Markdown>=3.0.0 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2c
    f54aaf) (3.0.1)
    Requirement already satisfied: Flask>=0.10 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf54a
    af) (1.0.2)
    Requirement already satisfied: Flask-Babel>=0.11.1 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243
    +g2cf54aaf) (0.12.2)
    Requirement already satisfied: Flask-Caching>=1.2.0 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev24
    3+g2cf54aaf) (1.4.0)
    Requirement already satisfied: Flask-Script>=2.0.5 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243
    +g2cf54aaf) (2.0.6)
    Requirement already satisfied: Flask-Theme>=0.2.0 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+
    g2cf54aaf) (0.2.0)
    Requirement already satisfied: emeraldtree>=0.10.0 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243
    +g2cf54aaf) (0.10.0)
    Requirement already satisfied: flatland>=0.8 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf5
    4aaf) (0.8.1)
    Requirement already satisfied: Jinja2>=2.7 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf54a
    af) (2.10)
    Requirement already satisfied: pygments>=1.4 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf5
    4aaf) (2.2.0)
    Requirement already satisfied: Werkzeug>=0.11.2 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2
    cf54aaf) (0.14.1)
    Requirement already satisfied: whoosh>=2.7.0 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf5
    4aaf) (2.7.4)
    Requirement already satisfied: pdfminer in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf54aaf)
     (20140328)
    Requirement already satisfied: passlib>=1.6.0 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf
    54aaf) (1.7.1)
    Requirement already satisfied: XStatic>=0.0.2 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2cf
    54aaf) (1.0.2)
    Requirement already satisfied: XStatic-Bootstrap==3.1.1.2 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0
    .dev243+g2cf54aaf) (3.1.1.2)
    Requirement already satisfied: XStatic-Font-Awesome>=4.1.0.0 in c:\git\moin-venv-python\lib\site-packages (from moin==2.
    0.0.dev243+g2cf54aaf) (4.7.0.0)
    Requirement already satisfied: XStatic-CKEditor>=3.6.1.2 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.
    dev243+g2cf54aaf) (3.6.4.0)
    Requirement already satisfied: XStatic-autosize in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev243+g2
    cf54aaf) (1.17.2.1)
    Requirement already satisfied: XStatic-jQuery>=1.8.2 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.dev2
    43+g2cf54aaf) (3.3.1.1)
    Requirement already satisfied: XStatic-jQuery-File-Upload==4.4.2 in c:\git\moin-venv-python\lib\site-packages (from moin
    ==2.0.0.dev243+g2cf54aaf) (4.4.2)
    Requirement already satisfied: XStatic-TWikiDraw-moin>=2004.10.23.2 in c:\git\moin-venv-python\lib\site-packages (from m
    oin==2.0.0.dev243+g2cf54aaf) (2004.10.23.2)
    Requirement already satisfied: XStatic-AnyWikiDraw>=0.14.2 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.
    0.dev243+g2cf54aaf) (0.14.2)
    Requirement already satisfied: XStatic-svg-edit-moin>=2012.11.15.1 in c:\git\moin-venv-python\lib\site-packages (from mo
    in==2.0.0.dev243+g2cf54aaf) (2012.11.27.1)
    Requirement already satisfied: XStatic-JQuery.TableSorter>=2.14.5.1 in c:\git\moin-venv-python\lib\site-packages (from m
    oin==2.0.0.dev243+g2cf54aaf) (2.14.5.1)
    Requirement already satisfied: XStatic-Pygments>=1.6.0.1 in c:\git\moin-venv-python\lib\site-packages (from moin==2.0.0.
    dev243+g2cf54aaf) (2.2.0.1)
    Requirement already satisfied: itsdangerous>=0.24 in c:\git\moin-venv-python\lib\site-packages (from Flask>=0.10->moin==
    2.0.0.dev243+g2cf54aaf) (1.1.0)
    Requirement already satisfied: click>=5.1 in c:\git\moin-venv-python\lib\site-packages (from Flask>=0.10->moin==2.0.0.de
    v243+g2cf54aaf) (7.0)
    Requirement already satisfied: Babel>=2.3 in c:\git\moin-venv-python\lib\site-packages (from Flask-Babel>=0.11.1->moin==
    2.0.0.dev243+g2cf54aaf) (2.6.0)
    Requirement already satisfied: six>=1.3.0 in c:\git\moin-venv-python\lib\site-packages (from emeraldtree>=0.10.0->moin==
    2.0.0.dev243+g2cf54aaf) (1.11.0)
    Requirement already satisfied: MarkupSafe>=0.23 in c:\git\moin-venv-python\lib\site-packages (from Jinja2>=2.7->moin==2.
    0.0.dev243+g2cf54aaf) (1.0)
    Requirement already satisfied: pytz>=0a in c:\git\moin-venv-python\lib\site-packages (from Babel>=2.3->Flask-Babel>=0.11
    .1->moin==2.0.0.dev243+g2cf54aaf) (2018.7)
    Installing collected packages: moin
      Found existing installation: moin 2.0.0.dev242+g31642aac.d20181105
        Uninstalling moin-2.0.0.dev242+g31642aac.d20181105:
          Successfully uninstalled moin-2.0.0.dev242+g31642aac.d20181105
      Running setup.py develop for moin
    Successfully installed moin
    You are using pip version 10.0.1, however version 18.1 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.

    (moin-venv-python) C:\GIT\moin>
ThomasWaldmann commented 6 years ago

trying to reproduce this now...

ThomasWaldmann commented 6 years ago

screenshot from 2018-11-05 22-14-50

This is my configuration, breakpoints work with wikiconfig_local.py and wikiconfig_editme.py (both without anything changed, as seen in wikiconfig.py).

To start debugging, I set a breakpoint to moin.apps.frontend.views.show_item (do not put the breakpoint on the def show_item line, but one line below on the first indented code block line), then choose "Run 'debug moin server'" from pycharm menu. Each time you visit a wiki page with the browser, the breakpoint triggers.

ThomasWaldmann commented 6 years ago

Maybe it also works with different additional options, just thought I switch off everything that complicates the stack or debugging.

ThomasWaldmann commented 6 years ago

screenshot from 2018-11-05 23-47-12

See PR #757. This should work with Pycharm Free Edition.

RogerHaase commented 6 years ago

PR #757 works for me. 🥇

The --no-reload option does not seem to make a difference, but I left it in.

Default port is 5000 rather than 8080, but having pycharm and the built in server on different ports will be better.

ThomasWaldmann commented 6 years ago

fixed by #757.