Skip to content

Fix Windows release pytest temp directory setup - #24

Merged
Masterain98 merged 1 commit into
mainfrom
codex/fix-release-pytest-basetemp
Aug 12, 2026
Merged

Fix Windows release pytest temp directory setup#24
Masterain98 merged 1 commit into
mainfrom
codex/fix-release-pytest-basetemp

Conversation

@Masterain98

@Masterain98 Masterain98 commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Root cause

The Windows release job passed a nested --basetemp .pytest-tmp/release to pytest without creating its parent directory. Pytest 9.1.1 creates the final directory with parents=False, so every test using tmp_path failed during fixture setup. The 186 errors were one cascading infrastructure failure, not independent test failures.

Fix

Create .pytest-tmp before running the release test command, matching the existing unit and coverage workflows.

Validation

  • Reproduced the failure from a clean temporary directory with pytest 9.1.1 on Windows.
  • Ran the exact corrected release test command after removing the existing parent directory: 348 passed, 12 deselected.
  • actionlint passed.
  • git diff --check passed.

After merging, rerun the failed release workflow (or dispatch release manually) to continue building and publishing version 0.2.1.

Summary by Sourcery

CI:

  • Update the release GitHub Actions workflow to create the .pytest-tmp directory prior to invoking pytest to prevent tmp_path setup failures.

@sourcery-ai

sourcery-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The release workflow for Windows now ensures the .pytest-tmp directory exists before invoking pytest, preventing tmp_path-related fixture failures caused by a missing parent directory when using --basetemp.

Flow diagram for Windows release pytest temp directory setup

flowchart TD
    A[Windows_release_job step] --> B["Run python -c import os; os.makedirs('.pytest-tmp', exist_ok=True)"]
    B --> C["Run pytest -m not integration<br/>--basetemp .pytest-tmp/release<br/>-o cache_dir=.pytest-tmp/cache"]
    C --> D[Subsequent build steps]
Loading

File-Level Changes

Change Details Files
Ensure the Windows release workflow creates the pytest temporary directory parent (.pytest-tmp) before running pytest so tmp_path fixtures work correctly.
  • Updated the Windows release job test step to run a small Python one-liner that calls os.makedirs('.pytest-tmp', exist_ok=True) before pytest.
  • Kept the existing pytest invocation with --basetemp .pytest-tmp/release and -o cache_dir=.pytest-tmp/cache unchanged aside from prepending the directory creation command.
.github/workflows/release.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c7519c8f-5b9a-4837-a6cb-99debbd2be7f

📥 Commits

Reviewing files that changed from the base of the PR and between 497003d and fc7a32f.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved release test reliability by ensuring the required temporary test directory is available before tests run.

Walkthrough

The release workflow now creates .pytest-tmp before it runs the release test suite.

Changes

Release test setup

Layer / File(s) Summary
Prepare release test directory
.github/workflows/release.yml
The release test command creates .pytest-tmp before invoking pytest.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A rabbit checks the test run bright,
And makes the temp path just right.
.pytest-tmp now waits in place,
So pytest starts its careful race.
Hop, hop—green results in sight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Windows release workflow change and pytest temporary-directory setup fix.
Description check ✅ Passed The description explains the root cause, fix, validation results, and affected Windows release workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-release-pytest-basetemp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Masterain98
Masterain98 merged commit 1e63855 into main Aug 12, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant