Skip to content

Commit

Permalink
Work around importing the deprecated the imp module in Verify TLS c…
Browse files Browse the repository at this point in the history
…onfiguration (#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: Landon James <lnj@amazon.com>
  • Loading branch information
ysaito1001 and landonxjames authored Feb 3, 2025
1 parent 5e965d9 commit 5ed776f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/ci-tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tools/ci-scripts/configure-tls/configure-trytls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ed776f

Please sign in to comment.