Skip to content
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

Caster as a Python package #246

Closed

Conversation

BazookaMusic
Copy link
Contributor

@BazookaMusic BazookaMusic commented Jul 16, 2018

This is a preliminary pull request which will eventually include everything required to make caster a Python package. It is not ready for testing due to requiring changes to settings.py.

The setup.py file will install the lib,asynch sub packages into the installed python packages. This eliminates the annoying import error messages when debugging caster modules and will eventually lead to the splitting of caster into 2 parts:

  1. The user space, which will include user specific configuration files like settings.json and the user package which allows for the creation and application of new grammars and filters.
  2. The framework space, which will be installed as a Python package and will contain the "backend", namely the default grammars, the base caster engine modules and caster utilities like the mouse grids.

Things required:

-Modify settings.py paths to point to the correct locations
-Store user data in an appropriate location
Feedback required on:
-The proposed new file structure for caster
-Other suggestions for the setup file

@LexiconCode LexiconCode added the New Feature A new feature that is not currently implemented. label Jul 16, 2018
@LexiconCode LexiconCode added the WIP An work in progress label Jul 16, 2018
@LexiconCode
Copy link
Member

FYI Another interesting package manager Poetry

In terms of managing packaging this looks really well done from start to finish. It publishes to PyPI so the end-user can utilize PIP. Anyway it's just another option among many that might be useful.

@LexiconCode LexiconCode mentioned this pull request Jul 19, 2018
4 tasks
@BazookaMusic
Copy link
Contributor Author

BazookaMusic commented Jul 20, 2018

I would like to try the stock solution first, to avoid adding new dependencies and because there is a lot of documentation. When it's done, it shouldn't be too hard to upgrade it. Also, as far as publishing is concerned, shouldn't we consult with synkarius before doing so since we will need to provide authors names and emails etc. ?

The current changes I have made are:

  • Added the setup.py file which adds the /lib,/asynch packages to the Python site packages.

Some notes about the changes I plan to make for feedback:

  1. There will be a user directory which will be set into {user directory}/caster/user_modules for user filters and grammars, /user_config for settings,aliases etc. (this should be user configurable but from the pyinstaller setup and not at this stage)
  2. Asynch modules will be installed to Python site packages. They will be invoked as installed Python modules like Python -m module_name.
  3. Settings.py will be updated to contain the new paths and to validate the existence of the user directory. Also, they will automatically generate the required files on first launch.
  4. Due to the user modules being in a different directory than the _caster.py file, a new module will be created which will dynamically import the package using the directory path. (Maybe even the ccr grammars could be removed from /lib and act as plug-ins using the same method)
  5. Ideally tests will need to be added to validate the new directory structure and other things(will probably be in another pull request as a complete feature)

@LexiconCode
Copy link
Member

I would like to try the stock solution first, to avoid adding new dependencies and because there is a lot of documentation. When it's done, it shouldn't be too hard to upgrade it. Also, as far as publishing is concerned, shouldn't we consult with synkarius before doing so since we will need to provide authors names and emails etc. ?

That's good what about publishing the package. I think you're right we would definitely need to contact synkarius. It would be great to have him involved even if briefly to clarify a few aspects of Caster. I deftly think you're right the let's get it packaged by current standards. We can reevaluate that later if needed.

@LexiconCode
Copy link
Member

That looks excellent. A few thoughts.

I would include Sikuli as a dependency. (Even though we still issues integrating the latest version #215 )

How are you going to handle Natlink and win32con?

@BazookaMusic
Copy link
Contributor Author

I was thinking about using pyinstaller for them. This pull request will deal with the Core parts of caster. after its done, We will make a standard installer which will bundle Python, natlink, Windows32 and caster and install everything. Part of the installation process will be to use pip to install caster as a Python package.

@LexiconCode LexiconCode added the Installation Issues and questions related to installation of Castor/Dragonfly label Jul 20, 2018
@comodoro
Copy link
Contributor

Hi @gerrish , I am interested particularly in the moving out of user data, please let me know if I can help. A small suggestion would be to start the user directory subdirectory with a dot (.caster), which is customary in Unix and now Windows as well

@LexiconCode
Copy link
Member

LexiconCode commented Sep 27, 2018

@gerrish Danesprite/dragonfly Is now installable through pip as dragonfly2. Simply close Dragon NaturallySpeaking and run pip uninstall dragonfly then pip install dragonfly2 from command line to use the new distribution.

@LexiconCode
Copy link
Member

Fulfilled by b244c12

@LexiconCode LexiconCode closed this Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Installation Issues and questions related to installation of Castor/Dragonfly New Feature A new feature that is not currently implemented. WIP An work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants