File tree 4 files changed +12
-9
lines changed
spread/rockcraft/extension-flask
4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ Extensions to enable when building the ROCK.
259
259
260
260
Currently supported extensions:
261
261
262
- - ``flask `` (experimental)
262
+ - ``flask-framework ``
263
263
264
264
Example
265
265
=======
Original file line number Diff line number Diff line change 14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
17
- """An experimental extension for the Gunicorn based Python WSGI application extensions."""
17
+ """An extension for the Gunicorn based Python WSGI application extensions."""
18
18
import abc
19
19
import ast
20
20
import fnmatch
@@ -188,6 +188,12 @@ def framework(self) -> str:
188
188
"""Return the wsgi framework name, e.g. flask, django."""
189
189
return "flask"
190
190
191
+ @staticmethod
192
+ @override
193
+ def is_experimental (base : str | None ) -> bool :
194
+ """Check if the extension is in an experimental state."""
195
+ return False
196
+
191
197
@override
192
198
def gen_install_app_part (self ) -> Dict [str , Any ]:
193
199
source_files = [f .name for f in sorted (self .project_root .iterdir ())]
Original file line number Diff line number Diff line change 1
1
summary : flask extension test
2
2
3
3
execute : |
4
- export ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true
5
-
6
4
run_rockcraft init --name flask-extension --profile flask-framework
7
5
run_rockcraft pack
8
6
@@ -15,15 +13,15 @@ execute: |
15
13
sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:flask-extension_0.1_amd64.rock docker-daemon:flask-extension:latest
16
14
# Ensure container exists
17
15
docker images flask-extension | MATCH "flask-extension"
18
-
16
+
19
17
# ensure container doesn't exist
20
18
docker rm -f flask-extension-container
21
-
19
+
22
20
# test the flask project is ready to run inside the container
23
21
docker run --rm --entrypoint /bin/python3 flask-extension -m gunicorn --chdir /flask/app --check-config app:app
24
22
docker run --rm --entrypoint /bin/python3 flask-extension -c "import pathlib;assert pathlib.Path('/flask/app/static/js/test.js').is_file()"
25
23
docker run --rm --entrypoint /bin/python3 flask-extension -c "import pathlib;assert not pathlib.Path('/flask/app/node_modules').exists()"
26
-
24
+
27
25
# test the default flask service
28
26
docker run --name flask-extension-container -d -p 8137:8000 flask-extension
29
27
retry -n 5 --wait 2 curl localhost:8137
Original file line number Diff line number Diff line change 21
21
22
22
23
23
@pytest .fixture
24
- def flask_extension (mock_extensions , monkeypatch ):
25
- monkeypatch .setenv ("ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS" , "1" )
24
+ def flask_extension (mock_extensions ):
26
25
extensions .register ("flask-framework" , extensions .FlaskFramework )
27
26
28
27
You can’t perform that action at this time.
0 commit comments