koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
3.95k stars 238 forks source link

server: add Python REPL support + introduce optional requirements.txt #1360

Closed bjia56 closed 4 months ago

bjia56 commented 4 months ago

Introduces ptpython as a remote REPL for Python plugins. Works with existing REPL plumbing.

Dependency tree of ptpython:

$ johnnydep --verbose=0 ptpython
name                               summary
---------------------------------  -------------------------------------------------------------------------------------------------
ptpython                           Python REPL build on top of prompt_toolkit
├── appdirs                        A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".
├── jedi>=0.16.0                   An autocompletion tool for Python that can be used for text editors.
│   └── parso<0.9.0,>=0.8.3        A Python Parser
├── prompt-toolkit<3.1.0,>=3.0.34  Library for building powerful interactive command lines in Python
│   └── wcwidth                    Measures the displayed width of unicode strings in a terminal
└── pygments                       Pygments is a syntax highlighting package written in Python.
koush commented 4 months ago

does python have optional dependencies? was thinking that maybe the pip install can be a separate requirements file that we can ignore the failure. so 2 pip installs.

bjia56 commented 4 months ago

There might be, I'd have to check. Though, I'm a bit hesitant to recommend splitting out into two requirements files since having one allows pip to resolve dependency constraints. If there are two, then I believe the second file will take precedence.