Unverified Commit 5ed776ff authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Work around importing the deprecated the `imp` module in Verify TLS configuration (#3978)



## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

## Description
<!--- Describe your changes in detail -->

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] For changes to the smithy-rs codegen or runtime crates, I have
created a changelog entry Markdown file in the `.changelog` directory,
specifying "client," "server," or both in the `applies_to` key.
- [ ] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: default avatarLandon James <lnj@amazon.com>
parent 5e965d9e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -19,7 +19,10 @@ on:
jobs:
  verify-tls-config:
    name: Verify TLS configuration
    runs-on: ubuntu-latest
    # TODO: GH runners recently bumped the default Ubuntu version to 24.x, this comes with an upgraded OpenSSL
    # version that causes the python oscrypto package to throw an error: https://github.com/wbond/oscrypto/issues/78
    # Until that package is updated we are pinning the version here.
    runs-on: ubuntu-22.04
    timeout-minutes: 20
    steps:
    - name: Install packages
+6 −0
Original line number Diff line number Diff line
@@ -7,6 +7,12 @@
set -euxo pipefail

perl -p -i -e 's!\./runners!runners!' setup.py

sed -i 's/^import imp$/import importlib/' setup.py
sed -i 's/^found = imp.find_module.*/sys.path.insert(0, os.path.join(os.path.dirname(__file__), "runners"))\
found = importlib.util.find_spec("trytls")/' setup.py
sed -i 's/^trytls = imp.load_module(\(.*\))$/trytls = importlib.util.module_from_spec(found)\nfound.loader.exec_module(trytls)/' setup.py

sed -i '/import platform/a import distro' runners/trytls/utils.py
sed -i 's/platform.linux_distribution()/distro.name(), distro.version(), distro.id()/' runners/trytls/utils.py
sed -i 's/break//' runners/trytls/bundles/https.py