Skip to content
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

Validate config raises error for options specific to only one CLI command #1944

Closed
sobayed opened this issue Aug 1, 2023 · 2 comments
Closed

Comments

@sobayed
Copy link

sobayed commented Aug 1, 2023

With pip-tools version 7.1.0 I'm getting an error message (see "Actual result") when running pip-sync with the following configuration in pyproject.toml:

[tool.pip-tools]
emit-index-url = false

Maybe I missed how to specify options for a specific CLI command, but I couldn't find any related info in the docs.

Environment Versions

  1. OS Type: Win 10
  2. Python version: 3.9.12
  3. pip version: 23.2.1
  4. pip-tools version: 7.1.0

Steps to replicate

  1. Add a CLI option to config (e.g., in pyproject.toml) that is only used by one CLI command (e.g., --no-emit-index-url for pip-compile)
  2. Run a CLI command which does not use said option (e..g, pip-sync)

Expected result

Validation error is only raised for options that are relevant to the respective CLI command.

Actual result

❯ pip-sync -h
Usage: pip-sync [OPTIONS] [SRC_FILES]...
Try 'pip-sync -h' for help.

Error: No such config key 'emit_index_url'. (Possible options: extra_index_url, index_url)
@atugushev
Copy link
Member

Thanks for the issue! That's fixed in #1933 and not yet released.

@atugushev
Copy link
Member

Released as part of pip-tools v7.2.0

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

No branches or pull requests

2 participants