Skip to content

Commit 697698d

Browse files
committed
Replace flex module with openapi-spec-validator and regenerate lockfile/requirements
Lockfile diff: lockfiles/st2.lock [st2] == Added dependencies == jsonschema-spec 0.1.6 lazy-object-proxy 1.12.0 openapi-schema-validator 0.4.4 openapi-spec-validator 0.5.7 pathable 0.4.4 rfc3339-validator 0.1.4 == Removed dependencies == flex 6.14.1 jsonpointer 3.1.1 rfc3987 1.3.8 strict-rfc3339 0.7 validate-email 1.3
1 parent 4a6cd40 commit 697698d

File tree

11 files changed

+224
-102
lines changed

11 files changed

+224
-102
lines changed

BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ python_requirements(
22
name="reqs",
33
source="requirements-pants.txt",
44
overrides={
5-
# flex and stevedore uses pkg_resources w/o declaring the dep
6-
("flex", "stevedore"): dict(
5+
# stevedore uses pkg_resources w/o declaring the dep
6+
("stevedore"): dict(
77
dependencies=[
88
"//:reqs#setuptools",
99
]

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Changed
2323
* Removed Python 3.8 and 3.9 from testing and CI/CD.
2424
* Removed mongodb 7.0, rabbitmq 3.13 and redis 8.0
2525
* Replaced deprecated `pkg_resources` module with `importlib-metadata` and `importlib-resources`.
26-
26+
* Replaced abandoned `flex` module by `openapi-spec-validator`
27+
2728
Added
2829
~~~~~
2930

fixed-requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ chardet==5.2.0
1212
cffi==1.17.1
1313
cryptography==43.0.3
1414
eventlet==0.39.1
15-
flex==6.14.1
1615
# Note: installs gitpython==3.1.37 (security fixed) under py3.8 and gitpython==3.1.18 (latest available, vulnerable) under py3.6
1716
gitpython==3.1.45
1817
# Needed by gitpython, old versions used to bundle it
1918
gitdb==4.0.12
2019
# Note: greenlet is used by eventlet
2120
greenlet==3.1.1
2221
gunicorn==23.0.0
23-
# importlib backport to replace pkg_resrouce from setuptools.
24-
importlib-metadata==6.5
25-
importlib-resources==5.12
22+
# importlib backport replaces setuptool's pkg_resource.
23+
importlib_resources==6.5.2
24+
importlib_metadata==9.0.0
2625
jsonpath-rw==1.4.0
2726
# Using jsonschema>=4.18.0 requires refactoring/debugging use of $ref.
2827
jsonschema==4.17.3
28+
# openapi-spec-validator pinned to align with st2's jsonschema pinning constraint
29+
openapi-spec-validator==0.5.7
2930
kombu==5.5.4
3031
lockfile==0.12.2
3132
mongoengine==0.29.1
@@ -64,7 +65,6 @@ six==1.17.0
6465
argparse==1.4.0
6566
argcomplete==3.6.2
6667
prettytable==3.11.0
67-
importlib-metadata==8.5.0
6868
# 20250909 virtualenv 20.34.0 requires typing-extension>=4.13.2
6969
typing-extensions>=4.13.2; python_version < "3.11"
7070
# NOTE: sseclient has various issues which sometimes hang the connection for a long time, etc.

lockfiles/st2.lock

Lines changed: 203 additions & 84 deletions
Large diffs are not rendered by default.

requirements-pants.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ciso8601
1313
cryptography
1414
editor
1515
eventlet
16-
# flex parses the openapi 2 spec in our router
17-
flex
16+
# openapi-spec-validator parses the openapi 2 spec in our router
17+
openapi-spec-validator
1818
# gitpython & gitdb are used for pack management
1919
gitdb
2020
gitpython

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ decorator==5.2.1
1919
dnspython
2020
editor==1.6.6
2121
eventlet==0.39.1
22-
flex==6.14.1
2322
gitdb==4.0.12
2423
gitpython==3.1.45
2524
greenlet==3.1.1
2625
gunicorn==23.0.0
27-
importlib-metadata==8.5.0
26+
importlib-metadata
27+
importlib_resources==6.5.2
2828
jinja2==3.1.6
2929
jsonpath-rw==1.4.0
3030
jsonschema==4.17.3
@@ -34,6 +34,7 @@ logshipper@ git+https://github.com/StackStorm/logshipper.git ; platform_system==
3434
mock==5.2.0
3535
mongoengine==0.29.1
3636
networkx==3.1
37+
openapi-spec-validator==0.5.7
3738
orjson==3.10.15
3839
orquesta@ git+https://github.com/StackStorm/orquesta.git@updates_st2v3.10
3940
oslo.config==9.6.0

st2client/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cffi==1.17.1
1010
chardet==5.2.0
1111
cryptography==43.0.3
1212
editor==1.6.6
13-
importlib-metadata==8.5.0
13+
importlib-metadata
1414
jsonpath-rw==1.4.0
1515
jsonschema==4.17.3
1616
orjson==3.10.15

st2common/in-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jinja2
99
jsonschema
1010
kombu
1111
mongoengine
12+
importlib_resources
1213
networkx
1314
# used by networkx
1415
decorator
@@ -40,7 +41,7 @@ zake
4041
# default coordinator backend configured for tooz
4142
redis
4243
routes
43-
flex
44+
openapi-spec-validator
4445
webob
4546
jsonpath-rw
4647
pyOpenSSL

st2common/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ cryptography==43.0.3
1515
decorator==5.2.1
1616
dnspython
1717
eventlet==0.39.1
18-
flex==6.14.1
1918
gitdb==4.0.12
2019
gitpython==3.1.45
2120
greenlet==3.1.1
21+
importlib_resources==6.5.2
2222
jinja2==3.1.6
2323
jsonpath-rw==1.4.0
2424
jsonschema==4.17.3
2525
kombu==5.5.4
2626
lockfile==0.12.2
2727
mongoengine==0.29.1
2828
networkx==3.1
29+
openapi-spec-validator==0.5.7
2930
orjson==3.10.15
3031
orquesta@ git+https://github.com/StackStorm/orquesta.git@updates_st2v3.10
3132
oslo.config==9.6.0

st2common/st2common/router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import copy
2323
import traceback
2424

25-
from flex.core import validate
25+
from openapi_spec_validator import validate_spec
2626
import jsonschema
2727
from oslo_config import cfg
2828
import routes
@@ -238,7 +238,7 @@ def add_spec(self, spec, transforms):
238238
self.spec = spec
239239
self.spec_resolver = jsonschema.RefResolver("", self.spec)
240240

241-
validate(fast_deepcopy_dict(self.spec))
241+
validate_spec(fast_deepcopy_dict(self.spec))
242242

243243
for filter in transforms:
244244
for (path, methods) in six.iteritems(spec["paths"]):

0 commit comments

Comments
 (0)