diff --git a/Dockerfile b/Dockerfile index 5c2ff0d..052cadc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,16 +13,12 @@ WORKDIR /app RUN pip install poetry --no-cache-dir RUN poetry self add poetry-plugin-dotenv RUN poetry config virtualenvs.create false -COPY pyproject.toml poetry.lock* /app/ -RUN poetry install --only main -#--no-root COPY . /app -WORKDIR /app +RUN poetry install --only main EXPOSE 8502 RUN mkdir -p /app/data CMD ["poetry", "run", "streamlit", "run", "app_home.py"] - diff --git a/stream_app/utils.py b/stream_app/utils.py index acc9729..55d9db1 100644 --- a/stream_app/utils.py +++ b/stream_app/utils.py @@ -10,7 +10,18 @@ from open_notebook.utils import ( def version_sidebar(): with st.sidebar: - current_version = get_installed_version("open_notebook") + try: + current_version = get_installed_version( + "open-notebook" + ) # Note the hyphen instead of underscore + except Exception: + # Fallback to reading directly from pyproject.toml + import tomli + + with open("pyproject.toml", "rb") as f: + pyproject = tomli.load(f) + current_version = pyproject["tool"]["poetry"]["version"] + latest_version = get_version_from_github( "https://www.github.com/lfnovo/open-notebook", "main" ) @@ -34,3 +45,4 @@ def setup_stream_state(session_id) -> None: else: st.session_state[session_id] = existing_state st.session_state["active_session"] = session_id + st.session_state["active_session"] = session_id