Unable to run tests due to broken environment

I’m stuck on Stage #ZV2.

I am unable to run tests via codecrafters test due to errors that stem from the test run environment.

First, I got this error:

[tester::#ZV2] Running tests for Stage #ZV2 (Filename Completion - File completion)
[tester::#ZV2] [working_dir] - apple-69.txt
[tester::#ZV2] Running ./your_shell.sh
[your-program] Creating a virtualenv for this project
[tester::#ZV2] ^ Expected prompt ("$ ") but received "Creating a virtualenv for this project"
[your-program] Pipfile: /tmp/grape/mango/grape/Pipfile
[your-program] Using default python from /usr/local/bin/python3.12 3.12.13 to create virtualenv...
[your-program] ⠙ Creating virtual environment...created virtual environment CPython3.12.13.final.0-64-x86_64 in 325ms
[your-program]   creator CPython3Posix(dest=/venvs/grape-ahPWTjM7, clear=False, no_vcs_ignore=False, global=False)
[your-program]   seeder FromAppData(download=False, pip=bundle, via=copy, app_data_dir=/root/.cache/virtualenv)
[your-program]     added seed packages: pip==26.1
[your-program]   activators
[your-program] BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator,XonshActivator
[your-program]
[your-program] ✔ Successfully created virtual environment!
[your-program] Virtualenv location: /venvs/grape-ahPWTjM7
[your-program] Creating a Pipfile for this project...
[your-program] /venvs/grape-ahPWTjM7/bin/python3: Error while finding module specification for 'app.main' (ModuleNotFoundError: No modu
[your-program] le named 'app')
[tester::#ZV2] Test failed

I found a similar error in another post, and tried to follow it’s solution by creating .codecrafters/run.sh as instructed. Note: that I did not have any existing .codecrafters directory in my existing project, I newly created that file and directory.

However, now it seems that I am facing a new env issue, with uv missing now:

[tester::#ZV2] Running tests for Stage #ZV2 (Filename Completion - File completion)
[tester::#ZV2] [working_dir] - mango-16.txt
[tester::#ZV2] Running ./your_program.sh
[your-program] /app/your_program.sh: exec: line 7: uv: not found
[tester::#ZV2] ^ Expected prompt ("$ ") but received "/app/your_program.sh: exec: line 7: uv: not found"
[tester::#ZV2] Test failed

Have there been any recent changes to how tests are run?

Hey @warpftl, looks like your repo was created a while ago, so it doesn’t support the .codecrafters folder you added.

Could you try updating the buildpack linked to your repo as well? That should bring it in line with the newer setup.

Let me know how it goes!

I updated the buildpack in my repo, but the build still fails:

[build] > error: No `pyproject.toml` found in current directory or any parent directory
[build] Error: process "/bin/sh -c uv sync" did not complete successfully: exit code: 2.
[build] > error: No `pyproject.toml` found in current directory or any parent directory
[build] Build failed. Check the logs above for the reason.
[build] If you think this is a CodeCrafters error, please contact us at hello@codecrafters.io.

This is expected. You can copy over any new or updated files from the latest starter here: