-
Notifications
You must be signed in to change notification settings - Fork 0
Add uv support and dependency groups #4
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: main
Are you sure you want to change the base?
Add uv support and dependency groups #4
Conversation
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
Adds support for dependency groups and using uv.lock
for environment sync via uv sync
, with dev
as the default group, and updates docs/tests accordingly.
- Introduce a new
groups
field inConfig
, defaulting to["dev"]
- Update
load_config
,project_requirements
, andprepare_virtualenv
to preferuv.lock
and runuv sync
with groups/extras - Document the
groups
option indocs/config.rst
and adjust existing tests to include the default group
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
thx/types.py | Added groups: Sequence[str] to Config |
thx/tests/config.py | Updated all Config(...) instantiations to include groups=["dev"] |
thx/runner.py | Extended run_command /check_command to accept an env mapping |
thx/context.py | Added logic to detect uv.lock and run uv sync with groups and extras |
thx/config.py | Defaulted groups to ["dev"] when loading config |
docs/config.rst | Documented the new groups attribute |
Comments suppressed due to low confidence (1)
thx/context.py:231
- There aren't any tests covering the
uv.lock
branch inprepare_virtualenv
; consider adding a test whereuv.lock
exists to verify theuv sync
invocation with groups and extras.
if requirements and requirements[0].name == "uv.lock":
.. attribute:: extras | ||
:type: list[str] | ||
|
||
This specifies a list of package "extras" or optional dpendendencies to be |
Copilot
AI
Jun 26, 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.
There's a typo in the word "dpendendencies"; it should be "dependencies".
This specifies a list of package "extras" or optional dpendendencies to be | |
This specifies a list of package "extras" or optional dependencies to be |
Copilot uses AI. Check for mistakes.
|
||
async def check_command(command: Sequence[StrPath]) -> CommandResult: | ||
result = await run_command(command) | ||
async def check_command(command: Sequence[StrPath], *, env: Optional[Mapping[str, str]] = None, context: Optional[Context] = None) -> CommandResult: |
Copilot
AI
Jun 26, 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.
[nitpick] The keyword-only parameters in check_command
are ordered as env, context
, but run_command
uses context, env
; consider aligning the order for consistency.
async def check_command(command: Sequence[StrPath], *, env: Optional[Mapping[str, str]] = None, context: Optional[Context] = None) -> CommandResult: | |
async def check_command(command: Sequence[StrPath], *, context: Optional[Context] = None, env: Optional[Mapping[str, str]] = None) -> CommandResult: |
Copilot uses AI. Check for mistakes.
Summary
uv.lock
over requirements files when syncingTesting
python -m coverage run -m thx.tests
https://chatgpt.com/codex/tasks/task_e_6843f8b83f048328800000335351380c