-
Notifications
You must be signed in to change notification settings - Fork 30
Fix missing dev-requirements.txt in workspace dependencies list #910
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
- Add `*requirements*.txt` pattern to find requirements files at workspace root - This ensures files like dev-requirements.txt, test-requirements.txt are found - Add deduplication logic to handle overlapping search patterns - All existing unit tests pass Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
- Test finding dev-requirements.txt at workspace root - Test deduplication of files found by multiple patterns - Test finding files in subdirectories and requirements/ folders - Test filtering files by project directories - All 181 unit tests passing (5 new tests added) Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for dev-requirements.txt in environment dependencies
Fix missing dev-requirements.txt in workspace dependencies list
Oct 8, 2025
Copilot finished work on behalf of
eleanorjboyd
October 8, 2025 03:30
eleanorjboyd
approved these changes
Oct 8, 2025
dmitrivMS
approved these changes
Oct 8, 2025
NguyenCuong1989
referenced
this pull request
in NguyenCuong1989/vscode-python-environments
Oct 23, 2025
Fixes microsoft/vscode-python-environments#506 Added an explicit glob pattern `*requirements*.txt` to ensure requirements files at the workspace root are reliably found. The fix includes: 1. **Additional search pattern**: Added `findFiles('*requirements*.txt')` to explicitly search the workspace root 2. **Deduplication logic**: Implemented deduplication using a Map keyed by file system path to handle overlapping patterns 3. **Comprehensive tests**: Created 5 new unit tests to validate the fix Now both patterns work together: - `**/*requirements*.txt` - finds requirements files in subdirectories - `*requirements*.txt` - finds requirements files at workspace root ## Requirements Files Now Discovered This fix ensures all common requirements file naming patterns are found: - `requirements.txt` - main dependencies - `dev-requirements.txt` - development dependencies ✨ - `test-requirements.txt` - testing dependencies ✨ - `docs-requirements.txt` - documentation dependencies ✨ - `prod-requirements.txt` - production dependencies ✨ - Any other `*requirements*.txt` variant ✨ <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Missing requirements file in workspace dependencies list</issue_title> > <issue_description>I have the following file structure > >  > > - click + on venv in environments panel > - click to create environment in root directory > - custom environment > - install workspace dependencies > - I only see `requirements.txt` as an option > > I expect I would see both dev-requirements.txt and requirements.txt because they are both present in the root folder > > >  > > </issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > <comment_new><author>@eleanorjboyd</author><body> > todo: adopt dev-requirements.txt as something we search in the python environment extension when finding dependency files.</body></comment_new> > </comments> > </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #506
Added an explicit glob pattern
*requirements*.txtto ensure requirements files at the workspace root are reliably found. The fix includes:findFiles('*requirements*.txt')to explicitly search the workspace rootNow both patterns work together:
**/*requirements*.txt- finds requirements files in subdirectories*requirements*.txt- finds requirements files at workspace rootRequirements Files Now Discovered
This fix ensures all common requirements file naming patterns are found:
requirements.txt- main dependenciesdev-requirements.txt- development dependencies ✨test-requirements.txt- testing dependencies ✨docs-requirements.txt- documentation dependencies ✨prod-requirements.txt- production dependencies ✨*requirements*.txtvariant ✨Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.