using PyCharm

342 views
Skip to first unread message

Alex

unread,
Jun 8, 2015, 6:48:48 PM6/8/15
to web...@googlegroups.com
Is anyone here using PyCharm for web2py projects? Since last year PyCharm has added web2py support for the Professional edition. It's really great and saves me a lot of time. Especially debugging applications is super easy.

But there is still a huge problem how it handles projects. I have many web2py projects in different svn repositories and only one local web2py server with symbolic links to my applications. This doesn't seem to be currently possible with PyCharm. I don't understand how people can use the PyCharm web2py integration with this issue. Either no one is using it or only with one project and no VCS repository...

In case you're using PyCharm I'd appreciate it if you could vote (or comment) on this issue:
https://youtrack.jetbrains.com/issue/PY-15309
at the moment it seems like they're not taking it seriously since there are only 2 people (incl. me) complaining. My first reported blocking issue took half a year until it got fixed, that's quite frustrating. I'm sure they'd address those issues sooner if there were more people giving feedback.

thanks,
Alex

Richard Vézina

unread,
Jun 9, 2015, 10:21:08 AM6/9/15
to web2py-users
Since they support web2py, they didn't progress much... I mean they release at least 2 PyCharm version where the focus were clearly over improving support for Django project support. But but no improve over web2py support. My guess is that their users base are Django users so they prioritize those client over the others since they funding come from them...

I own a professionnal PyCharm licence since 2 years and I am pretty satisfy in general, but I would appreciate web2py support improvement...

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim Richardson

unread,
Jun 13, 2015, 8:36:42 AM6/13/15
to web...@googlegroups.com
I don't know svn. I use git. Each app (the important ones anyway) is its own git respository. Pycharm has no problem with this.  If I do a commit in pycharm at the level of an application, it commits to the git repository it finds in that directory, exactly what I want. I can do git pulls etc on the root directory (web2py) without affecting the applications in their sub-directories. This sounds like the behaviour you are looking for, and I certainly find it perfectly ok. I think  pydev (based on eclipse) works exactly the same way, so I guess the community version of PyCharm does this too  ...it seems to be me to have nothing to do with web2py, but the detection of multiple git repositories nested in a pycharm project. Perhaps svn support is not good enough?

Alex

unread,
Jun 13, 2015, 9:16:15 AM6/13/15
to web...@googlegroups.com

I don't think using svn or git makes a difference. I assume you checkout your git repository directly in the web2py applications folder?


My repositories contain other folders beside the web2y application, like doc, test... therefor I checkout the whole repository at a separate location and only make a symbolic link to the web2py applications folder. Otherwise I'd have to checkout only the web2py application from the repository again in the web2py application folder. This will get messy.


Further, how do you handle multiple applications? I've about 10 web2py applications, each one in an own repository. The PyCharm web2py detection only works if the web2py directory (or the applications dir) is selected for the project. Therefor I have to create an own web2py instance for each project or otherwise everything is mixed up in one large project.

Tim Richardson

unread,
Jun 13, 2015, 6:25:22 PM6/13/15
to web...@googlegroups.com
My 'project' is the web2py root. Applications are therefore all in the application directory.
I don't understand what is not working for you, sorry.

Tim Richardson

unread,
Jun 13, 2015, 6:36:50 PM6/13/15
to web...@googlegroups.com
I read your last post again more carefully. My application repositories are the application directories in the standard web2py directory layout. It never ocurred to do it any other way since this is the most natural way and is what I thought the book hints at in its discussion of IDEs. It works really well for me. I don't encounter pycharm problems, it does what it says as far as I'm concerned. I'm not a very sophisticated pycharm user but refactoring,find usage and go to function declarations work (I don't get pollution from other apps). I use 'find in path' a fair bit which means navigating to the correct starting point. The imtegrated git functions understand where I am although I have to follow pycharm s prompts to add a new hot root. I do commits in pycharm but most other git stuff in a shell. My production layout is identical so that the apps are git repositories (clones) under web2py. I don't have production as a pycharm project.

Nico de Groot

unread,
Jun 15, 2015, 2:01:14 AM6/15/15
to web...@googlegroups.com
I'm using a similar setup. Within the applications folder I have repos using git and also symbolic links to repos at other locations.
No problems. Works fine. I'm using MacOs.
Nico de Groot

Alex

unread,
Jun 15, 2015, 7:12:46 AM6/15/15
to web...@googlegroups.com
So you don't have the problem with files getting out of sync inside symbolic linked folders (applications)? I have this problem on Windows and Linux, e.g. everytime the language file gets modified by the application I have to manually synchronize the folder in PyCharm.

and what about the project structure? So you only have one PyCharm project for all your applications. How do you handle "Find in Path" and similar features? I assume you always set a Scope?

Tim Richardson

unread,
Jun 15, 2015, 7:53:29 AM6/15/15
to web...@googlegroups.com
Hi Alex, 
Symbolic links on Windows seem broken out of the box even on current versions and nothing would surprise me on Windows except when symbolic links work. On my mac I use symbolically linked folders with no problems at all, but this is not a production environment. For example, my web2py-book repository is not under a web2py root, but I have it symbolically linked. It has always worked well in pycharm; I have never had any issues. 

I don't even know what a Scope is in Pycharm (told you I was an unsophisticated user) so if I am using scopes, then only whatever I get by default.
Find in Path: I just right click on the desired starting point in the project structure window to descend from there. I find PyCharm a pleasant, easy experience for web2py. 

Alex

unread,
Jul 13, 2015, 9:37:23 AM7/13/15
to web...@googlegroups.com
I'm still confused why nobody else is bothered by this limitation. Every other IDE and project I worked on so far, the IDE project contains all the files and source code of one application. Then you can set completely independently where the application server is located (e.g. glassfish for a java application). It seems like most of you only have one or very few web2py projects so it doesn't bother you that the IDE project has to be the web2py server directory. For me it's a big issue because I either have many applications mixed into one IDE project or I have to create multiple web2py instances so I can have separate projects. And the update problem of changed files in the symbolic link dir also don't help - that's also the case on Linux and not just Windows, but I'll test that again.

anyway, thanks for your thoughts and feedback. I wish the PyCharm team would take web2py more seriously.

Richard Vézina

unread,
Jul 13, 2015, 10:25:06 AM7/13/15
to web2py-users
Alex, I am not sure I follow you...

When you let PyCharm set web2py environnement for project for you and it create an .idea folder for your project in the root folder containing the web2py folder... Something like that :

project_root/.idea
                   /web2py
                   /web2py/application/your_project_app

What your problem with that...

Notice you should do this too :

Install web2py by yourself

web2py/applications/your_project_1
                                 /your_project_1/.idea
                                 /your_project_2
                                 /your_project_2/.idea
                                 /etc.

For this configuration, you need to create your project withou using the PyCharm helper for project configuration...

I know in the pass there where some issue with this way of using PyCharm, but I opened a ticket and this should be solve now...

If you have any issue with these setup...

Open a ticket on the PyCharm ticket manager and I am sure they will taking care of it...

But be clear on your exact problem

Richard



On Mon, Jul 13, 2015 at 9:37 AM, Alex <mrau...@gmail.com> wrote:
I'm still confused why nobody else is bothered by this limitation. Every other IDE and project I worked on so far, the IDE project contains all the files and source code of one application. Then you can set completely independently where the application server is located (e.g. glassfish for a java application). It seems like most of you only have one or very few web2py projects so it doesn't bother you that the IDE project has to be the web2py server directory. For me it's a big issue because I either have many applications mixed into one IDE project or I have to create multiple web2py instances so I can have separate projects. And the update problem of changed files in the symbolic link dir also don't help - that's also the case on Linux and not just Windows, but I'll test that again.

anyway, thanks for your thoughts and feedback. I wish the PyCharm team would take web2py more seriously.

--

Massimo Di Pierro

unread,
Jul 14, 2015, 9:22:11 AM7/14/15
to web...@googlegroups.com, mrau...@gmail.com
Actually the web2py applications/ folder is not required to be under the the web2py folder. It can be moved and you can use https://github.com/web2py/web2py/blob/master/examples/options_std.py to specify the working "folder", i.e. the location where the applications folder is located. Nobody changes it because there is no reason, see Richard response above.

Alex

unread,
Jul 14, 2015, 2:24:41 PM7/14/15
to web...@googlegroups.com
Richard, the first setup where PyCharm creates the web2py environment is not an option because I have many projects and I don't want that many servers. I already have my web2py server and symbolic links for all my projects in the application folder.

I now tried to directly open the project dir in the application folder as you mentioned (web2py/applications/project1/.idea) and at first it seemed to work fine. The web2py configuration was created, I could start the server and even debug. Only until I reactivated the python inspection "unresolved references". All web2py objects such as request, URL, etc. are marked as unresolved reference. Therefor all files are full of "unresolved reference" errors. If this issue could be solved then I would probably be happy with this setup. I also tried "Invalidate Caches / Restart ..." but still the same result.
Alex

Richard Vézina

unread,
Jul 14, 2015, 2:34:35 PM7/14/15
to web2py-users
Alex, the behavior you describe was the reason why I opened a ticket... It sounds like the issue is still there... Which version of PyCharm do you use?

Let search a bit I found the ticket and see if it had been closed... If so, you should reopen it...

Richard

Richard Vézina

unread,
Jul 14, 2015, 2:51:27 PM7/14/15
to web2py-users
Here the ticket : https://youtrack.jetbrains.com/issue/PY-10810

It seems to be in Reopened state...

Add your comment, it will make it resolve faster I guess...

If I remember I use the first setup describe above to get rid of the unresolved reference...

The only drawback I can see, is that PyCharm will get slower and slower as long as you had more apps since it analyse all the code base under web2py/ folder to my comprehension...

It means also that you have to recreate a new project each time you change web2py version...

For me it was acceptable workaround the time this ticket get resolved... But I would really appreciate that we can define or project file in the app folder and having the unresolved referece resolved...

Richard

Richard Vézina

unread,
Jul 14, 2015, 2:55:11 PM7/14/15
to web2py-users
Could the option of Massimo of moving the applications folder out of the web2py/ folder an option? Does it gonna work better with PyCharm? We should conduct some test and report to PyCharm team... But I fear it gonna be the same issue, since the .idea folder should go in the applications/app/.idea which get us back to the actual issue...

Richard

Alex

unread,
Jul 14, 2015, 3:59:15 PM7/14/15
to web...@googlegroups.com
I added a comment to this issue. I hope they'll address this soon. But actually I doubt it, last time I reported an even more serious web2py issue it took them over 6 months until they fixed it...
I also don't think moving the applications folder out of web2py will work, it will probably lead to the same issue.

Alex

Massimo Di Pierro

unread,
Jul 14, 2015, 6:16:08 PM7/14/15
to web...@googlegroups.com, mrau...@gmail.com
Which  issue took 6 months?

Alex

unread,
Jul 14, 2015, 6:34:28 PM7/14/15
to web...@googlegroups.com, mrau...@gmail.com

Massimo Di Pierro

unread,
Jul 15, 2015, 4:31:18 AM7/15/15
to web...@googlegroups.com, mrau...@gmail.com
Oh! I thought you were talking a web2py issue. Our turnaround is much faster that that. That is a PyCharm issue. Next time if file an issue with them about web2py, you may want to also open a web2py issue so we can be proactive and help them resolve it.

Alex

unread,
Jul 15, 2015, 10:13:14 PM7/15/15
to web...@googlegroups.com, mrau...@gmail.com
web2py runs fine :) I never had serious problems with it. Here is a list of some PyCharm web2py issues:

https://youtrack.jetbrains.com/issue/PY-10810
reported by Richard - if this would be solved then I could probably live with the other issue reported by me:
https://youtrack.jetbrains.com/issue/PY-15309
and I found another issue which addresses the same problem (I think):
https://youtrack.jetbrains.com/issue/PY-16070

maybe you can help them somehow so they can fix it faster. But for me it looks like they are not even interested in fixing it.

I think it would be good if more web2py PyCharm users would add comments and votes to those issues. Maybe then they will be taken more seriously.

Alex

Richard Vézina

unread,
Jul 16, 2015, 10:59:12 AM7/16/15
to web2py-users
I don't think they are not interested in fixing it... I really think they would like to fix it, but they may have limited resources to do it and many issues to solve... Mean that, they have to prioritise and of course if you have only few users affected by an issue make it easy to postponed this given issue instead of the others which affect much more persons... Also there maybe worse issue then other and this one as already a workaround, so...

Though, I think time has come to get this one fixed...

If any one can provide them insight about how to import gluon properly it surely will be appreciate by them...

Richard

--
Reply all
Reply to author
Forward
0 new messages