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

Modularize dependencies #238

Open
cjbassi opened this issue Apr 16, 2020 · 6 comments
Open

Modularize dependencies #238

cjbassi opened this issue Apr 16, 2020 · 6 comments

Comments

@cjbassi
Copy link

cjbassi commented Apr 16, 2020

I'm writing a program that only needs the grammar and kaldi backend and it would be nice if I only had to pull in dependencies for those two features. Kaldi is already hidden behind a feature flag which is nice, but I still don't need rpc features, pyperclip, and pynput. I think it would be nice if the sub packages were modularized behind feature flags. Thanks!

@cjbassi
Copy link
Author

cjbassi commented Apr 16, 2020

Unfortunately it is not possible to specify default features in python: pypa/setuptools#1139

So if the dependencies are modularized, it would be a breaking change and dependent projects would have to specify all of the features that they need.

@drmfinlay
Copy link
Member

Yes, I'm sorry about this. I should have made the RPC dependencies, pyperclip, pynput and others optional from the start.

One way I could see around this problem is to have a separate dragonfly2 project on PyPI.org with a different name so you can still import dragonfly, e.g. dragonfly2-minimal. To avoid ImportErrors relating to missing dependencies, you should be able to remove lines from dragonfly/__init__.py to import only the parts of Dragonfly that you need.

@LexiconCode
Copy link
Member

I would be in support of this as well. Ultimately would help diversify Dragonfly use case to different applications.

It would be nice not to have to split releases but it looks like we are a constrained with packaging technical limitations.

@cjbassi
Copy link
Author

cjbassi commented Apr 18, 2020

I'm glad that this is something that's open to being fixed. Another idea might be to split dragonfly into a bunch of sub packages and publish those separately, like dragonfly_grammar, dragonfly_kaldi, etc. Just an idea.

@drmfinlay
Copy link
Member

Sorry for the late response!

It's certainly possible to split Dragonfly into a bunch of sub-packages to be published separately. Some of us are considering splitting Dragonfly's actions and related OS control code into a separate dictation-toolbox repository with similar code from Unimacro.

@drmfinlay
Copy link
Member

I believe modularisation of dependencies should be done for Dragonfly version 1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants