Repository: singingwolfboy/flask-misaka (language: python)

Issue:
Cannot import Markup from flask
With flask 3.0.0, flask-misaka-1.0.0 is broken: 

```python
from flask import Flask
from flask_misaka import Misaka

app = Flask(__name__)
Misaka(app)
```

```
(.venv) $ flask --app dashboard run
Usage: flask run [OPTIONS]
Try 'flask run --help' for help.

Error: While importing 'dashboard', an ImportError was raised:

Traceback (most recent call last):
  File ".../.venv/lib/python3.10/site-packages/flask/cli.py", line 219, in locate_app
    __import__(module_name)
  File ".../dashboard.py", line 1, in <module>
    from app import app
  File ".../app/__init__.py", line 2, in <module>
    from flask_misaka import Misaka
  File ".../.venv/lib/python3.10/site-packages/flask_misaka.py", line 6, in <module>
    from flask import Markup
ImportError: cannot import name 'Markup' from 'flask' (.../.venv/lib/python3.10/site-packages/flask/__init__.py)
```

The flask devs seem to suggest that this is [not their problem](https://github.com/pallets/flask/issues/5353).



Discussion / hints:

Fix patch:
diff --git a/dev-requirements.txt b/dev-requirements.txt
index e8fe220..70efc79 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,2 +1,3 @@
+Flask>=0.7
 coverage
 mock; python_version < '3.3'
diff --git a/flask_misaka.py b/flask_misaka.py
index 82718a2..53b8cb6 100644
--- a/flask_misaka.py
+++ b/flask_misaka.py
@@ -1,9 +1,9 @@
 from __future__ import absolute_import, unicode_literals
 
-__version__ = '1.0.0'
+__version__ = '1.0.1'
 
 import misaka
-from flask import Markup
+from markupsafe import Markup
 from copy import copy
 
 # import constants for compatibility
diff --git a/requirements.txt b/requirements.txt
index ca71e4e..65d1750 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
-Flask>=0.7
+markupsafe
 misaka>=2.0,<3.0
diff --git a/setup.py b/setup.py
index a416411..f6a06d3 100644
--- a/setup.py
+++ b/setup.py
@@ -2,9 +2,9 @@
 import re
 from setuptools import setup, find_packages
 
-tests_require = []
+tests_require = ['Flask']
 if sys.version_info[0] < 3:
-    tests_require = ['mock']
+    tests_require.append('mock')
 
 version = ''
 with open('flask_misaka.py', 'r') as fd:
@@ -26,7 +26,7 @@
     packages=find_packages(),
     py_modules=['flask_misaka'],
     install_requires=[
-        'Flask>=0.7',
+        'markupsafe',
         'misaka>=2.0,<3.0',
     ],
     test_suite='tests',


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 85619ef..b4d5d1f 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -12,7 +12,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ["2.x", "3.x"]
+        python-version: ["3.x"]
     name: "pytest: Python ${{ matrix.python-version }}"
 
     steps:
@@ -21,6 +21,9 @@ jobs:
         with:
           python-version: ${{ matrix.python-version }}
 
+      - name: Install setuptools
+        run: pip install setuptools
+
       - name: Install dependencies
         run: >-
           pip install
diff --git a/tests.py b/tests.py
index fc24411..47bb559 100644
--- a/tests.py
+++ b/tests.py
@@ -1,5 +1,6 @@
 from __future__ import unicode_literals
-from flask import Flask, render_template_string, Markup
+from flask import Flask, render_template_string
+from markupsafe import Markup
 from unittest import TestCase
 from textwrap import dedent
 try: