You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DiffCheck is distributed as a Python Grasshopperr plug-in via yak and its source code via PyPI. The plug-in is composed by a series of `.ghuser` components.
54
+
55
+
There are 3 ways you can contribute to the Python GH plug-in:
56
+
1. By adding new components to the plug-in.
57
+
2. By fixing bugs of existing components in the plug-in.
58
+
3. By adding new functionalities to existing components in the plug-in.
59
+
60
+
Before committing to the repository you need to have tested the components in the Grasshopper environment and be sure that this is working correctly. Also, provide a sufficient documentation in the PR (for now) please.
61
+
62
+
Follow these steps to develop and test the Python GH plug-in:
63
+
-[GHPy: A) preparation](#ghpy-a-preparation)
64
+
-[GHPy: B) development/debug](#ghpy-b-developmentdebug)
> note that if you drop an official released diffCheck component from yak, this one will have the `#r : diffCheck==<version_number>` notation at the top of the script. Get rid of all these release components before to start and be sur to erase again the previous folders (they recreated each time `#r : diffCheck` is called).
79
+
80
+
Lastly, install the pip pacakge from the repository in editable mode. This way, all the modifications made to the source code of the repository will be reflected in the installed package. Open a terminal and run the following command (replace the path with where you download the repository):
That's it you are now a contributor to the diffCheck! We raccomand to not download anymore from yak package but rather use the source code in the repository. If you want the latest diffCheck, checkout and pull the main.
86
+
87
+
## GHPy: B) development/debug
88
+
89
+
### Code structure
90
+
For DiffCheck there are 2 main folders in the repository:
91
+
*`src/gh/diffCheck/components` here you can add new components or modify existing ones (for more info on how to create one we point you to [this documentation](https://github.com/compas-dev/compas-actions.ghpython_components)). Here we call the
92
+
*`src/gh/diffCheck/diffCheck` this is our package where the core functionalities are implemented.
93
+
94
+
### IDE
95
+
We reccomand to use `VSCode` as IDE for developing the components. This is because it has a good integration with the `Grasshopper` environment and it is easy to debug the components. To set up the IDE follow these steps:
96
+
1. Install the `ScriptSync` extension for `VSCode`.
97
+
2. Install the `ScriptSync` from the yak manager in Rhino.
98
+
3. Open the `code.py` from the `src/gh/diffCheck/components` folder you are working on in `VSCode`, and set its path to the ScriptSync ghcomponent.
99
+
4. If you modify the code in `VSCode`, the changes will be reflected in the Grasshopper component as soon as you save in `VSCode` again the `code.py`.
100
+
101
+
102
+
## GHPy: C) Release
103
+
The release will be made via CI from main. As a contributor you don't need to worry about this. The plug-in is componentized, pushed to yak/PyPI and the user can download the latest version from yak.
0 commit comments