Skip to content

Error: running tox on Windows #270

@berthetclement

Description

@berthetclement

Hello !

Issue

I use a CI to use uv and tox with several OS :

name: tests+lint+type

on:
  push:
    branches: ["main"]
  pull_request:

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        # tox-env: ["py310", "py311", "py312"] => config used with tox.ini

      fail-fast: false

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          enable-cache: true
          python-version: ${{ runner.os == 'Windows' && '3.11' || null }}

      - name: Install tox + tox-uv
        run: uv tool install tox --with tox-uv

      - name: Install the project
        run: uv sync --locked --all-extras --dev

      - name: Run tox
        # use all env tox defined in tox.ini
        run: tox

With windows, i have to force version of Python (3.11):

- name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          enable-cache: true
          python-version: ${{ runner.os == 'Windows' && '3.11' || null }} 

I run this CI on a lib with minimal version of Python 3.11 and this version is specified in file .python-version (3.11).

Erro message from CI :

Using Python 3.9.13 environment at: .tox\type
type: exit 1 (0.16 seconds) D:\a\antares_data_collection\antares_data_collection> D:\a\_temp\uv-tool-dir\tox\Scripts\uv.exe pip install --reinstall --no-deps antares-data-collection@D:\a\antares_data_collection\antares_data_collection\.tox\.tmp\package\1\antares_data_collection-0.1.0.tar.gz pid=8484
  � No solution found when resolving dependencies:
  \u2570\u2500\u25b6 Because the current Python version (3.9.13) does not satisfy
      Python>=3.11 and antares-data-collection==0.1.0 depends on Python>=3.11,
      we can conclude that antares-data-collection==0.1.0 cannot be used.
      And because only antares-data-collection==0.1.0 is available and you
      require antares-data-collection, we can conclude that your requirements
      are unsatisfiable.
type: FAIL ! in 4.92 seconds

Log here [ci-log]https://github.com/AntaresSimulatorTeam/antares_data_collection/actions/runs/19537901087/job/55936414246#step:6:104)

Environment

  • OS :
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy

Output of pip list of the host Python, where tox is installed

From .venv in lib

uv pip list
Package                 Version           Editable project location
----------------------- ----------------- --------------------------------------------------------------------------
antares-data-collection 0.1.0             /home/berthetcle/Documents/Travail/Python/packages/antares_data_collection
coverage                7.11.3
iniconfig               2.3.0
mypy                    1.18.2
mypy-extensions         1.1.0
numpy                   2.3.5
packaging               25.0
pandas                  2.3.3
pandas-stubs            2.3.2.250926
pathspec                0.12.1
pluggy                  1.6.0
pygments                2.19.2
pytest                  9.0.1
pytest-cov              7.0.0
python-dateutil         2.9.0.post0
pytz                    2025.2
ruff                    0.14.5
six                     1.17.0
types-pytz              2025.2.0.20251108
typing-extensions       4.15.0
tzdata                  2025.2

From local machine :

 uv --version
uv 0.9.10

tox --version
4.32.0 from /home/berthetcle/.local/share/uv/tools/tox/lib/python3.11/site-packages/tox/__init__.py
registered plugins:
    tox-uv-1.29.0 at /home/berthetcle/.local/share/uv/tools/tox/lib/python3.11/site-packages/tox_uv/plugin.py with uv==0.9.10

Output of running tox

Output of tox -rvv

... I paste only resume, too much lines in ouput console ...

  lint: OK (1.99=setup[1.95]+cmd[0.02,0.02] seconds)
  type: OK (5.58=setup[5.16]+cmd[0.42] seconds)
  coverage: OK (4.67=setup[2.00]+cmd[2.68] seconds)
  3.11: OK (5.11=setup[2.79]+cmd[2.32] seconds)
  3.12: OK (5.78=setup[3.35]+cmd[2.43] seconds)
  3.13: OK (5.74=setup[3.35]+cmd[2.39] seconds)
  congratulations :) (28.91 seconds)

Minimal example

I opened an issue :

name: debug uv/tox on windows

on:
  workflow_dispatch:

jobs:
  test:
    runs-on: windows-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Install uv
        uses: astral-sh/setup-uv@v7

      - name: Install tox + tox-uv
        run: uv tool install tox --with tox-uv

      - name: Determine python version tox is using
        run: D:\a\_temp\uv-tool-dir\tox\Scripts\python.exe --version

Python version is

Run D:\a\_temp\uv-tool-dir\tox\Scripts\python.exe --version
  D:\a\_temp\uv-tool-dir\tox\Scripts\python.exe --version
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    UV_TOOL_BIN_DIR: D:\a\_temp\uv-tool-bin-dir
    UV_TOOL_DIR: D:\a\_temp\uv-tool-dir
    UV_PYTHON_INSTALL_DIR: D:\a\_temp\uv-python-dir
    UV_CACHE_DIR: D:\a\_temp\setup-uv-cache
Python 3.9.13

To resume, i have this problem only with Window with github actions.

Thank you, I remain available for any further information !

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions