Skip to content

On a Mac, check if xcode installed before requiring watchdog #66

@tvst

Description

@tvst

Streamlit watches files in the current folder for changes by using one of two methods:

  1. The watchdog Python module, which uses OS-level event-based APIs
  2. A custom module that polls the files we care about every so often.

If the watchdog module is available on the user's system, we currently use Method 1. If not, we use Method 2.

The problem is that the watchdog module it compiled locally by Pip when the user pip-installs it -- and on a Mac this compilation step requires the free XCode CLI tools with:

xcode-select --install

So what we'd like to do is:

  1. Modify setup.py so we check whether xcode tools are available before making watchdog a dependency (only if the current system is a Mac, of course).
  2. In LocalSourcesWatcher.py, when we fall back to the polling solution, print a message telling the user to install the watchdog module (see below).
  3. Add config option to turn that message off: global.disableWatchdogWarning

Message:

  For better performance, install the Watchdog module:

  $ xcode-select --install [only show this message if on a Mac]
  $ pip install watchdog

(leave a blank line at the end, so the message does not merge with whatever we print after it.)

Metadata

Metadata

Assignees

Labels

type:enhancementRequests for feature enhancements or new features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions