Skip to content

refactor: transition to pyproject.toml#2444

Open
Dev-iL wants to merge 1 commit intodpgaspar:masterfrom
Dev-iL:2603/modern_pkg
Open

refactor: transition to pyproject.toml#2444
Dev-iL wants to merge 1 commit intodpgaspar:masterfrom
Dev-iL:2603/modern_pkg

Conversation

@Dev-iL
Copy link
Copy Markdown

@Dev-iL Dev-iL commented Mar 19, 2026

Description

Migrate Flask-AppBuilder's packaging from legacy setup.py to modern pyproject.toml (PEP 621), using the same setuptools backend.

What changes:

  • New pyproject.toml with [build-system], [project] (all metadata, 21 dependencies, 4 optional-dependency groups, entry-point), [tool.setuptools] (include-package-data, package-data patterns, dynamic version via attr), [tool.mypy] (global settings + 7 per-module overrides), and [tool.coverage.run].
  • Deleted setup.py — replaced entirely by pyproject.toml.
  • Deleted MANIFEST.in — replaced by explicit [tool.setuptools.package-data] patterns for static/templates/translations.
  • Trimmed setup.cfg — removed all [mypy] and [mypy-*] sections (moved to pyproject.toml). Retained [unittest], [coverage] (nose2 plugin), and [flake8] sections.
  • Updated flask_appbuilder/__init__.py — added importlib.metadata.version() as the primary version source with the hardcoded string as fallback, ensuring both flask_appbuilder.__version__ and importlib.metadata.version('Flask-AppBuilder') return consistent values.
  • Updated .github/workflows/ci.yml — removed setup.py from the black formatting check.
  • Updated tox.ini — removed setup.py from the black check target.
  • Updated release.sh — replaced python setup.py clean --all sdist bdist_wheel with python -m build; cleans both ./dist and ./build directories.
  • Updated RELEASE.rst — step 8 now uses python -m build && twine upload dist/*.
  • Updated requirements/dev.in — added build package as an explicit dev dependency.

Key design decisions:

  • requires-python updated from ~=3.7 to >=3.9 (3.7 and 3.8 are EOL; matches CI matrix).
  • Python 3.7/3.8 classifiers removed; License classifier removed (superseded by PEP 639 license = "BSD-3-Clause" expression).
  • Uses [tool.setuptools.packages.find] include = ["flask_appbuilder*"] instead of exclude = ["tests*"] to prevent unintended discovery of top-level directories (bin/, examples/, docs/).
  • Explicit [tool.setuptools.package-data] for static/templates/translations ensures reliable inclusion in isolated builds where VCS access may be unavailable.
  • __version__ kept as a simple top-level string assignment for setuptools attr static analysis compatibility, with runtime override from importlib.metadata.

Verified:

  • Built wheel file listing is identical before and after migration (243 files).
  • All 21 dependency version specifiers are semantically equivalent.
  • Editable install (pip install -e .) and regular install (pip install .) both succeed.
  • All package metadata (name, author, license, description, URLs, classifiers, entry-points) preserved.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Is CRUD MVC related.
  • Is Auth, RBAC security related.
  • Changes the security db schema.
  • Introduces new feature
  • Removes existing feature

@Dev-iL Dev-iL force-pushed the 2603/modern_pkg branch 2 times, most recently from d9a73e0 to 71a875c Compare April 9, 2026 05:34
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.56%. Comparing base (eefc219) to head (71a875c).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2444      +/-   ##
==========================================
- Coverage   79.91%   79.56%   -0.36%     
==========================================
  Files          81       81              
  Lines        9183     9250      +67     
==========================================
+ Hits         7339     7360      +21     
- Misses       1844     1890      +46     
Flag Coverage Δ
python 79.56% <100.00%> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Dev-iL Dev-iL force-pushed the 2603/modern_pkg branch from 71a875c to 8893743 Compare April 9, 2026 17:10
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.

1 participant