From 74cebc716f7d368aae714a886ec2c3ec83c330bb Mon Sep 17 00:00:00 2001 From: Max Isbey <224885523+maxisbey@users.noreply.github.com> Date: Thu, 30 Oct 2025 19:40:00 +0000 Subject: [PATCH] Make test dependencies required instead of optional This change moves pytest and anyio from optional dev dependencies to required dependencies to prevent issues when running `uv sync` without `--all-extras`. Changes: - Moved pytest and anyio to main dependencies in pyproject.toml - Removed `--all-extras` flag from CI workflow since it's no longer needed - This prevents developers from accidentally running sync without test deps The `--all-extras` flag was previously required in CI and local development, which was error-prone since running `uv sync` would remove test dependencies, breaking the ability to run tests. --- .github/workflows/shared.yml | 6 +++--- pyproject.toml | 5 +++++ uv.lock | 8 ++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/shared.yml b/.github/workflows/shared.yml index 73fe9ce57..264a4a8f7 100644 --- a/.github/workflows/shared.yml +++ b/.github/workflows/shared.yml @@ -20,7 +20,7 @@ jobs: enable-cache: true version: 0.9.5 - name: Install dependencies - run: uv sync --frozen --all-extras --python 3.10 + run: uv sync --frozen --python 3.10 - uses: pre-commit/action@v3.0.1 with: @@ -53,7 +53,7 @@ jobs: version: 0.9.5 - name: Install the project - run: uv sync ${{ matrix.dep-resolution.install-flags }} --all-extras --python ${{ matrix.python-version }} + run: uv sync ${{ matrix.dep-resolution.install-flags }} --python ${{ matrix.python-version }} - name: Run pytest run: uv run ${{ matrix.dep-resolution.install-flags }} --no-sync pytest @@ -71,7 +71,7 @@ jobs: version: 0.9.5 - name: Install dependencies - run: uv sync --frozen --all-extras --python 3.10 + run: uv sync --frozen --python 3.10 - name: Check README snippets are up to date run: uv run --frozen scripts/update_readme_snippets.py --check diff --git a/pyproject.toml b/pyproject.toml index 1a300db2e..437e75b3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,11 @@ dev = [ "pytest-pretty>=1.2.0", "inline-snapshot>=0.23.0", "dirty-equals>=0.9.0", + # Optional dependencies needed for testing + "rich>=13.9.4", + "typer>=0.16.0", + "python-dotenv>=1.0.0", + "websockets>=15.0.1", ] docs = [ "mkdocs>=1.6.1", diff --git a/uv.lock b/uv.lock index 7c087ce73..763768da0 100644 --- a/uv.lock +++ b/uv.lock @@ -691,8 +691,12 @@ dev = [ { name = "pytest-flakefinder" }, { name = "pytest-pretty" }, { name = "pytest-xdist" }, + { name = "python-dotenv" }, + { name = "rich" }, { name = "ruff" }, { name = "trio" }, + { name = "typer" }, + { name = "websockets" }, ] docs = [ { name = "mkdocs" }, @@ -732,8 +736,12 @@ dev = [ { name = "pytest-flakefinder", specifier = ">=1.1.0" }, { name = "pytest-pretty", specifier = ">=1.2.0" }, { name = "pytest-xdist", specifier = ">=3.6.1" }, + { name = "python-dotenv", specifier = ">=1.0.0" }, + { name = "rich", specifier = ">=13.9.4" }, { name = "ruff", specifier = ">=0.8.5" }, { name = "trio", specifier = ">=0.26.2" }, + { name = "typer", specifier = ">=0.16.0" }, + { name = "websockets", specifier = ">=15.0.1" }, ] docs = [ { name = "mkdocs", specifier = ">=1.6.1" },