labs4capella / python4capella

Python for Capella
Eclipse Public License 2.0
52 stars 10 forks source link

Project setup #121

Open materpillar opened 2 years ago

materpillar commented 2 years ago

Hi, I am confused by the project setup. The New Project wizard does not give the option to name the Python4Capella project, so always the default name will be used. I can only create one project like this or first have to rename the existing one. But then I also have to rename all the references in the scripts to the new project name. This seems unnecessary if implemented differently.

Also the reference to the sample_scripts folder in the Script Locations preferences that is described stays unclear to me. Eventually in production I don't want to use a "sample script" folder, but my actual real folder that is under source control. So it is unclear what a proper project setup would be here. Does the Script Locations preferences always have to point to the actual folder containing my scripts, that I want to execute? Do I only put this "sample scripts" / "my own scripts" folder under source control then? What if I want to use different repositories or Python4Capella projects? For each project I get the overhead of the "java_api, resources, simplifed_api, utilties" folders, which are additionally subject to change in newer versions I assume, so I guess they should not be part of the project.

materpillar commented 2 years ago

It seems that we can also use a new "PyDev" project, with a src folder as described in the PyDev manual in which the sample scripts are located (here and here) . That way, the Pyhon4Capella project stays untouched, and the new PyDev project can be put under source control.

ylussaud commented 2 years ago

The idea is to import the Python4Capella project once and then reference it in your own project where you will put your own scripts. You can check the Eclipse help contents (menu: Help/Help Contents then the Python for Capella in the tree on the right) or this page for more details.

materpillar commented 2 years ago

I would suggest to clarify this in the README and even provide the sample scripts in a separate Git repository within the labs4capella Github project (call it python4capella-samplescripts) that force the user to direclty use the "correct" production setup. Providing the sample scripts within the Python4Capella eclipse project leads the user on a wrong track on how to setup the project.

ylussaud commented 2 years ago

We did this to have a simple setup to get started. This prevent some configuration errors I think. But at the same time I totally agree with you.

The first step could be to put more light on the plugin documentation in the readme and add a link to the writing script documentation.

If we change the project setup we need to make sure that it is easy to use and no errors can be done while installing it.