Skip to content

fixed tests _ all pass #65

fixed tests _ all pass

fixed tests _ all pass #65

Workflow file for this run

name: Streamlit UI Development
on:
push:
branches: [ v20 ]
pull_request:
branches: [ v20 ]
jobs:
test-streamlit-ui:
name: Test Streamlit UI Components
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-streamlit-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-streamlit-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-mock
- name: Install pygetpapers in development mode
run: |
pip install -e .
- name: Test Streamlit app structure
run: |
# Test that the main app file exists and has correct syntax
python -m py_compile pygetpapers/streamlit_app.py
echo "✅ Streamlit app syntax is valid"
# Test that the run script exists and has valid syntax
python -m py_compile pygetpapers/run_streamlit.py
echo "✅ Run script syntax is valid"
# Test that the script can be imported (without running it - with 30-second timeout)
python -c "import signal; import sys; signal.alarm(30); from pygetpapers import run_streamlit; print('✅ Run script imported successfully')"
# Test that all required dependencies are available
python -c "import streamlit; print(f'✅ Streamlit {streamlit.__version__}')"
python -c "import plotly; print(f'✅ Plotly {plotly.__version__}')"
python -c "import pandas; print(f'✅ Pandas {pandas.__version__}')"
- name: Test pygetpapers integration
run: |
# Test that pygetpapers is available
pygetpapers --version
# Test basic command execution (without actually downloading)
pygetpapers --help
- name: Validate documentation
run: |
# Check that all documentation files exist
test -f README_STREAMLIT.md && echo "✅ README_STREAMLIT.md exists"
test -f docs/project-overview.md && echo "✅ project-overview.md exists"
test -f docs/user-guide.md && echo "✅ user-guide.md exists"
test -f docs/streamlit-ui-implementation.md && echo "✅ streamlit-ui-implementation.md exists"
test -f docs/implementation-summary.md && echo "✅ implementation-summary.md exists"
# Check that documentation is well-formed
grep -q "# Pygetpapers Streamlit" README_STREAMLIT.md && echo "✅ README has proper header"
- name: Test port configuration
run: |
# Verify that the app has port configuration
grep -q "port" pygetpapers/run_streamlit.py && echo "✅ Port configuration found in run script"
grep -q "8501\|8502\|8503" pygetpapers/run_streamlit.py && echo "✅ Port range configured in run script"
- name: Lint Streamlit code
run: |
# Basic syntax check (already done above, but double-check)
python -m py_compile pygetpapers/streamlit_app.py
python -m py_compile pygetpapers/run_streamlit.py
# Check for common issues
if grep -q "TODO\|FIXME\|XXX" pygetpapers/streamlit_app.py; then
echo "⚠️ Found TODO/FIXME comments in streamlit_app.py"
else
echo "✅ No TODO/FIXME comments found"
fi
# Check for potential issues
if grep -q "streamlit.run()" pygetpapers/streamlit_app.py; then
echo "✅ streamlit.run() found (expected)"
fi
build-streamlit-docs:
name: Build Streamlit Documentation
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/v20'
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create documentation site
run: |
# Create a simple HTML documentation site
mkdir -p docs/_build/html
# Convert markdown to HTML (simple approach)
echo "<html><head><title>Pygetpapers Streamlit UI</title></head><body>" > docs/_build/html/index.html
echo "<h1>Pygetpapers Streamlit UI Documentation</h1>" >> docs/_build/html/index.html
echo "<ul>" >> docs/_build/html/index.html
echo "<li><a href='README_STREAMLIT.html'>Streamlit UI README</a></li>" >> docs/_build/html/index.html
echo "<li><a href='user-guide.html'>User Guide</a></li>" >> docs/_build/html/index.html
echo "<li><a href='implementation.html'>Implementation Guide</a></li>" >> docs/_build/html/index.html
echo "</ul></body></html>" >> docs/_build/html/index.html
# Copy markdown files for reference
cp README_STREAMLIT.md docs/_build/html/ || echo "README_STREAMLIT.md not found"
cp docs/user-guide.md docs/_build/html/ || echo "user-guide.md not found"
cp docs/streamlit-ui-implementation.md docs/_build/html/ || echo "streamlit-ui-implementation.md not found"
- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: streamlit-docs
path: docs/_build/html/