Files
8efe47503c test: python-version integration test, ensure flask start command is generated (#376)
* fix: improve python-uv example test coverage and remove unnecessary Procfile

- Add Python version verification (3.11) to test.json
- Remove Procfile as start command is auto-detected by Flask provider
- Update main.py to print Python version for test verification
- Remove hardcoded port from main.py, rely on PORT env var

The Python provider automatically detects Flask apps with gunicorn and
generates the appropriate start command, making the Procfile redundant.

* test: add httpCheck and restore Flask development server in python-uv example

- Add httpCheck test case to verify Flask app responds to HTTP requests
- Restore Flask development server code with PORT env var support
- Keep existing expectedOutput test for version verification

This gives us comprehensive test coverage: both output verification
(version check) and HTTP functionality testing.

* refactor: remove unnecessary Flask dev server code from python-uv example

The __main__ block is not needed since railpack automatically detects
Flask apps with gunicorn and generates the start command. The httpCheck
test will verify the app works correctly with the auto-detected gunicorn
start command.

* test: snapshot update

* test: remove test that doesn't use a procfile anymore

---------

Co-authored-by: Hanzo Dev <[email protected]>
2025-11-24 06:44:36 -07:00

16 lines
349 B
Python

import os
import sys
from flask import Flask
path = os.environ['PATH']
assert path.startswith("/app/.venv/bin"), f"Expected PATH to start with /app/.venv/bin but got {path}"
print("Hello from Python UV!")
print(f"Python version: {sys.version.split()[0]}")
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Python Flask!"