Skip to content

Commit

Permalink
Merge pull request #9 from transferwise/pip_streamlit
Browse files Browse the repository at this point in the history
add run_tw_experimentation_streamlit to the pyproject.toml to run streamlit after "pip install"
  • Loading branch information
AlxdrPolyakov authored Jan 12, 2024
2 parents 90a2b4c + d22ee64 commit 2976d89
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tw-experimentation"
version = "0.1.2"
version = "0.1.2.1"
description = "Wise AB platform"
authors = ["Wise"]
readme = "README.md"
Expand All @@ -10,6 +10,10 @@ readme = "README.md"
requires = ["setuptools", "wheel"]


[tool.poetry.scripts]
run_tw_experimentation_streamlit = "tw_experimentation.streamlit.run_streamlit_app_entry_point:main"


[tool.pytest.ini_options]
addopts = "--strict-markers -vv"
markers = [
Expand Down Expand Up @@ -78,4 +82,4 @@ exclude = '''

[tool.isort]
profile = "black"
line_length = 88
line_length = 88
15 changes: 15 additions & 0 deletions tw_experimentation/streamlit/run_streamlit_app_entry_point.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
import runpy
import sys

import tw_experimentation.streamlit


def main() -> None:
streamlit_script_path = os.path.join(os.path.dirname(tw_experimentation.streamlit.__file__), "Main.py")
sys.argv = ["streamlit", "run", streamlit_script_path ]
runpy.run_module("streamlit", run_name="__main__")


if __name__ == "__main__":
main()

0 comments on commit 2976d89

Please sign in to comment.