Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4355437
By: vormav

Hey guys. Just a small issue I wanted to ask about: Is there any method for
allowing PyDev to add a Python 'package' to a project's root?

The reason I'm asking is because I'm trying to manage my PyDev projects as if
the workspace itself was a Python package. I organize my projects like this:

VENDOR:
        Project1:
                SubProject1
                SubProject2
        Project2

In this case, VENDOR would be my workspace in Eclipse, and Project1 and Project2
would be PyDev projects within the workspace. Then, the SubProjects are packages
within the projects.
This format is very convenient because it allows me to have individual project
settings for each major project branch, while still having everything wrapped
in a single package. This is particularly important for setting my PYTHONPATH:
My scripts are executed in a Python interpreter outside of Eclipse, and so I
can't rely on PyDev's automatic addition of Project 'src' folders to PYTHONPATH.
When everything exists within a single package though, that doesn't matter.
I only have to add the folder containing VENDOR to my PYTHONPATH, and everything
is available to me. If I want subproject1, it's available with "import
VENDOR.Project1.SubProject1"

If, on the other hand, I were to place all "SubProject" packages inside a nested
'src' folder, as PyDev wants me to do, my import statement would instead be
"import VENDOR.Project1.src.SubProject1", which is kind of silly and annoying.

I could of course create one global PyDev project, and have 
'Project1','Project2',
etc. all exist as packages within that project. But when I do this, I'm not
able to give each major project its own pydev settings (and having that ability
can be very useful). Every major project would inherit the same PyDev settings.

Obviously, I can just create each subfolder for packages and all of the module
__init__.py files manually. That's fine. That's exactly what I'm doing right
now. It would just be *nice* to be able to use PyDev's builtin mechanism for
adding packages and modules. But the only way that's going to work is if PyDev
lets me create packages at the root of a project (IE, Project/Package), and
I don't really understand why it won't allow this.
Any thoughts?


On a similar note, I'm curious to know how I would go about changing the 
defaults
of the PyDev project creator, so that the "create a 'src' folder" option is
disabled by default. Ideally, it'd be nice to be able to disable that feature
entirely, because I may be working in a team environment, in which I need to
enforce the file structure described above -- and never, EVER nest sources in
a 'src' folder. I'm sure that that much would probably require me to manually
edit the java source, and I don't even want to think about what kind of problems
that could create when it comes time to update pydev. So if there's just a 
simple,
stable way of changing the default value of that option, that'd be great. :)

Thanks!

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Pydev-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pydev-users

Reply via email to