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

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

Merged
merged 16 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading