diff --git a/.github/workflows/positron-python-ci.yml b/.github/workflows/positron-python-ci.yml index 052ab0e3f9a..e537a181346 100644 --- a/.github/workflows/positron-python-ci.yml +++ b/.github/workflows/positron-python-ci.yml @@ -199,7 +199,7 @@ jobs: python: '3.12' older-versions: false - os: 'ubuntu-latest' - python: '3.8' + python: '3.9' older-versions: true steps: @@ -220,10 +220,7 @@ jobs: - name: Install minimum supported versions if: ${{ matrix.older-versions }} - 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 --no-deps -r pythonFiles/positron/min-supported.txt + run: python -m pip install --no-deps -r pythonFiles/positron/min-supported.txt - name: Run Positron IPyKernel unit tests run: pytest pythonFiles/positron diff --git a/extensions/positron-python/gulpfile.js b/extensions/positron-python/gulpfile.js index 4950eeb0af9..f5b1f0a23be 100644 --- a/extensions/positron-python/gulpfile.js +++ b/extensions/positron-python/gulpfile.js @@ -386,6 +386,37 @@ function spawnAsync(command, args, env, rejectOnStdErr = false) { proc.on('error', (error) => reject(error)); }); } + +gulp.task('minSupportedPythonRequirements', async (done) => { + const pipArgs = [ + '-m', + 'pip', + 'install', + '--no-deps', + '-r', + './pythonFiles/positron/min-supported.txt', + ]; + const pytestArgs = [ + '-m', + 'pytest', + 'pythonFiles/positron' + ] + // install requirements + await spawnAsync(pythonCommand, pipArgs) + .then(() => true) + .catch((ex) => { + const msg = "Failed to install requirements using 'pip'"; + fancyLog.error(ansiColors.red(`error`), msg, ex); + done(new Error(msg)); + }); + + // run the tests + await spawnAsync(pythonCommand, pytestArgs).catch((ex) => { + const msg = 'Tests failed for command python3 -m pytest pythonFiles/positron'; + fancyLog.error(ansiColors.red(`error`), msg, ex); + done(new Error(msg)); + }); +}); // --- End Positron --- function hasNativeDependencies() { diff --git a/extensions/positron-python/package.json b/extensions/positron-python/package.json index 83845e7920e..8a68fe06e3f 100644 --- a/extensions/positron-python/package.json +++ b/extensions/positron-python/package.json @@ -1609,6 +1609,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\"", + "testMinimumPython": "gulp minSupportedPythonRequirements", "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", @@ -1737,4 +1738,4 @@ "extensionDependencies": [ "vscode.jupyter-adapter" ] -} \ No newline at end of file +}