From 3d0ee627a62fa2e4884a13e53058789cd504b4b6 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sun, 26 Nov 2023 23:01:55 +0800 Subject: [PATCH 1/4] Use YAML to store ext info --- extensions.yml | 15 +++++++++++++++ gen.py | 27 +++++++++++++-------------- requirements.in | 1 + requirements.txt | 4 +++- 4 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 extensions.yml diff --git a/extensions.yml b/extensions.yml new file mode 100644 index 0000000..008e4e9 --- /dev/null +++ b/extensions.yml @@ -0,0 +1,15 @@ +bootstrap-flask: + repo: helloflask/bootstrap-flask + import_string: 'from flask_bootstrap import Bootstrap5' +flask-ckeditor: + repo: helloflask/flask-ckeditor + import_string: 'from flask_ckeditor import CKEditor' +flask-debugtoolbar: + repo: pallets-eco/flask-debugtoolbar + import_string: 'from flask_debugtoolbar import DebugToolbarExtension' +flask-login: + repo: maxcountryman/flask-login + import_string: 'from flask_login import LoginManager' +flask-mailman: + repo: waynerv/flask-mailman + import_string: 'from flask_mailman import Mail' diff --git a/gen.py b/gen.py index 876a93d..20a2d74 100644 --- a/gen.py +++ b/gen.py @@ -1,19 +1,12 @@ from pathlib import Path from jinja2 import Template +import yaml basedir = Path(__file__).parent -extensions = { - 'bootstrap-flask': { 'repo': 'helloflask/bootstrap-flask', 'import_string': 'from flask_bootstrap import Bootstrap5'}, - 'flask-ckeditor': { 'repo': 'helloflask/flask-ckeditor', 'import_string': 'from flask_ckeditor import CKEditor'}, - 'flask-debugtoolbar': { 'repo': 'pallets-eco/flask-debugtoolbar', 'import_string': 'from flask_debugtoolbar import DebugToolbarExtension'}, - 'flask-login': {'repo': 'maxcountryman/flask-login', 'import_string': 'from flask_login import LoginManager'}, - 'flask-mailman': { 'repo': 'waynerv/flask-mailman', 'import_string': 'from flask_mailman import Mail'}, -} - workflow_template = """ -name: test {{ repo }} +name: build on: push: @@ -49,15 +42,21 @@ """ table_header = """ -| Extension | Latest PyPI version | PyPI downloads/month | Build with Flask 3.x | -| --------- | -------------------- | -------------------- | -------------------- |""" +| Extension Repository | Latest version | Downloads | Build with latest Flask (3.x) | +| -------------------- | --------------- | ---------- | ----------------------------- |""" table_row_template = "| [{{ repo }}](https://github.com/{{ repo }}) " \ "| ![PyPI - Version](https://img.shields.io/pypi/v/{{ package_name }}) " \ -"| ![PyPI - Downloads](https://img.shields.io/pypi/dm/{{ package_name }}?color=black) " \ +"| ![PyPI - Downloads](https://img.shields.io/pypi/dm/{{ package_name }}?color=darkgrey) " \ "| ![build](https://github.com/greyli/flask-extension-status/actions/workflows/{{ package_name }}.yml/badge.svg) |" +def get_extensions(): + """get extensions info from extensions.yml""" + with open(basedir / 'extensions.yml') as f: + return yaml.safe_load(f) + + def gen_workflow(package_name, repo, import_string): template = Template(workflow_template) return template.render( @@ -71,7 +70,7 @@ def update_readme_table(): readme_file = basedir / 'README.md' new_table = '' - for package_name, info in extensions.items(): + for package_name, info in get_extensions().items(): repo = info['repo'] new_table += Template(table_row_template).render( package_name=package_name, @@ -100,7 +99,7 @@ def update_readme_table(): if __name__ == '__main__': - for package_name, info in extensions.items(): + for package_name, info in get_extensions().items(): repo = info['repo'] import_string = info['import_string'] workflow = gen_workflow(package_name, repo, import_string) diff --git a/requirements.in b/requirements.in index 7f7afbf..4e859bb 100644 --- a/requirements.in +++ b/requirements.in @@ -1 +1,2 @@ jinja2 +pyyaml diff --git a/requirements.txt b/requirements.txt index 44b90a2..e3aab71 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile @@ -8,3 +8,5 @@ jinja2==3.1.2 # via -r requirements.in markupsafe==2.1.3 # via jinja2 +pyyaml==6.0.1 + # via -r requirements.in From cf1c088c30da2c6088bc46d9753fab999092cc8b Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sun, 26 Nov 2023 23:02:13 +0800 Subject: [PATCH 2/4] Simplify action name --- .github/workflows/bootstrap-flask.yml | 2 +- .github/workflows/flask-ckeditor.yml | 2 +- .github/workflows/flask-debugtoolbar.yml | 2 +- .github/workflows/flask-login.yml | 2 +- .github/workflows/flask-mailman.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bootstrap-flask.yml b/.github/workflows/bootstrap-flask.yml index 4d22948..a8fc3e3 100644 --- a/.github/workflows/bootstrap-flask.yml +++ b/.github/workflows/bootstrap-flask.yml @@ -1,5 +1,5 @@ -name: test helloflask/bootstrap-flask +name: build on: push: diff --git a/.github/workflows/flask-ckeditor.yml b/.github/workflows/flask-ckeditor.yml index 4bba71c..8b68d4e 100644 --- a/.github/workflows/flask-ckeditor.yml +++ b/.github/workflows/flask-ckeditor.yml @@ -1,5 +1,5 @@ -name: test helloflask/flask-ckeditor +name: build on: push: diff --git a/.github/workflows/flask-debugtoolbar.yml b/.github/workflows/flask-debugtoolbar.yml index 326d9e4..cdafda5 100644 --- a/.github/workflows/flask-debugtoolbar.yml +++ b/.github/workflows/flask-debugtoolbar.yml @@ -1,5 +1,5 @@ -name: test pallets-eco/flask-debugtoolbar +name: build on: push: diff --git a/.github/workflows/flask-login.yml b/.github/workflows/flask-login.yml index 07d5188..3d02829 100644 --- a/.github/workflows/flask-login.yml +++ b/.github/workflows/flask-login.yml @@ -1,5 +1,5 @@ -name: test maxcountryman/flask-login +name: build on: push: diff --git a/.github/workflows/flask-mailman.yml b/.github/workflows/flask-mailman.yml index 7e03c3d..e2aef84 100644 --- a/.github/workflows/flask-mailman.yml +++ b/.github/workflows/flask-mailman.yml @@ -1,5 +1,5 @@ -name: test waynerv/flask-mailman +name: build on: push: From 002ab4275b97d364b6a13651c3661a32920aeea6 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sun, 26 Nov 2023 23:02:25 +0800 Subject: [PATCH 3/4] Add usage info --- README.md | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 031e8aa..8e147be 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,42 @@ # Flask Extension Status +## Add new extension + +Clone the repo and install dependencies: + +```bash +git clone https://github.com/greyli/flask-extension-status +cd flask-extension-status +pip install -r requirements.txt +``` + +Add the extension info to `extensions.yml`: + +```yaml +flask-foo: + repo: github_username/repo_name + import_string: 'the import string of your extension' +``` + +Then run: + +```bash +python gen.py +``` + +Commit and push the changes, then create a pull request. + ## Extension health dashboard -| Extension | Latest PyPI version | PyPI downloads/month | Build with Flask 3.x | -| --------- | -------------------- | -------------------- | -------------------- | -| [helloflask/bootstrap-flask](https://github.com/helloflask/bootstrap-flask) | ![PyPI - Version](https://img.shields.io/pypi/v/bootstrap-flask) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/bootstrap-flask?color=black) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/bootstrap-flask.yml/badge.svg) | -| [helloflask/flask-ckeditor](https://github.com/helloflask/flask-ckeditor) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-ckeditor) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-ckeditor?color=black) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-ckeditor.yml/badge.svg) | -| [pallets-eco/flask-debugtoolbar](https://github.com/pallets-eco/flask-debugtoolbar) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-debugtoolbar) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-debugtoolbar?color=black) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-debugtoolbar.yml/badge.svg) | -| [maxcountryman/flask-login](https://github.com/maxcountryman/flask-login) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-login) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-login?color=black) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-login.yml/badge.svg) | -| [waynerv/flask-mailman](https://github.com/waynerv/flask-mailman) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-mailman) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-mailman?color=black) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-mailman.yml/badge.svg) | +| Extension Repository | Latest version | Downloads | Build with latest Flask (3.x) | +| -------------------- | --------------- | ---------- | ----------------------------- | +| [helloflask/bootstrap-flask](https://github.com/helloflask/bootstrap-flask) | ![PyPI - Version](https://img.shields.io/pypi/v/bootstrap-flask) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/bootstrap-flask?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/bootstrap-flask.yml/badge.svg) | +| [helloflask/flask-ckeditor](https://github.com/helloflask/flask-ckeditor) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-ckeditor) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-ckeditor?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-ckeditor.yml/badge.svg) | +| [pallets-eco/flask-debugtoolbar](https://github.com/pallets-eco/flask-debugtoolbar) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-debugtoolbar) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-debugtoolbar?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-debugtoolbar.yml/badge.svg) | +| [maxcountryman/flask-login](https://github.com/maxcountryman/flask-login) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-login) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-login?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-login.yml/badge.svg) | +| [waynerv/flask-mailman](https://github.com/waynerv/flask-mailman) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-mailman) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-mailman?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-mailman.yml/badge.svg) | From 85394d9b3b26f43ff8626ddf125c4a94d17db792 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sun, 26 Nov 2023 23:18:50 +0800 Subject: [PATCH 4/4] Update README --- README.md | 42 ++++++++++++++++++++++++------------------ extensions.yml | 1 + 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 8e147be..900d6f5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,28 @@ # Flask Extension Status -## Add new extension +*Let's hope the CI of this repository will pass someday.* + +It's a status dashboard for Flask extension. In the [Extension status](#extension-status) table, each extension has a build badge to show whether it can be built with the latest Flask version. Feel free to add new extensions or update the info of existing extensions (see [How to add an extension?](#how-to-add-an-extension) for details) + +For a project that is not maintained anymore, we will list them in the [Unmaintained extension and alternatives](#unmaintained-extension-and-alternatives) section and provide some alternatives. If you have a extension but don't have time to maintain it, you can consider donating it to the [pallets-eco organzation](https://github.com/pallets-eco). + +Want to help a Flask extension? Check the [What can I do to help?](#what-can-i-do-to-help) section. Let's make Flask ecosystem better together! + +## Extension status + + + +| Extension Repository | Latest version | Downloads | Build with latest Flask (3.x) | +| -------------------- | --------------- | ---------- | ----------------------------- | +| [helloflask/bootstrap-flask](https://github.com/helloflask/bootstrap-flask) | ![PyPI - Version](https://img.shields.io/pypi/v/bootstrap-flask) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/bootstrap-flask?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/bootstrap-flask.yml/badge.svg) | +| [helloflask/flask-ckeditor](https://github.com/helloflask/flask-ckeditor) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-ckeditor) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-ckeditor?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-ckeditor.yml/badge.svg) | +| [pallets-eco/flask-debugtoolbar](https://github.com/pallets-eco/flask-debugtoolbar) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-debugtoolbar) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-debugtoolbar?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-debugtoolbar.yml/badge.svg) | +| [maxcountryman/flask-login](https://github.com/maxcountryman/flask-login) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-login) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-login?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-login.yml/badge.svg) | +| [waynerv/flask-mailman](https://github.com/waynerv/flask-mailman) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-mailman) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-mailman?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-mailman.yml/badge.svg) | + + + +## How to add an extension? Clone the repo and install dependencies: @@ -26,22 +48,6 @@ python gen.py Commit and push the changes, then create a pull request. -## Extension health dashboard - - - -| Extension Repository | Latest version | Downloads | Build with latest Flask (3.x) | -| -------------------- | --------------- | ---------- | ----------------------------- | -| [helloflask/bootstrap-flask](https://github.com/helloflask/bootstrap-flask) | ![PyPI - Version](https://img.shields.io/pypi/v/bootstrap-flask) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/bootstrap-flask?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/bootstrap-flask.yml/badge.svg) | -| [helloflask/flask-ckeditor](https://github.com/helloflask/flask-ckeditor) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-ckeditor) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-ckeditor?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-ckeditor.yml/badge.svg) | -| [pallets-eco/flask-debugtoolbar](https://github.com/pallets-eco/flask-debugtoolbar) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-debugtoolbar) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-debugtoolbar?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-debugtoolbar.yml/badge.svg) | -| [maxcountryman/flask-login](https://github.com/maxcountryman/flask-login) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-login) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-login?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-login.yml/badge.svg) | -| [waynerv/flask-mailman](https://github.com/waynerv/flask-mailman) | ![PyPI - Version](https://img.shields.io/pypi/v/flask-mailman) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-mailman?color=darkgrey) | ![build](https://github.com/greyli/flask-extension-status/actions/workflows/flask-mailman.yml/badge.svg) | - - - -## About this project - -## What can we do? +## What can I do to help? ## Unmaintained extension and alternatives diff --git a/extensions.yml b/extensions.yml index 008e4e9..ad43571 100644 --- a/extensions.yml +++ b/extensions.yml @@ -1,3 +1,4 @@ +# sort by name alphabetically bootstrap-flask: repo: helloflask/bootstrap-flask import_string: 'from flask_bootstrap import Bootstrap5'