Skip to content

Implement Dependency.to_requirements_string#861

Merged
nathanjmcdougall merged 2 commits intomainfrom
850-a-method-on-the-dependency-object-to-display-it-as-a-requirements-string
Jul 16, 2025
Merged

Implement Dependency.to_requirements_string#861
nathanjmcdougall merged 2 commits intomainfrom
850-a-method-on-the-dependency-object-to-display-it-as-a-requirements-string

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

No description provided.

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

Adds a new method to format a Dependency as a requirements-style string and accompanying tests.

  • Implements Dependency.to_requirements_string to emit name[extra1,extra2]
  • Introduces tests for no extras, single extra, and multiple extras cases

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/usethis/_integrations/uv/test_deps.py Added TestDependency.TestToRequirementsString tests for the new method
src/usethis/_integrations/uv/deps.py Implemented to_requirements_string in Dependency class
Comments suppressed due to low confidence (1)

tests/usethis/_integrations/uv/test_deps.py:32

  • pytest does not collect tests inside nested classes. Move these test methods into a top-level class (e.g., TestToRequirementsString or flatten into TestDependency) so they are discovered.
    class TestToRequirementsString:

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 16, 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 Jul 16, 2025

CodSpeed Instrumentation Performance Report

Merging #861 will not alter performance

Comparing 850-a-method-on-the-dependency-object-to-display-it-as-a-requirements-string (2d2768b) with main (f34677b)

Summary

✅ 2 untouched benchmarks

@nathanjmcdougall nathanjmcdougall merged commit daff557 into main Jul 16, 2025
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 850-a-method-on-the-dependency-object-to-display-it-as-a-requirements-string branch July 16, 2025 07:47
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.

A method on the Dependency object to display it as a requirements string

2 participants