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

Test older versions of pandas, torch #2682

Merged
merged 17 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 15 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
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 Python Dependencies
isabelizimm marked this conversation as resolved.
Show resolved Hide resolved
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
17 changes: 17 additions & 0 deletions extensions/positron-python/noxfile-positron.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright (C) 2024 Posit Software, PBC. All rights reserved.
#


import nox


@nox.session()
@nox.parametrize('pandas', ['1.5.3'])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sort of prefer to have the desired matrix here, and then always run in CI:

yarn positron:testMinimumPythonReqs

but we can also list latest as a version and use

yarn positron:testMinimumPythonReqs --session "tests(torch='1.12.1', pandas='1.5.3')"

@nox.parametrize('torch', ['1.12.1'])
def tests(session, pandas, torch):
isabelizimm marked this conversation as resolved.
Show resolved Hide resolved
session.install("-r", "python_files/positron/pinned-test-requirements.txt")
session.install('--force-reinstall', f'pandas=={pandas}')
isabelizimm marked this conversation as resolved.
Show resolved Hide resolved
session.install('--force-reinstall', f'torch=={torch}')

session.run('pytest', 'python_files/positron/positron_ipykernel/tests')
9 changes: 5 additions & 4 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 @@ -1604,6 +1604,7 @@
"testPerformance": "node ./out/test/testBootstrap.js ./out/test/performanceTest.js",
"testSmoke": "cross-env INSTALL_JUPYTER_EXTENSION=true \"node ./out/test/smokeTest.js\"",
"testInsiders": "cross-env VSC_PYTHON_CI_TEST_VSC_CHANNEL=insiders INSTALL_PYLANCE_EXTENSION=true TEST_FILES_SUFFIX=insiders.test CODE_TESTS_WORKSPACE=src/testMultiRootWkspc/smokeTests \"node ./out/test/standardTest.js\"",
"positron:testMinimumPythonReqs": "nox --noxfile noxfile-positron.py -- python_files/positron",
isabelizimm marked this conversation as resolved.
Show resolved Hide resolved
"lint-staged": "node gulpfile.js",
"lint": "eslint --ext .ts,.js src build pythonExtensionApi",
"lint-fix": "eslint --fix --ext .ts,.js src build pythonExtensionApi gulpfile.js",
Expand Down

This file was deleted.

Loading