Skip to content

Commit

Permalink
Make SAML a required dependency of Amazon provider (apache#42137)
Browse files Browse the repository at this point in the history
Amazon provider with auth manager requires SAML onelogin import and
it starts to be more and more problematic to skip the related tests
for compatibility.

It seems appropriate to move saml to be a required dependency of
Amazon provider in this case.

Since saml is only used by Amazon provider, we can also safely
remove optional extra for it.
  • Loading branch information
potiuk authored Sep 10, 2024
1 parent 777a3a4 commit 841b066
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 17 deletions.
4 changes: 2 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ Those extras are available as regular core airflow extras - they install optiona
# START CORE EXTRAS HERE

aiobotocore, apache-atlas, apache-webhdfs, async, cgroups, cloudpickle, github-enterprise, google-
auth, graphviz, kerberos, ldap, leveldb, otel, pandas, password, rabbitmq, s3fs, saml, sentry,
statsd, uv, virtualenv
auth, graphviz, kerberos, ldap, leveldb, otel, pandas, password, rabbitmq, s3fs, sentry, statsd, uv,
virtualenv

# END CORE EXTRAS HERE

Expand Down
1 change: 1 addition & 0 deletions airflow/providers/papermill/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dependencies:
- ipykernel
- pandas>=2.1.2,<2.2;python_version>="3.9"
- pandas>=1.5.3,<2.2;python_version<"3.9"
- python3-saml>=1.16.0

integrations:
- integration-name: Papermill
Expand Down
4 changes: 2 additions & 2 deletions contributing-docs/12_airflow_dependencies_and_extras.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ Those extras are available as regular core airflow extras - they install optiona
.. START CORE EXTRAS HERE
aiobotocore, apache-atlas, apache-webhdfs, async, cgroups, cloudpickle, github-enterprise, google-
auth, graphviz, kerberos, ldap, leveldb, otel, pandas, password, rabbitmq, s3fs, saml, sentry,
statsd, uv, virtualenv
auth, graphviz, kerberos, ldap, leveldb, otel, pandas, password, rabbitmq, s3fs, sentry, statsd, uv,
virtualenv

.. END CORE EXTRAS HERE
Expand Down
1 change: 1 addition & 0 deletions generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@
"pandas>=1.5.3,<2.2;python_version<\"3.9\"",
"pandas>=2.1.2,<2.2;python_version>=\"3.9\"",
"papermill[all]>=2.6.0",
"python3-saml>=1.16.0",
"scrapbook[all]"
],
"devel-deps": [],
Expand Down
4 changes: 0 additions & 4 deletions hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@
# which can have a conflict with boto3 as mentioned in aiobotocore extra
"s3fs>=2023.10.0",
],
"saml": [
# This is required for support of SAML which might be used by some providers (e.g. Amazon)
"python3-saml>=1.16.0",
],
"sentry": [
"blinker>=1.1",
# Sentry SDK 1.33 is broken when greenlets are installed and fails to import
Expand Down
1 change: 1 addition & 0 deletions newsfragments/42137.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Optional ``[saml]`` extra has been removed from Airflow core - instead Amazon Provider gets saml as required dependency.
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ dynamic = ["version", "optional-dependencies", "dependencies"]
# START CORE EXTRAS HERE
#
# aiobotocore, apache-atlas, apache-webhdfs, async, cgroups, cloudpickle, github-enterprise, google-
# auth, graphviz, kerberos, ldap, leveldb, otel, pandas, password, rabbitmq, s3fs, saml, sentry,
# statsd, uv, virtualenv
# auth, graphviz, kerberos, ldap, leveldb, otel, pandas, password, rabbitmq, s3fs, sentry, statsd, uv,
# virtualenv
#
# END CORE EXTRAS HERE
#
Expand Down Expand Up @@ -387,7 +387,6 @@ combine-as-imports = true
"airflow/security/kerberos.py" = ["E402"]
"airflow/security/utils.py" = ["E402"]
"tests/providers/amazon/aws/auth_manager/security_manager/test_aws_security_manager_override.py" = ["E402"]
"tests/system/providers/amazon/aws/tests/test_aws_auth_manager.py" = ["E402"]
"tests/providers/common/io/xcom/test_backend.py" = ["E402"]
"tests/providers/elasticsearch/log/elasticmock/__init__.py" = ["E402"]
"tests/providers/elasticsearch/log/elasticmock/utilities/__init__.py" = ["E402"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class TestAwsSecurityManagerOverride:
"airflow.providers.amazon.aws.auth_manager.views.auth.conf.get_mandatory_value", return_value="test"
)
def test_register_views(self, mock_get_mandatory_value, override, appbuilder):
pytest.importorskip("onelogin")
from airflow.providers.amazon.aws.auth_manager.views.auth import AwsAuthManagerAuthenticationViews

with patch.object(AwsAuthManagerAuthenticationViews, "idp_data"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,6 @@ def test_get_cli_commands_return_cli_commands(self, auth_manager):
"airflow.providers.amazon.aws.auth_manager.views.auth.conf.get_mandatory_value", return_value="test"
)
def test_register_views(self, mock_get_mandatory_value, auth_manager_with_appbuilder):
pytest.importorskip("onelogin")
from airflow.providers.amazon.aws.auth_manager.views.auth import AwsAuthManagerAuthenticationViews

with patch.object(AwsAuthManagerAuthenticationViews, "idp_data"):
Expand Down
2 changes: 0 additions & 2 deletions tests/providers/amazon/aws/auth_manager/views/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
from tests.test_utils.compat import AIRFLOW_V_2_9_PLUS
from tests.test_utils.config import conf_vars

pytest.importorskip("onelogin")

pytestmark = [
pytest.mark.skipif(not AIRFLOW_V_2_9_PLUS, reason="Test requires Airflow 2.9+"),
pytest.mark.skip_if_database_isolation_mode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import boto3
import pytest

pytest.importorskip("onelogin")

from airflow.www import app as application
from tests.system.providers.amazon.aws.utils import set_env_id
from tests.test_utils.config import conf_vars
Expand Down

0 comments on commit 841b066

Please sign in to comment.