Skip to content

Commit

Permalink
Test older versions of pandas, torch (#2682)
Browse files Browse the repository at this point in the history
* test pandas, torch 1.X

* add yarn command testMinimumPythonReqs

* use torch 1.12 to avoid libcublas errors

* update jobs

* Update extensions/positron-python/package.json

Co-authored-by: Wasim Lorgat <[email protected]>
Signed-off-by: Isabel Zimmerman <[email protected]>

* try out noxfile

* install nox into ci

* rearrange nox call

* split into own action

* vendor

* only run 1x rather than 4x

* Delete min-supported.txt

Signed-off-by: Isabel Zimmerman <[email protected]>

* min matrix

* Update .github/workflows/positron-python-ci.yml

Co-authored-by: Wasim Lorgat <[email protected]>
Signed-off-by: Isabel Zimmerman <[email protected]>

* updates from review

---------

Signed-off-by: Isabel Zimmerman <[email protected]>
Co-authored-by: Wasim Lorgat <[email protected]>
  • Loading branch information
isabelizimm and seeM authored Apr 10, 2024
1 parent 9815efe commit 5b253a2
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 40 deletions.
54 changes: 26 additions & 28 deletions .github/workflows/positron-python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,31 +180,14 @@ jobs:
include:
- os: 'ubuntu-latest'
python: '3.8'
time-elapsed: ''
- os: 'macos-latest'
python: '3.9'
time-elapsed: ''
- os: 'windows-latest'
python: '3.10'
time-elapsed: ''
- os: 'ubuntu-latest'
python: '3.11'
time-elapsed: ''
- os: 'ubuntu-latest'
python: '3.12'
time-elapsed: ''
# - os: 'ubuntu-latest'
# python: '3.10'
# time-elapsed: '3 months'
# - os: 'ubuntu-latest'
# python: '3.10'
# time-elapsed: '6 months'
# - os: 'ubuntu-latest'
# python: '3.10'
# time-elapsed: '9 months'
# - os: 'ubuntu-latest'
# python: '3.10'
# time-elapsed: '1 year'

steps:
- name: Checkout
Expand All @@ -222,20 +205,35 @@ jobs:
- name: Install Positron IPyKernel test requirements
run: python -m pip install --prefer-binary --upgrade -r python_files/positron/pinned-test-requirements.txt

- name: Get date for older dependencies
if: ${{ matrix.time-elapsed != '' }}
run: |
echo "SNAPSHOT_DATE=$(date -d '-${{ matrix.time-elapsed }}' --iso-8601)" >> $GITHUB_ENV
- name: Run Positron IPyKernel unit tests
run: pytest python_files/positron

python-minimum-dependencies:
name: Test Minimum Positron IPyKernel Dependencies
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# currently only running on oldest supported Python version
- os: 'ubuntu-latest'
python: '3.8'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'

- name: Get older PyPI snapshot
if: ${{ matrix.time-elapsed != '' }}
- name: Install testing requirements
run: |
python -m pip config set global.index-url https://packagemanager.posit.co/pypi/${{ env.SNAPSHOT_DATE }}/simple
python -m pip config set global.trusted-host packagemanager.posit.co
python -m pip install --prefer-binary --force-reinstall -r python_files/positron/data-science-requirements.txt
python scripts/vendor.py
python -m pip install nox
- name: Run Positron IPyKernel unit tests
run: pytest python_files/positron
- name: Run tests
run: yarn positron:testMinimumPythonReqs

typescript-tests:
name: Test TypeScript
Expand Down
22 changes: 22 additions & 0 deletions extensions/positron-python/noxfile-positron.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (C) 2024 Posit Software, PBC. All rights reserved.
#


import nox


@nox.session()
@nox.parametrize('pandas', ['1.5.3'])
@nox.parametrize('torch', ['1.12.1'])
def test_minimum_reqs(session, pandas, torch):
session.install("-r", "python_files/positron/pinned-test-requirements.txt")
session.install('--force-reinstall', f'pandas=={pandas}')
session.install('--force-reinstall', f'torch=={torch}')

if session.posargs:
test_args = session.posargs
else:
test_args = []

session.run('pytest', *test_args)
11 changes: 6 additions & 5 deletions extensions/positron-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1265,10 +1265,10 @@
],
"menus": {
"issue/reporter": [
{
"command": "python.reportIssue"
}
],
{
"command": "python.reportIssue"
}
],
"commandPalette": [
{
"category": "Python",
Expand Down Expand Up @@ -1613,7 +1613,8 @@
"addExtensionPackDependencies": "gulp addExtensionPackDependencies",
"updateBuildNumber": "gulp updateBuildNumber",
"verifyBundle": "gulp verifyBundle",
"webpack": "webpack"
"webpack": "webpack",
"positron:testMinimumPythonReqs": "nox --noxfile noxfile-positron.py -- python_files/positron"
},
"dependencies": {
"@iarna/toml": "^2.2.5",
Expand Down

This file was deleted.

0 comments on commit 5b253a2

Please sign in to comment.