-
Notifications
You must be signed in to change notification settings - Fork 166
Fix : Dependency Isolation & Runtime Context #1513
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
base: enext
Are you sure you want to change the base?
Conversation
…d virtual environment, not the system Python environment.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates README.rst to clarify how to run Django management commands when dependencies are installed in a uv-managed virtual environment, emphasizing the need to use File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `README.rst:107-116` </location>
<code_context>
7. **Activate virtual environment**
-After running ``uv sync```, activate a virtual environment
+ All python commands must be run within the project's virtual environment. You have two options:
-.. code-block:: sh
+ **Option A: Activate the environment (Recommended)**
+
+ .. code-block:: sh
+
+ . .venv/bin/activate
+
+ **Option B: Use `uv run`**
+
+ Prepend ``uv run`` to any python command to run it in the environment without explicit activation.
+
+ .. code-block:: sh
</code_context>
<issue_to_address>
**nitpick (typo):** Capitalize "Python" when referring to the language in prose.
Specifically, update the phrases "All python commands" and "any python command" in this section to use "Python."
Suggested implementation:
```
All Python commands must be run within the project's virtual environment. You have two options:
```
```
Prepend ``uv run`` to any Python command to run it in the environment without explicit activation.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Pull request overview
This PR adds documentation to clarify the proper usage of virtual environments when running Python commands in the project, addressing the issue where users encountered ModuleNotFoundError when running commands directly with system Python instead of through the uv-managed virtual environment.
Key Changes:
- Enhanced the "Activate virtual environment" section with clear explanation of why virtual environment usage is required
- Added two explicit options for running commands: activating the environment (recommended) or using
uv runprefix - Provided concrete examples to illustrate both approaches
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| . .venv/bin/activate | ||
| **Option B: Use `uv run`** |
Copilot
AI
Dec 16, 2025
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.
The formatting is inconsistent with the rest of the document. The heading structure uses bold text with inline code formatting. Consider using consistent heading formatting or ensuring the inline code uses proper reStructuredText syntax (double backticks ``). The backticks around 'uv run' should be double backticks for proper rendering.
| **Option B: Use `uv run`** | |
| **Option B: Use ``uv run``** |
|
Hi, prepending . ./.venv/bin/activate |
python3 manage.py ...directly fails because dependencies are installed in auvmanaged virtual environment, not the system Python environment.ModuleNotFoundError: No module named 'pycountry'(and others).uv run python manage.py ...or by explicitly activating the virtual environment (source .venv/bin/activate).README.rstemphasizinguv runusage or automatic activation.Summary by Sourcery
Documentation: