Skip to content

Commit afdbe10

Browse files
authored
[deploy] Merge pull request #231 from microsoft/dev
New architecture and new visualization capability
2 parents 1b5b1e1 + d771530 commit afdbe10

274 files changed

Lines changed: 74825 additions & 15684 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/python
33
{
4-
"name": "Python 3",
4+
"name": "Data Formulator Dev",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
6+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
77

88
// Features to add to the dev container. More info: https://containers.dev/features.
9-
"features": {
10-
"ghcr.io/devcontainers/features/node:1": {
11-
"version": "18"
12-
},
13-
"ghcr.io/devcontainers/features/azure-cli:1": {}
14-
},
9+
"features": {
10+
"ghcr.io/devcontainers/features/node:1": {
11+
"version": "18"
12+
},
13+
"ghcr.io/devcontainers/features/azure-cli:1": {},
14+
"ghcr.io/astral-sh/uv:1": {}
15+
},
1516

1617
// Use 'forwardPorts' to make a list of ports inside the container available locally.
17-
// "forwardPorts": [],
18+
"forwardPorts": [5000, 5173],
1819

1920
// Use 'postCreateCommand' to run commands after the container is created.
20-
"postCreateCommand": "cd /workspaces/data-formulator && npm install && npm run build && python3 -m venv /workspaces/data-formulator/venv && . /workspaces/data-formulator/venv/bin/activate && pip install -e /workspaces/data-formulator --verbose && data_formulator"
21+
"postCreateCommand": "cd /workspaces/data-formulator && npm install && npm run build && uv sync && uv run data_formulator"
2122

2223
// Configure tool-specific properties.
2324
// "customizations": {},

.env.template

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,57 @@
1-
# Provide frontend configuration settings from environment variables
2-
# You can override these settings when lauching the app as well:
3-
# python -m data_formulator -p 5000 --exec-python-in-subprocess true --disable-display-keys true
1+
# Data Formulator Configuration
2+
# Copy this file to .env and fill in your values.
3+
# cp .env.template .env
44

5-
DISABLE_DISPLAY_KEYS=false # if true, the display keys will not be shown in the frontend
6-
EXEC_PYTHON_IN_SUBPROCESS=false # if true, the python code will be executed in a subprocess to avoid crashing the main app, but it will increase the time of response
5+
# -------------------------------------------------------------------
6+
# Server settings
7+
# -------------------------------------------------------------------
8+
# You can also override these via CLI flags (run `data_formulator --help`).
79

8-
LOCAL_DB_DIR= # the directory to store the local database, if not provided, the app will use the temp directory
10+
DISABLE_DISPLAY_KEYS=false # if true, API keys will not be shown in the frontend
11+
SANDBOX=local # code execution backend: 'local' (default) or 'docker'
12+
13+
# -------------------------------------------------------------------
14+
# LLM provider API keys
15+
# -------------------------------------------------------------------
16+
# Enable providers and set API keys / models below.
17+
# For details see: https://docs.litellm.ai/docs#litellm-python-sdk
18+
19+
# OpenAI
20+
OPENAI_ENABLED=true
21+
OPENAI_API_KEY=#your-openai-api-key
22+
OPENAI_MODELS=gpt-5.2,gpt-5.1 # comma separated list of models
23+
24+
# Azure OpenAI
25+
AZURE_ENABLED=true
26+
AZURE_API_KEY=#your-azure-openai-api-key
27+
AZURE_API_BASE=https://your-azure-openai-endpoint.openai.azure.com/
28+
AZURE_MODELS=gpt-5.1
29+
30+
# Anthropic
31+
ANTHROPIC_ENABLED=true
32+
ANTHROPIC_API_KEY=#your-anthropic-api-key
33+
ANTHROPIC_MODELS=claude-sonnet-4-20250514
34+
35+
# Ollama
36+
OLLAMA_ENABLED=true
37+
OLLAMA_API_BASE=http://localhost:11434
38+
OLLAMA_MODELS=deepseek-v3.1:latest # models with good code generation capabilities recommended
39+
40+
# Add other LiteLLM-supported providers with PROVIDER_API_KEY, PROVIDER_MODELS, etc.
41+
42+
# -------------------------------------------------------------------
43+
# Azure Blob Storage Workspace (optional)
44+
# -------------------------------------------------------------------
45+
# Set WORKSPACE_BACKEND=azure_blob to store workspace data in Azure Blob Storage
46+
# instead of the local filesystem.
47+
#
48+
# Authentication — choose ONE of the following:
49+
# Option A: Connection string (shared key / SAS)
50+
# AZURE_BLOB_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...
51+
# Option B: Entra ID (Managed Identity / az login / workload identity)
52+
# AZURE_BLOB_ACCOUNT_URL=https://<account>.blob.core.windows.net
53+
#
54+
# WORKSPACE_BACKEND=local
55+
# AZURE_BLOB_CONNECTION_STRING=
56+
# AZURE_BLOB_ACCOUNT_URL=
57+
# AZURE_BLOB_CONTAINER=data-formulator

.github/workflows/python-build.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
pull_request:
1010
branches: [ "main" ]
1111

12+
# Global permissions required for OIDC authentication
13+
permissions:
14+
id-token: write
15+
contents: read
16+
1217
jobs:
1318
build:
1419
runs-on: ubuntu-latest
@@ -21,42 +26,37 @@ jobs:
2126
with:
2227
node-version: 20
2328
cache: 'yarn'
24-
- name: Set up Python 3.12
25-
uses: actions/setup-python@v5
29+
- name: Set up uv
30+
uses: astral-sh/setup-uv@v4
2631
with:
2732
python-version: 3.12
2833
- name: Install node dependencies
2934
run: yarn install
30-
- name: Install python dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34-
python -m pip install build
3535
- name: Build frontend
3636
run: yarn build
3737
- name: Build python artifact
38-
run: python -m build
38+
run: uv build
3939
- name: Archive production artifacts
4040
uses: actions/upload-artifact@v4
4141
with:
4242
name: release-dist
4343
path: dist
4444

45-
# pypi-publish:
46-
# runs-on: ubuntu-latest
47-
# needs:
48-
# - build
49-
# if: github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy]')
50-
# environment:
51-
# name: pypi
52-
# url: https://pypi.org/p/data-formulator
53-
# permissions:
54-
# id-token: write
55-
# steps:
56-
# - name: Retrieve release distributions
57-
# uses: actions/download-artifact@v4
58-
# with:
59-
# name: release-dist
60-
# path: dist/
61-
# - name: Publish package distributions to PyPI
62-
# uses: pypa/gh-action-pypi-publish@release/v1
45+
pypi-publish:
46+
runs-on: ubuntu-latest
47+
needs:
48+
- build
49+
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy]')
50+
environment:
51+
name: pypi
52+
url: https://pypi.org/p/data-formulator
53+
permissions:
54+
id-token: write
55+
steps:
56+
- name: Retrieve release distributions
57+
uses: actions/download-artifact@v4
58+
with:
59+
name: release-dist
60+
path: dist/
61+
- name: Publish package distributions to PyPI
62+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
*env
3-
*api-keys.env
3+
.venv/
4+
.env
45
**/*.ipynb_checkpoints/
56
.DS_Store
67
build/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)