Skip to content

Commit fba4f1c

Browse files
feat(flask): remove experimental flag for flask-framework extension (#522) (#560)
Co-authored-by: David Andersson <[email protected]>
1 parent f03bda5 commit fba4f1c

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

docs/reference/rockcraft.yaml.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ Extensions to enable when building the ROCK.
259259

260260
Currently supported extensions:
261261

262-
- ``flask`` (experimental)
262+
- ``flask-framework``
263263

264264
Example
265265
=======

rockcraft/extensions/gunicorn.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
"""An experimental extension for the Gunicorn based Python WSGI application extensions."""
17+
"""An extension for the Gunicorn based Python WSGI application extensions."""
1818
import abc
1919
import ast
2020
import fnmatch
@@ -188,6 +188,12 @@ def framework(self) -> str:
188188
"""Return the wsgi framework name, e.g. flask, django."""
189189
return "flask"
190190

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+
191197
@override
192198
def gen_install_app_part(self) -> Dict[str, Any]:
193199
source_files = [f.name for f in sorted(self.project_root.iterdir())]

tests/spread/rockcraft/extension-flask/task.yaml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
summary: flask extension test
22

33
execute: |
4-
export ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true
5-
64
run_rockcraft init --name flask-extension --profile flask-framework
75
run_rockcraft pack
86
@@ -15,15 +13,15 @@ execute: |
1513
sudo /snap/rockcraft/current/bin/skopeo --insecure-policy copy oci-archive:flask-extension_0.1_amd64.rock docker-daemon:flask-extension:latest
1614
# Ensure container exists
1715
docker images flask-extension | MATCH "flask-extension"
18-
16+
1917
# ensure container doesn't exist
2018
docker rm -f flask-extension-container
21-
19+
2220
# test the flask project is ready to run inside the container
2321
docker run --rm --entrypoint /bin/python3 flask-extension -m gunicorn --chdir /flask/app --check-config app:app
2422
docker run --rm --entrypoint /bin/python3 flask-extension -c "import pathlib;assert pathlib.Path('/flask/app/static/js/test.js').is_file()"
2523
docker run --rm --entrypoint /bin/python3 flask-extension -c "import pathlib;assert not pathlib.Path('/flask/app/node_modules').exists()"
26-
24+
2725
# test the default flask service
2826
docker run --name flask-extension-container -d -p 8137:8000 flask-extension
2927
retry -n 5 --wait 2 curl localhost:8137

tests/unit/extensions/test_gunicorn.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222

2323
@pytest.fixture
24-
def flask_extension(mock_extensions, monkeypatch):
25-
monkeypatch.setenv("ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS", "1")
24+
def flask_extension(mock_extensions):
2625
extensions.register("flask-framework", extensions.FlaskFramework)
2726

2827

0 commit comments

Comments
 (0)