From 47dbf0b9f1441c1f57e57f1bbeebb1bfc4a495db Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 21 Oct 2022 18:01:56 -0400 Subject: [PATCH] attempt to workaround downstream package testing situation (#7725) * attempt to workaround downstream package testing situation --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29484ad90249..cbeee6969256 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -492,6 +492,23 @@ jobs: - run: pip install . env: CARGO_TARGET_DIR: ${{ format('{0}/src/rust/target/', github.workspace) }} + # cryptography main has a version of "(X+1).0.0.dev1" where X is the + # most recently released major version. A package used by a downstream + # may depend on cryptography <=X. If you use entrypoints stuff, this can + # lead to runtime errors due to version incompatibilities. Rename the + # dist-info directory to pretend to be an older version to "solve" this. + - run: | + import json + import pkg_resources + import shutil + import urllib.request + + d = pkg_resources.get_distribution("cryptography") + with urllib.request.urlopen("https://pypi.org/pypi/cryptography/json") as r: + latest_version = json.load(r)["info"]["version"] + new_path = d.egg_info.replace(d.version, latest_version) + shutil.move(d.egg_info, new_path) + shell: python - run: ./.github/downstream.d/${{ matrix.DOWNSTREAM }}.sh run docs-linkcheck: