Skip to content

Fix print-how-to-use for requirements.txt with none backend#1043

Merged
nathanjmcdougall merged 1 commit intomainfrom
1024-misleading-message-run-usethis-tool-requirementstxt-to-re-write-requirementstxt
Oct 26, 2025
Merged

Fix print-how-to-use for requirements.txt with none backend#1043
nathanjmcdougall merged 1 commit intomainfrom
1024-misleading-message-run-usethis-tool-requirementstxt-to-re-write-requirementstxt

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Oct 26, 2025

CodSpeed Performance Report

Merging #1043 will not alter performance

Comparing 1024-misleading-message-run-usethis-tool-requirementstxt-to-re-write-requirementstxt (d942580) with main (6d6cb4f)

Summary

✅ 2 untouched

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review October 26, 2025 09:57
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 fixes the "how to use" message for requirements.txt when using the none backend. The message now correctly says "write" instead of "re-write" when the file doesn't exist, and is suppressed entirely when the file already exists.

Key changes:

  • Added a conditional check to only show the instruction message when requirements.txt doesn't exist
  • Updated the message text from "re-write" to "write" for clarity
  • Updated test expectations to match the new behavior

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/usethis/_tool/impl/requirements_txt.py Added existence check and updated message text for none backend
tests/usethis/_ui/interface/test_tool.py Removed assertion for instruction message when file exists
tests/usethis/_tool/impl/test_requirements_txt.py Updated expected message text from "re-write" to "write"
tests/usethis/_core/test_core_tool.py Removed assertion for instruction message when file exists

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nathanjmcdougall nathanjmcdougall merged commit 040cdab into main Oct 26, 2025
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 1024-misleading-message-run-usethis-tool-requirementstxt-to-re-write-requirementstxt branch October 26, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading message: Run 'usethis tool requirements.txt' to re-write 'requirements.txt'.

2 participants