Skip to content

Conversation

lordmauve
Copy link
Owner

Summary

  • add support for dependency groups and uv environments
  • prefer uv.lock over requirements files when syncing
  • document new configuration options

Testing

  • python -m coverage run -m thx.tests

https://chatgpt.com/codex/tasks/task_e_6843f8b83f048328800000335351380c

@Copilot Copilot AI review requested due to automatic review settings June 26, 2025 09:30
Copy link

@Copilot 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 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 in Config, defaulting to ["dev"]
  • Update load_config, project_requirements, and prepare_virtualenv to prefer uv.lock and run uv sync with groups/extras
  • Document the groups option in docs/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 in prepare_virtualenv; consider adding a test where uv.lock exists to verify the uv 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
Copy link

Copilot AI Jun 26, 2025

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".

Suggested change
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:
Copy link

Copilot AI Jun 26, 2025

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant