Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{Pylint} Fix unnecessary-dunder-call #30365

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

Conversation

bebound
Copy link
Contributor

@bebound bebound commented Nov 15, 2024

Fix this with ruff check . --select PLC2801 --fix --preview --unsafe-fixes

unnecessary-dunder-call was disabled in #26685

Ref:
https://pylint.readthedocs.io/en/stable/user_guide/messages/convention/unnecessary-dunder-call.html
https://docs.astral.sh/ruff/rules/unnecessary-dunder-call/

Copy link

azure-client-tools-bot-prd bot commented Nov 15, 2024

❌AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
❌containerapp
❌latest
❌3.12
Type Test Case Error Message Line
Failed test_load_cert_file file_path = '/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/data/cert2.pfx'
cert_password = 'test12'

    def load_cert_file(file_path, cert_password=None):
        from base64 import b64encode
        from OpenSSL import crypto
        from cryptography.hazmat.primitives.serialization import pkcs12
        from cryptography.hazmat.primitives import hashes
        import os
    
        cert_data = None
        thumbprint = None
        blob = None
        try:
            with open(file_path, "rb") as f:
                if os.path.splitext(file_path)[1] in ['.pem']:
                    cert_data = f.read()
                    x509 = crypto.load_certificate(crypto.FILETYPE_PEM, cert_data)
                    digest_algorithm = 'sha256'
                    thumbprint = x509.digest(digest_algorithm).decode("utf-8").replace(':', '')
                    blob = b64encode(cert_data).decode("utf-8")
                elif os.path.splitext(file_path)[1] in ['.pfx']:
                    cert_data = f.read()
                    try:
                        # The password to use to decrypt the data. None if the PKCS12 is not encrypted.
                        cert_password_bytes = cert_password.encode('utf-8') if cert_password else None
>                       p12 = pkcs12.load_pkcs12(cert_data, cert_password_bytes)
E                       ValueError: Invalid password or PKCS12 data

src/azure-cli/azure/cli/command_modules/containerapp/utils.py:1484: ValueError

The above exception was the direct cause of the following exception:

file_path = '/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/data/cert2.pfx'
cert_password = 'test12'

    def load_cert_file(file_path, cert_password=None):
        from base64 import b64encode
        from OpenSSL import crypto
        from cryptography.hazmat.primitives.serialization import pkcs12
        from cryptography.hazmat.primitives import hashes
        import os
    
        cert_data = None
        thumbprint = None
        blob = None
        try:
            with open(file_path, "rb") as f:
                if os.path.splitext(file_path)[1] in ['.pem']:
                    cert_data = f.read()
                    x509 = crypto.load_certificate(crypto.FILETYPE_PEM, cert_data)
                    digest_algorithm = 'sha256'
                    thumbprint = x509.digest(digest_algorithm).decode("utf-8").replace(':', '')
                    blob = b64encode(cert_data).decode("utf-8")
                elif os.path.splitext(file_path)[1] in ['.pfx']:
                    cert_data = f.read()
                    try:
                        # The password to use to decrypt the data. None if the PKCS12 is not encrypted.
                        cert_password_bytes = cert_password.encode('utf-8') if cert_password else None
                        p12 = pkcs12.load_pkcs12(cert_data, cert_password_bytes)
                    except Exception as e:
>                       raise FileOperationError('Failed to load the certificate file. This may be due to an incorrect or missing password. Please double check and try again.\nError: {}'.format(e)) from e
E                       azure.cli.core.azclierror.FileOperationError: Failed to load the certificate file. This may be due to an incorrect or missing password. Please double check and try again.
E                       Error: Invalid password or PKCS12 data

src/azure-cli/azure/cli/command_modules/containerapp/utils.py:1486: FileOperationError

The above exception was the direct cause of the following exception:

self = <azure.cli.command_modules.containerapp.tests.latest.test_containerapp_utils.UtilsTest testMethod=test_load_cert_file>

    def test_load_cert_file(self):
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert.pfx')
        testpassword = 'test12'
        blob, thumbprint = load_cert_file(pfx_file, testpassword)
        self.assertEqual("8D2DC3BF7DF8D2BA32705E079A9C0015FE9CBC7062C8583FE19B7F068AFDC2C9", thumbprint)
    
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert2.pfx')
        testpassword = ''
        blob, thumbprint = load_cert_file(pfx_file, testpassword)
        self.assertEqual("346C37A6F29AB35063AC42A470CB2F95DB2A068E3E14A17E80A258BE9713E2BF", thumbprint)
    
        # test load with wrong password
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert2.pfx')
        testpassword = 'test12'
        thumbprint = ''
        try:
>           blob, thumbprint = load_cert_file(pfx_file, testpassword)

src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_utils.py:230: 
 
 
 
                                     

file_path = '/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/data/cert2.pfx'
cert_password = 'test12'

    def load_cert_file(file_path, cert_password=None):
        from base64 import b64encode
        from OpenSSL import crypto
        from cryptography.hazmat.primitives.serialization import pkcs12
        from cryptography.hazmat.primitives import hashes
        import os
    
        cert_data = None
        thumbprint = None
        blob = None
        try:
            with open(file_path, "rb") as f:
                if os.path.splitext(file_path)[1] in ['.pem']:
                    cert_data = f.read()
                    x509 = crypto.load_certificate(crypto.FILETYPE_PEM, cert_data)
                    digest_algorithm = 'sha256'
                    thumbprint = x509.digest(digest_algorithm).decode("utf-8").replace(':', '')
                    blob = b64encode(cert_data).decode("utf-8")
                elif os.path.splitext(file_path)[1] in ['.pfx']:
                    cert_data = f.read()
                    try:
                        # The password to use to decrypt the data. None if the PKCS12 is not encrypted.
                        cert_password_bytes = cert_password.encode('utf-8') if cert_password else None
                        p12 = pkcs12.load_pkcs12(cert_data, cert_password_bytes)
                    except Exception as e:
                        raise FileOperationError('Failed to load the certificate file. This may be due to an incorrect or missing password. Please double check and try again.\nError: {}'.format(e)) from e
                    if p12.cert is None:
                        raise ValidationError("Failed to load the certificate file. The loading result is None.")
                    x509 = p12.cert.certificate
                    thumbprint = x509.fingerprint(hashes.SHA256()).hex().upper()
                    blob = b64encode(cert_data).decode("utf-8")
                else:
                    raise FileOperationError('Not a valid file type. Only .PFX and .PEM files are supported.')
        except Exception as e:
>           raise CLIInternalError(e) from e
E           azure.cli.core.azclierror.CLIInternalError: Failed to load the certificate file. This may be due to an incorrect or missing password. Please double check and try again.
E           Error: Invalid password or PKCS12 data

src/azure-cli/azure/cli/command_modules/containerapp/_utils.py:1495: CLIInternalError

During handling of the above exception, another exception occurred:

self = <azure.cli.command_modules.containerapp.tests.latest.test_containerapp_utils.UtilsTest testMethod=test_load_cert_file>

    def test_load_cert_file(self):
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert.pfx')
        testpassword = 'test12'
        blob, thumbprint = load_cert_file(pfx_file, testpassword)
        self.assertEqual("8D2DC3BF7DF8D2BA32705E079A9C0015FE9CBC7062C8583FE19B7F068AFDC2C9", thumbprint)
    
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert2.pfx')
        testpassword = ''
        blob, thumbprint = load_cert_file(pfx_file, testpassword)
        self.assertEqual("346C37A6F29AB35063AC42A470CB2F95DB2A068E3E14A17E80A258BE9713E2BF", thumbprint)
    
        # test load with wrong password
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert2.pfx')
        testpassword = 'test12'
        thumbprint = ''
        try:
            blob, thumbprint = load_cert_file(pfx_file, testpassword)
        except CLIInternalError as e:
>           self.assertTrue(e.error_msg.error_msg in 'Invalid password or PKCS12 data')
E           AssertionError: False is not true

src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_utils.py:232: AssertionError
azure/cli/command_modules/containerapp/tests/latest/test_containerapp_utils.py:213
❌3.9
Type Test Case Error Message Line
Failed test_load_cert_file file_path = '/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/data/cert2.pfx'
cert_password = 'test12'

    def load_cert_file(file_path, cert_password=None):
        from base64 import b64encode
        from OpenSSL import crypto
        from cryptography.hazmat.primitives.serialization import pkcs12
        from cryptography.hazmat.primitives import hashes
        import os
    
        cert_data = None
        thumbprint = None
        blob = None
        try:
            with open(file_path, "rb") as f:
                if os.path.splitext(file_path)[1] in ['.pem']:
                    cert_data = f.read()
                    x509 = crypto.load_certificate(crypto.FILETYPE_PEM, cert_data)
                    digest_algorithm = 'sha256'
                    thumbprint = x509.digest(digest_algorithm).decode("utf-8").replace(':', '')
                    blob = b64encode(cert_data).decode("utf-8")
                elif os.path.splitext(file_path)[1] in ['.pfx']:
                    cert_data = f.read()
                    try:
                        # The password to use to decrypt the data. None if the PKCS12 is not encrypted.
                        cert_password_bytes = cert_password.encode('utf-8') if cert_password else None
>                       p12 = pkcs12.load_pkcs12(cert_data, cert_password_bytes)
E                       ValueError: Invalid password or PKCS12 data

src/azure-cli/azure/cli/command_modules/containerapp/utils.py:1484: ValueError

The above exception was the direct cause of the following exception:

file_path = '/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/data/cert2.pfx'
cert_password = 'test12'

    def load_cert_file(file_path, cert_password=None):
        from base64 import b64encode
        from OpenSSL import crypto
        from cryptography.hazmat.primitives.serialization import pkcs12
        from cryptography.hazmat.primitives import hashes
        import os
    
        cert_data = None
        thumbprint = None
        blob = None
        try:
            with open(file_path, "rb") as f:
                if os.path.splitext(file_path)[1] in ['.pem']:
                    cert_data = f.read()
                    x509 = crypto.load_certificate(crypto.FILETYPE_PEM, cert_data)
                    digest_algorithm = 'sha256'
                    thumbprint = x509.digest(digest_algorithm).decode("utf-8").replace(':', '')
                    blob = b64encode(cert_data).decode("utf-8")
                elif os.path.splitext(file_path)[1] in ['.pfx']:
                    cert_data = f.read()
                    try:
                        # The password to use to decrypt the data. None if the PKCS12 is not encrypted.
                        cert_password_bytes = cert_password.encode('utf-8') if cert_password else None
                        p12 = pkcs12.load_pkcs12(cert_data, cert_password_bytes)
                    except Exception as e:
>                       raise FileOperationError('Failed to load the certificate file. This may be due to an incorrect or missing password. Please double check and try again.\nError: {}'.format(e)) from e
E                       azure.cli.core.azclierror.FileOperationError: Failed to load the certificate file. This may be due to an incorrect or missing password. Please double check and try again.
E                       Error: Invalid password or PKCS12 data

src/azure-cli/azure/cli/command_modules/containerapp/utils.py:1486: FileOperationError

The above exception was the direct cause of the following exception:

self = <azure.cli.command_modules.containerapp.tests.latest.test_containerapp_utils.UtilsTest testMethod=test_load_cert_file>

    def test_load_cert_file(self):
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert.pfx')
        testpassword = 'test12'
        blob, thumbprint = load_cert_file(pfx_file, testpassword)
        self.assertEqual("8D2DC3BF7DF8D2BA32705E079A9C0015FE9CBC7062C8583FE19B7F068AFDC2C9", thumbprint)
    
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert2.pfx')
        testpassword = ''
        blob, thumbprint = load_cert_file(pfx_file, testpassword)
        self.assertEqual("346C37A6F29AB35063AC42A470CB2F95DB2A068E3E14A17E80A258BE9713E2BF", thumbprint)
    
        # test load with wrong password
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert2.pfx')
        testpassword = 'test12'
        thumbprint = ''
        try:
>           blob, thumbprint = load_cert_file(pfx_file, testpassword)

src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_utils.py:230: 
 
 
 
                                     

file_path = '/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/data/cert2.pfx'
cert_password = 'test12'

    def load_cert_file(file_path, cert_password=None):
        from base64 import b64encode
        from OpenSSL import crypto
        from cryptography.hazmat.primitives.serialization import pkcs12
        from cryptography.hazmat.primitives import hashes
        import os
    
        cert_data = None
        thumbprint = None
        blob = None
        try:
            with open(file_path, "rb") as f:
                if os.path.splitext(file_path)[1] in ['.pem']:
                    cert_data = f.read()
                    x509 = crypto.load_certificate(crypto.FILETYPE_PEM, cert_data)
                    digest_algorithm = 'sha256'
                    thumbprint = x509.digest(digest_algorithm).decode("utf-8").replace(':', '')
                    blob = b64encode(cert_data).decode("utf-8")
                elif os.path.splitext(file_path)[1] in ['.pfx']:
                    cert_data = f.read()
                    try:
                        # The password to use to decrypt the data. None if the PKCS12 is not encrypted.
                        cert_password_bytes = cert_password.encode('utf-8') if cert_password else None
                        p12 = pkcs12.load_pkcs12(cert_data, cert_password_bytes)
                    except Exception as e:
                        raise FileOperationError('Failed to load the certificate file. This may be due to an incorrect or missing password. Please double check and try again.\nError: {}'.format(e)) from e
                    if p12.cert is None:
                        raise ValidationError("Failed to load the certificate file. The loading result is None.")
                    x509 = p12.cert.certificate
                    thumbprint = x509.fingerprint(hashes.SHA256()).hex().upper()
                    blob = b64encode(cert_data).decode("utf-8")
                else:
                    raise FileOperationError('Not a valid file type. Only .PFX and .PEM files are supported.')
        except Exception as e:
>           raise CLIInternalError(e) from e
E           azure.cli.core.azclierror.CLIInternalError: Failed to load the certificate file. This may be due to an incorrect or missing password. Please double check and try again.
E           Error: Invalid password or PKCS12 data

src/azure-cli/azure/cli/command_modules/containerapp/_utils.py:1495: CLIInternalError

During handling of the above exception, another exception occurred:

self = <azure.cli.command_modules.containerapp.tests.latest.test_containerapp_utils.UtilsTest testMethod=test_load_cert_file>

    def test_load_cert_file(self):
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert.pfx')
        testpassword = 'test12'
        blob, thumbprint = load_cert_file(pfx_file, testpassword)
        self.assertEqual("8D2DC3BF7DF8D2BA32705E079A9C0015FE9CBC7062C8583FE19B7F068AFDC2C9", thumbprint)
    
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert2.pfx')
        testpassword = ''
        blob, thumbprint = load_cert_file(pfx_file, testpassword)
        self.assertEqual("346C37A6F29AB35063AC42A470CB2F95DB2A068E3E14A17E80A258BE9713E2BF", thumbprint)
    
        # test load with wrong password
        pfx_file = os.path.join(TEST_DIR, 'data', 'cert2.pfx')
        testpassword = 'test12'
        thumbprint = ''
        try:
            blob, thumbprint = load_cert_file(pfx_file, testpassword)
        except CLIInternalError as e:
>           self.assertTrue(e.error_msg.error_msg in 'Invalid password or PKCS12 data')
E           AssertionError: False is not true

src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerapp_utils.py:232: AssertionError
azure/cli/command_modules/containerapp/tests/latest/test_containerapp_utils.py:213
️✔️core
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9

Copy link

azure-client-tools-bot-prd bot commented Nov 15, 2024

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 15, 2024

Pylint

@@ -229,7 +229,7 @@ def test_load_cert_file(self):
try:
blob, thumbprint = load_cert_file(pfx_file, testpassword)
except CLIInternalError as e:
self.assertTrue(e.error_msg.error_msg.__contains__('Invalid password or PKCS12 data'))
self.assertTrue(e.error_msg.error_msg in 'Invalid password or PKCS12 data')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use assertIn

@@ -63,7 +63,7 @@ def _validate_deployment_name_with_template_specs(namespace):
namespace.template_spec = namespace.template_spec.strip("\"")
if not is_valid_resource_id(namespace.template_spec):
raise CLIError('--template-spec is not a valid resource ID.')
if namespace.template_spec.__contains__("versions") is False:
if (namespace.template_spec in "versions") is False:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check all code later. Some codes are so werid...

Copy link
Contributor Author

@bebound bebound Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are also reversed, it should be "versions" in namespace.template_spec.

Reported to astral-sh/ruff#14423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants