TheAntFarm icon indicating copy to clipboard operation
TheAntFarm copied to clipboard

Feature/makefile

Open bvarner opened this issue 2 years ago • 2 comments

I saw a few commits due to missing / outdated resources, and I'm not sure how to handle this with Python. I think it depends on how you want to distribute the python module or if you want to distribute it as a module.

I found that locally (developing on linux) it helped to add a makefile.

While I wanted to .gitignore the generated resources (build artifacts) like I would in any other language, I realize that with python publishing a module you need to have those. Maybe there should be a different repository for publishing?

Either way, I figured I'd submit a PR and see where the conversation goes. :-)

bvarner avatar Feb 03 '22 20:02 bvarner

Hi, I think the makefile is a really good idea, and maybe it could be used to implement a bit of CI with the github actions.

About the artifacts, we think that up to when there is no deliverable/released file, the artifacts should be kept in the repo, so that any user that downloads or clones the repo would be able to run the application when the minimal requirements are satisfied. Likely we could also remove the artifacts if there are makefiles/scripts for all the OS, with the assumption that every time that someone pulls a new version of UI/resources, the artifacts should be regenerated.

Or we were thinking about another alternative: every time the application starts, there could be a check about the presence of artifacts, and in case they miss, another py could launch some shell scripts to regenerate them.

We were also thinking about how to release a complete and consistent package both on Windows and on Unix-based operating systems. Do you have any idea about the best options?

TheAntTeam avatar Feb 05 '22 18:02 TheAntTeam

In an effort to answer this question, and better understand the application and how pyside works, I went down an investigation path / spike effort to load UI elements with QUiLoader, as a way to avoid having to pre-process the UI file into python.

The short version of that story is: I think it can be done, and I think it would be beneficial.

The long version of that story is:

  • QUiLoader in pyside2 has known bugs / issues. It requires an upgrade to pyside6.
    • pyside6 requires a few minor changes all over the place (imports)
    • VisPy does support a pyside6 backend.
    • I was able to get the UiLoader to not complain about loading the .ui file (including VisPy canvas)
    • I did not finish getting the UI to actually render, as I was (At the time) doing the UI loading in the MainWindow constructor, which isn't the right way to handle it.
  • Using QUiLoader to create a MainWindow should force a re-evaluation of where and how 'globals' are created and referenced, since the MainWindow, and the threads / thread groups for 'singleton' objects should probably exist in the same global scope as the QApplication.

So at the point I was looking at pulling things into a QApplication and dramatically changing the logical structure of the application, I bailed out and wanted to respond here. :-)

bvarner avatar Feb 09 '22 19:02 bvarner