Skip to content

Commit

Permalink
fix: python selection, werkzeug compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
therightstuff committed Oct 2, 2023
1 parent 21b3e0e commit 0e7548b
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ def list_integration_tests_ci(session):
)
def integration_tests_boto3_sqs(
session,
python,
boto3_version,
):
python = session.python
with TestedVersions.save_tests_result("boto3-sqs", python, "boto3", boto3_version):
install_package("boto3", boto3_version, session)

Expand Down Expand Up @@ -249,9 +249,9 @@ def integration_tests_boto3_sqs(
)
def integration_tests_boto3(
session,
python,
boto3_version,
):
python = session.python
with TestedVersions.save_tests_result("boto3", python, "boto3", boto3_version):
install_package("boto3", boto3_version, session)

Expand Down Expand Up @@ -307,9 +307,9 @@ def integration_tests_boto3(
)
def integration_tests_fastapi_fastapi(
session,
python,
fastapi_version,
):
python = session.python
with TestedVersions.save_tests_result(
"fastapi", python, "fastapi", fastapi_version
):
Expand All @@ -335,9 +335,9 @@ def integration_tests_fastapi_fastapi(
)
def integration_tests_fastapi_uvicorn(
session,
python,
uvicorn_version,
):
python = session.python
with TestedVersions.save_tests_result(
"fastapi", python, "uvicorn", uvicorn_version
):
Expand Down Expand Up @@ -509,7 +509,8 @@ def component_tests_execution_tags(
)
],
)
def integration_tests_django(session, python, django_version):
def integration_tests_django(session, django_version):
python = session.python
with TestedVersions.save_tests_result("django", python, "django", django_version):
install_package("django", django_version, session)

Expand Down Expand Up @@ -561,7 +562,8 @@ def integration_tests_django(session, python, django_version):
)
],
)
def integration_tests_flask(session, python, flask_version):
def integration_tests_flask(session, flask_version):
python = session.python
with TestedVersions.save_tests_result("flask", python, "flask", flask_version):
install_package("flask", flask_version, session)

Expand All @@ -571,6 +573,13 @@ def integration_tests_flask(session, python, flask_version):
with session.chdir("src/test/integration/flask"):
session.install("-r", OTHER_REQUIREMENTS)

# override the default Werkzeug version for flask v2 compatibility
if flask_version.startswith("2."):
if python == "3.7":
session.install("werkzeug==2.2.3")
else:
session.install("werkzeug==2.3.7")

try:
session.run(
"sh",
Expand Down Expand Up @@ -616,9 +625,9 @@ def integration_tests_flask(session, python, flask_version):
)
def integration_tests_grpcio(
session,
python,
grpcio_version,
):
python = session.python
with TestedVersions.save_tests_result("grpcio", python, "grpcio", grpcio_version):
install_package("grpcio", grpcio_version, session)

Expand Down Expand Up @@ -688,9 +697,9 @@ def integration_tests_grpcio(
)
def integration_tests_kafka_python(
session,
python,
kafka_python_version,
):
python = session.python
with TestedVersions.save_tests_result(
"kafka_python", python, "kafka_python", kafka_python_version
):
Expand Down Expand Up @@ -751,9 +760,9 @@ def integration_tests_kafka_python(
)
def integration_tests_motor(
session,
python,
motor_version,
):
python = session.python
with TestedVersions.save_tests_result("motor", python, "motor", motor_version):
install_package("motor", motor_version, session)

Expand Down Expand Up @@ -794,9 +803,9 @@ def integration_tests_motor(
)
def integration_tests_pika(
session,
python,
pika_version,
):
python = session.python
with TestedVersions.save_tests_result("pika", python, "pika", pika_version):
install_package("pika", pika_version, session)

Expand Down Expand Up @@ -856,10 +865,10 @@ def integration_tests_pika(
)
def integration_tests_psycopg2(
session,
python,
dependency_name,
psycopg2_version,
):
python = session.python
with TestedVersions.save_tests_result(
"psycopg2",
python,
Expand Down Expand Up @@ -906,9 +915,9 @@ def integration_tests_psycopg2(
)
def integration_tests_pymongo(
session,
python,
pymongo_version,
):
python = session.python
with TestedVersions.save_tests_result(
"pymongo", python, "pymongo", pymongo_version
):
Expand Down Expand Up @@ -982,9 +991,9 @@ def integration_tests_pymongo(
)
def integration_tests_pymysql(
session,
python,
pymysql_version,
):
python = session.python
with TestedVersions.save_tests_result(
"pymysql", python, "pymysql", pymysql_version
):
Expand Down Expand Up @@ -1041,9 +1050,9 @@ def integration_tests_pymysql(
)
def integration_tests_redis(
session,
python,
redis_version,
):
python = session.python
with TestedVersions.save_tests_result("redis", python, "redis", redis_version):
install_package("redis", redis_version, session)

Expand Down

0 comments on commit 0e7548b

Please sign in to comment.