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
17 changes: 0 additions & 17 deletions .github/add_github_hooks.sh

This file was deleted.

76 changes: 62 additions & 14 deletions .github/workflows/python-versions.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,75 @@
name: Python Versions
name: Demo checks

on: [push, pull_request]

jobs:
build:
permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]

python-version: ["3.13", "3.14"]
env:
UV_PYTHON: ${{ matrix.python-version }}
UV_PYTHON_DOWNLOADS: never
UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv
REFLEX_DIR: ${{ github.workspace }}/.cache/reflex
REFLEX_TELEMETRY_ENABLED: "false"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- uses: astral-sh/setup-uv@v6
with:
version: "0.12.19"
enable-cache: true
- name: Install locked dependencies without source drift
run: |
make install
- name: Lint
make setup
git diff --exit-code -- reflex.lock .gitignore
test -z "$(git status --porcelain --untracked-files=all -- reflex.lock)"
- name: Lint, format check, and behavioral tests
run: make check
- name: Build production frontend with synthetic data only
run: make build
- name: Verify frontend lock stability
run: |
make lint
- name: Test
git diff --exit-code -- reflex.lock .gitignore
test -z "$(git status --porcelain --untracked-files=all -- reflex.lock)"
- uses: actions/setup-node@v4
if: matrix.python-version == '3.13'
with:
node-version: "22.23.2"
cache: npm
- name: Install browser-test tooling
if: matrix.python-version == '3.13'
run: |
npm ci --ignore-scripts
npx playwright install --with-deps chromium
- name: Production browser and accessibility regressions
if: matrix.python-version == '3.13'
shell: bash
run: |
make test
mkdir -p .scratch
setsid uv run --frozen --no-sync reflex run --env prod --backend-host 127.0.0.1 --frontend-port 3157 > .scratch/server.log 2>&1 &
server_pid=$!
trap 'kill -- -"$server_pid" 2>/dev/null || true' EXIT
curl --fail --silent --retry 30 --retry-connrefused --retry-delay 1 http://127.0.0.1:3157/ > /dev/null
kill -0 "$server_pid"
PHISSION_URL=http://127.0.0.1:3157 npm run test:browser
git diff --exit-code -- reflex.lock
test -z "$(git status --porcelain --untracked-files=all -- reflex.lock)"
- uses: actions/upload-artifact@v4
if: always() && matrix.python-version == '3.13'
with:
name: phission-browser-evidence
path: |
.scratch/browser-validation/
.scratch/server.log
include-hidden-files: true
if-no-files-found: ignore
retention-days: 30
157 changes: 20 additions & 137 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,144 +1,27 @@
# Byte-compiled / optimized / DLL files
# Local environments, caches, and generated builds
.venv/
node_modules/
.cache/
.web
.states
assets/external/
.scratch/
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
.ruff_cache/
.coverage
htmlcov/
*.egg-info/
frontend.zip
backend.zip
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
# Never add credentials, private messages, databases, or study data
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Next.js Generated files
.web
pynecone.db

# Private JSON files
credentials.json
token.json
example_email*.json
response.json
email*.json

# Private Survey data
.env.*
credentials*.json
token*.json
*.db
*.sqlite*
*.xlsx
!phission_PANAS_results.xlsx
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
46 changes: 36 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
install:
./.github/add_github_hooks.sh
pip install --upgrade pip &&\
pip install -r requirements.txt
UV ?= uv

format:
black $$(git ls-files "*.py")
# Keep downloaded tooling and disposable framework state inside the project.
export UV_CACHE_DIR := $(CURDIR)/.cache/uv
export REFLEX_DIR := $(CURDIR)/.cache/reflex
export XDG_CACHE_HOME := $(CURDIR)/.cache
export BUN_INSTALL_CACHE_DIR := $(CURDIR)/.cache/bun
export NPM_CONFIG_CACHE := $(CURDIR)/.cache/npm
export REFLEX_TELEMETRY_ENABLED := false
export REFLEX_USE_NPM := false
export REFLEX_USE_SYSTEM_BUN := false

lint:
pylint --disable=R,C $$(git ls-files "*.py")
.PHONY: setup run test lint format check build frontend-tooling

setup:
$(UV) sync --frozen
$(UV) run --frozen --no-sync python scripts/frontend.py setup

# Do not let Reflex silently fall back to npm and replace the Bun lock.
frontend-tooling:
@test -x "$(REFLEX_DIR)/bun/bin/bun" || { echo "Run make setup to install project-local Bun."; exit 1; }

# Production mode serves the UI and Python backend together on loopback port 3000.
run: frontend-tooling
$(UV) run --frozen --no-sync reflex run --env prod --backend-host 127.0.0.1

test:
echo "No tests required"
$(UV) run --frozen --no-sync pytest

lint:
$(UV) run --frozen --no-sync ruff check .
$(UV) run --frozen --no-sync ruff format --check .

format:
$(UV) run --frozen --no-sync ruff format .

check: lint test

all: install format lint
# Produces .web/build/client; the interactive app still needs the Python backend.
build: frontend-tooling
$(UV) run --frozen --no-sync python scripts/frontend.py build
Loading
Loading