Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python version #81

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ concurrency:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9, '3.10', '3.11', '3.12' ]
os: [ubuntu-latest]
python-version: [ 3.9, '3.10', '3.11', '3.12', '3.13' ]
node-version: [ 18, 20 ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- uses: actions/setup-node@v4
with:
node-version: ${{matrix.node-version}}
Expand All @@ -29,6 +26,10 @@ jobs:
cd streamlit_pdf_viewer/frontend/
npm install
npm run build
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cleanup more disk space
run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install python dependencies
Expand Down
6 changes: 6 additions & 0 deletions requirements.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
streamlit
bump-my-version
pytest
playwright
pytest-playwright
pytest-cov
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
streamlit
bump-my-version
streamlit
2 changes: 2 additions & 0 deletions tests/test_rendering_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def go_to_app(page: Page, streamlit_app: StreamlitRunner):
page.goto(streamlit_app.server_url)
# Wait for app to load
page.get_by_role("img", name="Running...").is_hidden()
page.get_by_text("tab1").wait_for(state="visible")
page.get_by_text("tab2").wait_for(state="visible")


def test_should_render_template_check_container_size(page: Page):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_resolution_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
page.goto(streamlit_app.server_url)
# Wait for app to load
page.get_by_role("img", name="Running...").is_hidden()
page.get_by_text("tab 1").wait_for(state="visible")
page.get_by_text("tab 2").wait_for(state="visible")


def test_resolution_boost(page: Page):
Expand All @@ -39,7 +41,7 @@
page.locator('iframe[title="streamlit_pdf_viewer.streamlit_pdf_viewer"]').nth(2).wait_for(state="visible")
page.locator('iframe[title="streamlit_pdf_viewer.streamlit_pdf_viewer"]').nth(6).wait_for(state="hidden")
iframe_components = page.locator('iframe[title="streamlit_pdf_viewer.streamlit_pdf_viewer"]').all()
assert len(iframe_components) == 6

Check failure on line 44 in tests/test_resolution_boost.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 3.13, 18)

test_resolution_boost[chromium] assert 5 == 6 + where 5 = len([<Locator frame=<Frame name= url='http://localhost:33523/'> selector='iframe[title="streamlit_pdf_viewer.streamlit_pdf...me name= url='http://localhost:33523/'> selector='iframe[title="streamlit_pdf_viewer.streamlit_pdf_viewer"] >> nth=4'>])

Check failure on line 44 in tests/test_resolution_boost.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 3.12, 20)

test_resolution_boost[chromium] assert 5 == 6 + where 5 = len([<Locator frame=<Frame name= url='http://localhost:57941/'> selector='iframe[title="streamlit_pdf_viewer.streamlit_pdf...me name= url='http://localhost:57941/'> selector='iframe[title="streamlit_pdf_viewer.streamlit_pdf_viewer"] >> nth=4'>])

expect(iframe_components[0]).to_be_visible()
expect(iframe_components[1]).to_be_visible()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
page.goto(streamlit_app.server_url)
# Wait for app to load
page.get_by_role("img", name="Running...").is_hidden()
page.get_by_text("tab1").wait_for(state="visible")
page.get_by_text("tab2").wait_for(state="visible")


def test_should_render_template_check_container_size(page: Page):
Expand Down Expand Up @@ -83,7 +85,7 @@
expect(pdf_container_1).to_be_visible()

b_box_1 = pdf_container_1.bounding_box()
assert round(b_box_1['height']) < iframe_box['height'] and round(b_box_1['height']) > 0

Check failure on line 88 in tests/test_tabs.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 3.10, 20)

test_should_render_template_check_container_size[firefox] assert (1585 < 926.9999694824219) + where 1585 = round(1585.1332702636719)

Check failure on line 88 in tests/test_tabs.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 3.11, 18)

test_should_render_template_check_container_size[firefox] assert (1585 < 926.9999694824219) + where 1585 = round(1585.1332702636719)

Check failure on line 88 in tests/test_tabs.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 3.12, 20)

test_should_render_template_check_container_size[firefox] assert (2378 < 926.9999694824219) + where 2378 = round(2377.7000427246094)

Check failure on line 88 in tests/test_tabs.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 3.13, 20)

test_should_render_template_check_container_size[firefox] assert (2378 < 926.9999694824219) + where 2378 = round(2377.7000427246094)

Check failure on line 88 in tests/test_tabs.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 3.9, 18)

test_should_render_template_check_container_size[firefox] assert (1585 < 926.9999694824219) + where 1585 = round(1585.1332702636719)

Check failure on line 88 in tests/test_tabs.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 3.11, 18)

test_should_render_template_check_container_size[firefox] assert (2378 < 926.9999694824219) + where 2378 = round(2377.7000427246094)
assert b_box_1['width'] == 300

pdf_viewer_1 = iframe_frame_1.locator('div[id="pdfViewer"]')
Expand Down
2 changes: 2 additions & 0 deletions tests/test_tabs_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def go_to_app(page: Page, streamlit_app: StreamlitRunner):
page.goto(streamlit_app.server_url)
# Wait for app to load
page.get_by_role("img", name="Running...").is_hidden()
page.get_by_text("tab1").wait_for(state="visible")
page.get_by_text("tab2").wait_for(state="visible")


def test_should_render_template_check_container_size(page: Page):
Expand Down
Loading