fix version check
This commit is contained in:
parent
df3efdecd8
commit
3ed82e2d80
2 changed files with 14 additions and 6 deletions
|
|
@ -13,16 +13,12 @@ WORKDIR /app
|
||||||
RUN pip install poetry --no-cache-dir
|
RUN pip install poetry --no-cache-dir
|
||||||
RUN poetry self add poetry-plugin-dotenv
|
RUN poetry self add poetry-plugin-dotenv
|
||||||
RUN poetry config virtualenvs.create false
|
RUN poetry config virtualenvs.create false
|
||||||
COPY pyproject.toml poetry.lock* /app/
|
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
RUN poetry install --only main
|
RUN poetry install --only main
|
||||||
#--no-root
|
|
||||||
COPY . /app
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
EXPOSE 8502
|
EXPOSE 8502
|
||||||
|
|
||||||
RUN mkdir -p /app/data
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
CMD ["poetry", "run", "streamlit", "run", "app_home.py"]
|
CMD ["poetry", "run", "streamlit", "run", "app_home.py"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,18 @@ from open_notebook.utils import (
|
||||||
|
|
||||||
def version_sidebar():
|
def version_sidebar():
|
||||||
with st.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(
|
latest_version = get_version_from_github(
|
||||||
"https://www.github.com/lfnovo/open-notebook", "main"
|
"https://www.github.com/lfnovo/open-notebook", "main"
|
||||||
)
|
)
|
||||||
|
|
@ -34,3 +45,4 @@ def setup_stream_state(session_id) -> None:
|
||||||
else:
|
else:
|
||||||
st.session_state[session_id] = existing_state
|
st.session_state[session_id] = existing_state
|
||||||
st.session_state["active_session"] = session_id
|
st.session_state["active_session"] = session_id
|
||||||
|
st.session_state["active_session"] = session_id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue