Installation¶
Requirements¶
- Python: 3.9 or higher
- Operating System: Linux, macOS (Windows support coming soon)
- Rust: 1.75+ (only for building from source)
Install from Cargo¶
The recommended way to install rpytest:
Install from Source¶
Clone and build:
git clone https://github.com/user/rpytest.git
cd rpytest
cargo build --release
# Add to PATH
export PATH="$PWD/target/release:$PATH"
Python Dependencies¶
rpytest requires the Python daemon package to be installed in your project's virtual environment:
# Using pip
pip install rpytest-daemon
# Using uv
uv pip install rpytest-daemon
# Or install from source
cd daemon/
pip install -e .
Verify Installation¶
# Check version
rpytest --version
# Run a simple test
echo 'def test_example(): assert True' > test_example.py
rpytest test_example.py
Virtual Environment Detection¶
rpytest automatically detects your Python environment in this order:
VIRTUAL_ENVenvironment variablePYTHONenvironment variable.venv/directory in current or parent directories- System
python3orpython
Using with uv
rpytest works seamlessly with uv:
IDE Integration¶
VS Code¶
Add to your .vscode/settings.json:
{
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": false,
"rpytest.enable": true
}
PyCharm¶
rpytest can be configured as an external tool:
- Go to Settings → Tools → External Tools
- Add new tool with:
- Program:
rpytest - Arguments:
$FilePath$ - Working directory:
$ProjectFileDir$
Troubleshooting¶
Daemon Connection Failed¶
If you see "Failed to connect to daemon":
# Check if daemon is running
rpytest --daemon-status
# Stop any stale daemon
rpytest --daemon-stop
# Clean up stale files
rpytest --cleanup
Python Not Found¶
If rpytest can't find Python:
# Set explicitly
export PYTHON=/path/to/python3
# Or use virtual environment
source .venv/bin/activate
rpytest tests/