-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide ability to call gaphor console externally #2821
Comments
Hi @hulsed, to summarize this feature request, you are looking for these types of scripting capabilities like described here: https://docs.gaphor.org/en/latest/scripting.html, except you want to use it from a fully packaged version of Gaphor, is that right? |
I am referencing the scripting capabilities, yes, but I'm not necessarily tied to "calling fully packaged version" as a solution. I think the key functionality would be being able to interact with gaphor command-line services without needing to build gtk. There are different ways of accomplishing that:
|
@hulsed If you install Gaphor as a dependency in your own project, you should not need GTK per se. The scripting and Jupyter examples in the docs are executed that way. You do need PyGObject, Pango (for text rendering), Cairo and Pycairo. |
Yes, I was grouping PyGObject and gtk there, since both are installed using gvsbuild on windows. It would be nice not to have to go through that process just to call a library that (I imagine?) doesn't actually need it for my use-case. |
Okay so there is a secret third way to solve my problem and that is installing dependencies via anaconda, which I have now figured out how to do. I'd recommend adding some instructions for installing dependencies with anaconda in windows: Creating a development environment for gaphor in anaconda. (1) Create new anaconda profile e.g., 'gaphor' (2) Update anaconda in the environment (3) Install packages
Note: gtksourceview5, libadwaita are not available as anaconda packages. So you may (?) not be able to build/run the program in this environment. (4) Set up your IDE(s)
(a) VSCode should work out-of-the box if it is already installed. Just set 'gaphor' as the kernel in your VSCode Profile or notebook (b) Spyder may not be able to install under this environment (conda install spyder will reveal conflicts). Instead, you can do the following
Then open spyder and set 'gaphor' as your python interpreter |
Indeed it would certainly be nice to have PyGObject as an optional dependency altogether. I was not able to achieve this when I wanted to make Gaphor (as a library) work on readthedocs without GTK. We need Pango for text rendering still, and Pango is also provided via PyGObject. We do still need Cairo, though. Not sure if you can install that on windows without building it. |
Th Conda way is interesting as well. With a tool like Pixi we should be able to provide everything needed to run Gaphor with Jupyter. |
@hulsed Would you be willing to add Anaconda Windows instructions to the docs? That would be an awesome contribution! |
BTW. Gaphor also supports running scripts from the CLI:
|
@danyeaw I could do that, but not sure about time-frame since I would want to refine/double-check the approach (and I have a few things on my plate right now). Feel free to assign this to me in the mean-time so I can keep track of it. |
- Docs page added for anaconda installation - See: gaphor#2821
- Docs page added for anaconda installation - See: gaphor#2821
- Docs page added for anaconda installation - See: gaphor#2821
- Docs page added for anaconda installation - See: gaphor#2821
Is your feature request related to a problem?
I am a researcher who would like to build some tools simulation tools connected to gaphor. One thing I would like to be able to do is call Gaphor's console from an external console (python instance, powershell, jupyter).
Currently, this is impossible without a development installation, which may be difficult or impossible to setup without administrative privileges. Preferably, it gaphor's console should be possible to call from a fully packaged version so you don't need to build gtk to interact with it. This would make it a lot easier to develop scripts which interact with gaphor's data model.
Describe the solution you'd like
Something along the lines of:
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: