Skip to content

Auto activate venv when python-version is set #473

Auto activate venv when python-version is set

Auto activate venv when python-version is set #473

Workflow file for this run

name: "test-windows"
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-default-version:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Should not be on path
run: |
if (!(Get-Command -Name "uv" -ErrorAction SilentlyContinue)) {
exit 0
} else {
exit 1
}
- name: Setup uv
uses: ./
- run: uv sync
working-directory: __tests__\fixtures\uv-project
test-python-version:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install latest version
uses: ./
with:
python-version: 3.13.1t
- name: Verify UV_PYTHON is set to correct version
run: |
Write-Output "$env:UV_PYTHON"
if ($env:UV_PYTHON -ne "3.13.1t") {
exit 1
}
shell: pwsh
- name: Verify packages can be installed
run: uv pip install --python=3.13.1t pip
shell: pwsh
- name: Verify python version is correct
run: |
$pythonVersion = python --version
if ($pythonVersion -ne "Python 3.13.1") {
exit 1
}
shell: pwsh