-
Notifications
You must be signed in to change notification settings - Fork 168
feat: add Windows venv wrappers support #768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
6c2354b
to
28c56cf
Compare
🚀 Build artifacts are ready for testing!Download the wheel file and binaries with gh CLI or from the workflow artifacts. 📦 Install & RunPre-requisites# Install uv if needed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create and enter artifacts directory
mkdir artifacts && cd artifacts Quick Test with Python Package# Download and run with uv
gh run download 16037481309 -n dist -R pyupio/safety
uv run --with safety-3.5.2+feat.add.windows.venv.support-py3-none-any.whl safety --version Binary Installation# Linux
gh run download 16037481309 -n safety-linux -D linux -R pyupio/safety
cd linux && mv safety safety-pr && chmod +x safety-pr
# macOS
gh run download 16037481309 -n safety-macos -D macos -R pyupio/safety
cd macos && mv safety safety-pr && chmod +x safety-pr
# Windows
gh run download 16037481309 -n safety-windows -D windows -R pyupio/safety
cd windows && mv safety.exe safety-pr.exe
./safety-pr --version
|
9db81e9
to
4ce49b4
Compare
4ce49b4
to
215aa7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
215aa7a
to
5036f67
Compare
Windows lacks built-in shell aliases like Unix's bashrc, so Safety uses .bat wrappers in a scripts directory prepended to PATH. However, when users activate a virtual environment, the venv's Scripts directory gets prepended to PATH, causing commands like 'pip' to bypass our Safety wrappers entirely. This implementation solves the issue by adding doskey aliases for CMD (via AutoRun registry) and PowerShell functions (via profile scripts), ensuring Safety's command interception works regardless of PATH order changes during venv activation.
5036f67
to
c1aaa27
Compare
Description
Add support for virtualenvs on Windows PowerShell and CMD.exe
Windows lacks built-in shell aliases like Unix's bashrc, so Safety uses .bat wrappers in a scripts directory prepended to PATH. However, when users activate a virtual environment, the venv's Scripts directory gets prepended to PATH, causing commands like 'pip' to bypass our Safety wrappers entirely. This implementation solves the issue by adding doskey aliases for CMD (via AutoRun registry) and PowerShell functions (via profile scripts), ensuring Safety's command interception works regardless of PATH order changes during venv activation.