Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "epiworldPythonStreamlit Dev Container",
"name": "epicc Dev Container",
"remoteUser": "dev",
"build": {
"dockerfile": "../Containerfile",
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/containerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ on:
push:
branches:
- main
paths:
- 'Containerfile'
- 'pyproject.toml'
- 'uv.lock'

workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: epiforesite/epiworldpythonstreamlit
IMAGE_NAME: epiforesite/epicc

jobs:
build-and-push:
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/copilot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,43 @@ on:

permissions:
contents: read
packages: read

# TODO: This should, at some point, use the container image built by the other workflows.
# Not sure how to do that though.

jobs:
copilot:
runs-on: ubuntu-latest
container:
image: ghcr.io/epiforesite/epiworldpythonstreamlit:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Sync dependencies
run: uv sync --frozen --group dev --no-install-project

- name: Install development dependencies and tools
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
build-essential \
pkg-config \
git \
vim \
nano \
curl \
wget

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install Python
run: uv python install 3.12

- name: Sync dependencies
run: uv sync --frozen --group dev --no-install-project

- name: Verify development environment
run: |
echo "Development environment ready for GitHub Copilot"
echo "Python version: $(python --version)"
echo "Python version: $(uv run python --version)"
echo "uv version: $(uv --version)"
uv pip list
60 changes: 60 additions & 0 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy to GitHub Pages

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build container image from Containerfile
uses: docker/build-push-action@v6
with:
context: .
file: ./Containerfile
push: false
load: true
tags: epicc:local
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build stlite bundle
run: |
docker run --rm --user root \
-v "$PWD:/workspaces/${{ github.event.repository.name }}" \
-w /workspaces/${{ github.event.repository.name }} \
epicc:local \
sh -c "uv sync --frozen && uv run scripts/build.py --app app.py --out dist"

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
30 changes: 20 additions & 10 deletions .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,33 @@ on:

permissions:
contents: read
packages: read

jobs:
test:
runs-on: ubuntu-latest
container:
image: ghcr.io/epiforesite/epiworldpythonstreamlit:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies with uv
run: uv sync --frozen
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run tests with pytest
run: uv run pytest
- name: Build container image from Containerfile
uses: docker/build-push-action@v6
with:
context: .
file: ./Containerfile
push: false
load: true
tags: epicc:local
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Install dependencies and run tests
run: |
docker run --rm --user root \
-v "$PWD:/workspaces/${{ github.event.repository.name }}" \
-w /workspaces/${{ github.event.repository.name }} \
epicc:local \
sh -c "uv sync --frozen && uv run pytest"
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
*.egg-info/
__pycache__/
.pytest_cache/
.coverage
.DS_Store
.mypy_cache/
.pytest_cache/
.venv/
.vscode/
dist/
*.py[cod]
.DS_Store
*.egg
.coverage
__pycache__/
*.bak
*.egg
*.egg-info/
*.py[cod]
build/
dist/
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AGENTS.md — EpiCON Cost Calculator
# AGENTS.md — epicc Cost Calculator

This file describes the conventions, roles, and constraints for contributors working in this
repository. All agents — whether running in GitHub Actions or invoked interactively — should
Expand All @@ -8,7 +8,7 @@ read and follow this document before making changes.

## Project overview

**EpiCON** is a browser-based epidemiological cost calculator built with **Streamlit** and
**epicc** is a browser-based epidemiological cost calculator built with **Streamlit** and
distributed as a static **stlite** build for browser execution.

The current app supports two model flows:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# epiworldPythonStreamlit
# epicc

Streamlit webapp for epiworld.

Expand Down
6 changes: 0 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
"""Top-level Streamlit entrypoint.

This shim makes the app runnable from the repository root without requiring
manual PYTHONPATH tweaks.
"""

import sys
from pathlib import Path

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# epiworldPythonStreamlit
# epicc

## Launch the App

Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "epiworld-python-streamlit"
name = "epicc"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
Expand All @@ -19,6 +19,7 @@ dev = [
"types-pyyaml>=6.0.12.20250915",
"pandas-stubs>=3.0.0.260204",
"types-openpyxl>=3.1.0.20240106",
"playwright>=1.58.0",
]

[tool.pytest.ini_options]
Expand All @@ -29,8 +30,8 @@ mypy_path = "src"
explicit_package_bases = true

[tool.stlite]
title = "EpiCON Cost Calculator"
title = "epicc Cost Calculator"
mount_dirs = ["src"]
text_suffixes = [".py", ".yaml", ".yml", ".css", ".js", ".html"]
css_url = "https://cdn.jsdelivr.net/npm/@stlite/browser@0.85.1/build/stlite.css"
js_url = "https://cdn.jsdelivr.net/npm/@stlite/browser@0.85.1/build/stlite.js"
js_url = "https://cdn.jsdelivr.net/npm/@stlite/browser@0.85.1/build/stlite.js"
4 changes: 2 additions & 2 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ def build_loader_html(
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="EpiCON" />
<meta name="apple-mobile-web-app-title" content="epicc" />

<meta property="og:type" content="website" />
<meta property="og:title" content="{title_html}" />
<meta property="og:description" content="Calculate and analyze epidemiological costs" />
<meta property="og:url" content="https://epiForeSITE.github.io/epiworldPythonStreamlit" />
<meta property="og:url" content="https://epiForeSITE.github.io/epicc" />

<!-- TODO: Favicon -->
<!-- <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /> -->
Expand Down
Loading
Loading