Streamlit does not rerun on script change

I’m just getting started using streamlit. I’m testing a very simple script:

import streamlit as st

'''
# Import Required libs
'''
with st.echo():
    from hyperscope import config
    import polars as pl
    import numpy as np
    from matplotlib import pyplot as plt
    from metavision_core.event_io import EventsIterator
    from metavision_sdk_core import PolarityFilterAlgorithm
    from rsklearn import clustering
    from sort import Sort
    from tqdm import tqdm
    import joblib
    import h5py
    import os
    from pathlib import Path

'''
   Setup variables
'''

'The input raw file to process'
input_file = config.RAW_DATA_DIR / 'metavision' / 'combo_nomod.raw'
'The length of each time window. Determines the accumulation period.'
dt = 10
'When in the recording to begin processing'
start_ts = int(9e6)
'The maximum distance to consider 2 points part of the same cluster'
eps = 10
'The minimum number of points to form a cluster'
min_samples = 3
'The max duration to process the recording'
max_duration = None
'The maximum age of a track represented as n time windows'
sort_max_age = 1000
'Number of hits required to form a track'
sort_min_hits = 3
'Minimum intersection over union required'
sort_iou_thresh = 0.1

But whenever I change the text, for instance removing the # in the import header, and save the file, I can’t get the app to update. This is true even if I manually refresh the page. The only way is to restart the server with streamlit run.

Setting the watch setting to poll seems to resolve the problem, but I have watchdog installed so it shouldn’t be required.