Skip to content

build: migrate servicex_app from Flask 2 to Flask 3 - #1501

Open
BenGalewsky wants to merge 2 commits into
developfrom
flask3-migration
Open

build: migrate servicex_app from Flask 2 to Flask 3#1501
BenGalewsky wants to merge 2 commits into
developfrom
flask3-migration

Conversation

@BenGalewsky

Copy link
Copy Markdown
Contributor

Bump flask ^2.3.3 -> ^3.1 (resolves to 3.1.3). Werkzeug, Jinja2, and all flask-* extensions were already at Flask-3-compatible versions; flask-restful 0.3.10 verified working against Flask 3.1.

Related cleanups:

  • Bump flask-migrate ^3.1.0 -> ^4.1 and pytest-flask ^1.2.0 -> ^1.3.0
  • Replace distutils.util.strtobool (removed in Python 3.12) with a local equivalent
  • Fix Api(app, errors=Flask.errorhandler): the errors kwarg expects a dict of exception-name -> response specs; passing the unbound method was a latent bug that would raise TypeError inside flask-restful error handling

Assisted-by: ClaudeCode:claude-fable-5

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.30%. Comparing base (62ade5d) to head (45cabfe).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1501      +/-   ##
===========================================
+ Coverage    89.29%   89.30%   +0.01%     
===========================================
  Files          104      104              
  Lines         3763     3769       +6     
  Branches       462      464       +2     
===========================================
+ Hits          3360     3366       +6     
  Misses         326      326              
  Partials        77       77              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BenGalewsky
BenGalewsky requested a review from ponyisi July 8, 2026 21:25
@ponyisi

ponyisi commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

One comment before I look more closely - can we get a test for full coverage of strtobool ?

@ponyisi

ponyisi commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Less invasive than I expected. Have you checked that alembic doesn't think a migration is needed (there seem to have been some strictness updates)?

Bump flask ^2.3.3 -> ^3.1 (resolves to 3.1.3). Werkzeug, Jinja2, and all
flask-* extensions were already at Flask-3-compatible versions; flask-restful
0.3.10 verified working against Flask 3.1.

Also bump flask-migrate ^3.1.0 -> ^4.1 and pytest-flask ^1.2.0 -> ^1.3.0, and
drop the unused .pre-commit-config.yaml (superseded by the repo-root
pre-commit config).

Assisted-by: ClaudeCode:claude-sonnet-5
- Replace distutils.util.strtobool (removed in Python 3.12) with a local
  equivalent
- Fix Api(app, errors=Flask.errorhandler): the errors kwarg expects a dict
  of exception-name -> response specs; passing the unbound method was a
  latent bug that would raise TypeError inside flask-restful error handling

Assisted-by: ClaudeCode:claude-sonnet-5
@BenGalewsky

Copy link
Copy Markdown
Contributor Author

@ponyisi - Tests added to bring coverage back up.
I've played around some with the migrations and it seems like we are working ok...

@BenGalewsky

Copy link
Copy Markdown
Contributor Author

Less invasive than I expected.

Yes, I was girding myself for a major migration

@ponyisi ponyisi added this to the 1.9 milestone Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants