diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index 697d41fbb..3f030c9f7 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -91,12 +91,11 @@ jobs: - run: ./pw uv sync --config-setting regenerate_docstubs=false - # using relative path for npm scripts because it needs to work in the package directories too - - name: add pyprojectx and npm scripts to PATH - + # ideally we would do the same thing with ./node_modules/.bin to ensure that the version of node from nodejs-wheel + # is always used, but it seems to be impossible to prevent github actions from using its own node version + - name: add pyprojectx to PATH run: | realpath ./.pyprojectx/main >> $GITHUB_PATH - echo ./node_modules/.bin >> $GITHUB_PATH # ideally this should be run with the rest of the pytest tests in the validation workflow, # but they depend on the docstubs generated in the previous job @@ -118,7 +117,7 @@ jobs: - name: set version for npm packages if: github.ref == 'refs/heads/main' - run: npm version ${{ steps.current-version.outputs.CURRENT_VERSION }} --workspaces --no-git-tag-version + run: uv run npm version ${{ steps.current-version.outputs.CURRENT_VERSION }} --workspaces --no-git-tag-version - name: Build VSIX working-directory: ${{ env.VSIX_DIR }} @@ -176,7 +175,7 @@ jobs: # i think to fix that i need to rewrite pdm_build.py to use the build hooks so we can control it more easily, but i can't get that to work soooo - name: set npm package versions back to upstream so pypi package can use it in --version output if: github.ref == 'refs/heads/main' - run: npm version ${{ steps.current-version.outputs.CURRENT_UPSTREAM_VERSION }} --workspaces --no-git-tag-version + run: uv run npm version ${{ steps.current-version.outputs.CURRENT_UPSTREAM_VERSION }} --workspaces --no-git-tag-version - name: build package - pypi run: uv build --config-setting regenerate_docstubs=false diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index bbf39c777..74555af64 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -57,26 +57,25 @@ jobs: - run: ./pw uv sync - # using relative path for npm scripts because it needs to work in the package directories too - - name: add pyprojectx and npm scripts to PATH (linux) + # ideally we would do the same thing with ./node_modules/.bin to ensure that the version of node from nodejs-wheel + # is always used, but it seems to be impossible to prevent github actions from using its own node version + - name: add pyprojectx to PATH (linux) if: runner.os != 'Windows' run: | realpath ./.pyprojectx/main >> $GITHUB_PATH - echo ./node_modules/.bin >> $GITHUB_PATH - - - name: add pyprojectx and npm scripts to PATH (windows) + - name: add pyprojectx to PATH (windows) if: runner.os == 'Windows' run: | echo (resolve-path "./.pyprojectx/main").path | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "./node_modules/.bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: python tests run: uv run npm run test-python -- -m "not needs_all_docstubs" - name: npm test (pyright-internal) - run: npm test + run: uv run npm test working-directory: packages/pyright-internal + # TODO: all tests run in a venv now so i dont think any of this stuff is needed anymore - name: Create Venv run: | ${{ steps.install_python.outputs.python-path }} -m venv .venv @@ -102,13 +101,13 @@ jobs: env: CI_IMPORT_TEST_VENVPATH: '../../' CI_IMPORT_TEST_VENV: '.venv' - run: npm run test:imports + run: uv run npm run test:imports working-directory: packages/pyright-internal - name: Run import tests with pythonpath env: CI_IMPORT_TEST_PYTHONPATH: ${{env.python_venv_path}} - run: npm run test:imports + run: uv run npm run test:imports working-directory: packages/pyright-internal required: diff --git a/packages/pyright-internal/src/tests/importResolver.test.ts b/packages/pyright-internal/src/tests/importResolver.test.ts index 932b40c87..9473b73bb 100644 --- a/packages/pyright-internal/src/tests/importResolver.test.ts +++ b/packages/pyright-internal/src/tests/importResolver.test.ts @@ -38,6 +38,7 @@ describe('Import tests with fake venv', () => { afterAll(() => tempFile.dispose()); if (!usingTrueVenv()) { + // TODO: investigate these tests. idk why it says they cant run in a venv because they seem to pass either way describe('Import tests that cannot run in a true venv', () => { test('partial stub file exists', () => { const files = [ diff --git a/packages/pyright-internal/src/tests/samples/typePrinter1.py b/packages/pyright-internal/src/tests/samples/typePrinter1.py index 33a729ed7..6519c09ac 100644 --- a/packages/pyright-internal/src/tests/samples/typePrinter1.py +++ b/packages/pyright-internal/src/tests/samples/typePrinter1.py @@ -19,7 +19,7 @@ def func1(v: A.Inner | None): def func2(v: A.Inner | B.Inner | None): - reveal_type(v, expected_text="typePrinter1.A.Inner | typePrinter1.B.Inner | None") + reveal_type(v, expected_text="packages.pyright-internal.src.tests.samples.typePrinter1.A.Inner | packages.pyright-internal.src.tests.samples.typePrinter1.B.Inner | None") class IntOrStr: