Skip to content

Commit

Permalink
Fix failing python tests
Browse files Browse the repository at this point in the history
The requests module 1.2.3 is no longer compatible with python >=3.10.0.
So, instead use 2.26.0, the most recent version that is compatible with
our supported python versions at the time of this commit.
  • Loading branch information
aeisenberg committed Oct 14, 2021
1 parent 1ebb0a0 commit 3df2172
Show file tree
Hide file tree
Showing 19 changed files with 343 additions and 44 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/python-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Initialize CodeQL
uses: ./init
with:
Expand Down
4 changes: 2 additions & 2 deletions python-setup/tests/check_requests_123.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ $env:PYTHONPATH=$FOUND_PYTHONPATH

$INSTALLED_REQUESTS_VERSION = (py -3 -c "import requests; print(requests.__version__)")

$EXPECTED_REQUESTS="1.2.3"
$EXPECTED_REQUESTS="2.26.0"

if ($INSTALLED_REQUESTS_VERSION -ne $EXPECTED_REQUESTS) {
write-host "Using $FOUND_PYTHONPATH as PYTHONPATH, we found version $INSTALLED_REQUESTS_VERSION of requests, but expected $EXPECTED_REQUESTS"
exit 1
} else {
write-host "Using $FOUND_PYTHONPATH as PYTHONPATH, we found version $INSTALLED_REQUESTS_VERSION of requests, which was expected"
}
}
4 changes: 2 additions & 2 deletions python-setup/tests/check_requests_123.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ PYTHON_EXE="python${EXPECTED_VERSION}"

INSTALLED_REQUESTS_VERSION=$(PYTHONPATH="${FOUND_PYTHONPATH}" "${PYTHON_EXE}" -c 'import requests; print(requests.__version__)')

EXPECTED_REQUESTS="1.2.3"
EXPECTED_REQUESTS="2.26.0"

if [[ "$INSTALLED_REQUESTS_VERSION" != "$EXPECTED_REQUESTS" ]]; then
echo "Using ${FOUND_PYTHONPATH} as PYTHONPATH, we found version $INSTALLED_REQUESTS_VERSION of requests, but expected $EXPECTED_REQUESTS"
exit 1
else
echo "Using ${FOUND_PYTHONPATH} as PYTHONPATH, we found version $INSTALLED_REQUESTS_VERSION of requests, which was expected"
fi
fi
2 changes: 1 addition & 1 deletion python-setup/tests/pipenv/python-3.8/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ verify_ssl = true
[dev-packages]

[packages]
requests = "*"
requests = "2.26.0"

[requires]
python_version = "3.8"
38 changes: 35 additions & 3 deletions python-setup/tests/pipenv/python-3.8/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python-setup/tests/pipenv/requests-2/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ verify_ssl = true
[dev-packages]

[packages]
requests = "*"
requests = "2.26.0"

[requires]
python_version = "2.7"
38 changes: 35 additions & 3 deletions python-setup/tests/pipenv/requests-2/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python-setup/tests/pipenv/requests-3/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ verify_ssl = true
[dev-packages]

[packages]
requests = "*"
requests = "2.26.0"

[requires]
42 changes: 36 additions & 6 deletions python-setup/tests/pipenv/requests-3/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 73 additions & 5 deletions python-setup/tests/poetry/python-3.8/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python-setup/tests/poetry/python-3.8/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.8"
requests = "*"
requests = "2.26.0"

[tool.poetry.dev-dependencies]

Expand Down

0 comments on commit 3df2172

Please sign in to comment.