tests: use source distribution of pycurl so that it supports more compression types

Cross-os binary distribution is EVIL!
This commit is contained in:
lilydjwg 2025-02-10 15:52:20 +08:00
parent 17e351f825
commit 6759d2f206
2 changed files with 8 additions and 6 deletions

View file

@ -42,11 +42,6 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.deps }}-
${{ runner.os }}-${{ env.cache-name }}-
- name: workaround pycurl wheel
if: ${{ contains(matrix.deps, 'pycurl') }}
run: |
sudo mkdir -p /etc/pki/tls/certs
sudo ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
- name: Install pycurl deps
if: ${{ contains(matrix.deps, 'pycurl') }}
@ -56,6 +51,14 @@ jobs:
# werkzeug is pinned for httpbin compatibility https://github.com/postmanlabs/httpbin/issues/673
- name: Install Python deps
run: pip install -U ${{ matrix.deps }} pytest 'pytest-asyncio>=0.24' pytest-httpbin pytest-rerunfailures structlog tomli platformdirs lxml jq 'werkzeug<2.1' awesomeversion
# don't use binary distribution because:
# hardcoded cacert path doesn't work on Ubuntu (should have been resolved?)
# limited compression support (only deflate & gzip)
- name: Install pycurl
if: ${{ contains(matrix.deps, 'pycurl') }}
run: |
pip uninstall -y pycurl
pip install -U pycurl --no-binary :all:
- name: Decrypt keys
env:
KEY: ${{ secrets.KEY }}

View file

@ -33,7 +33,6 @@ def setup_curl(curl):
if SSL_CERT_FILE:
curl.setopt_string(pycurl.CAINFO, SSL_CERT_FILE)
# some servers insist sending us compressed content
curl.setopt_string(pycurl.ACCEPT_ENCODING, "")
class TornadoSession(BaseSession):