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

Options in pyproject.toml break usage of pip-sync #1988

Closed
tscheburaschka opened this issue Sep 19, 2023 · 1 comment · Fixed by #1989
Closed

Options in pyproject.toml break usage of pip-sync #1988

tscheburaschka opened this issue Sep 19, 2023 · 1 comment · Fixed by #1989
Labels
bug Something is not working config Related to pip-tools' configuration

Comments

@tscheburaschka
Copy link

I found it handy to add some often used options to the [tools.pip-tools]-section of my pyproject.toml. In particular I added:

[tool.pip-tools]
strip-extras = true
no-emit-index-url = true
no-emit-trusted-host = true

But now, calling pip-sync requirements.txt breaks with:

Error: No such config key 'no_emit_index_url'. (Possible options: emit_index_url, extra_index_url, index_url)

I can see, that using instead emit-index-url = false would have the same effect and, actually, is probably the correct solution to this. But given the poor documentation of the pyproject.toml-behaviour, we are left guessing and this is tedious and time-consuming. Moreover, pip-compile does not complain about the pyproject-options and happily uses them. Only pip-sync spoils the experience ;-)
So, a bit more consistency would be nice.

Environment Versions

  1. OS Type: MS Windows 10
  2. Python version: Python 3.11.5
  3. pip version: pip 23.2.1
  4. pip-tools version: pip-compile, version 7.3.0

Steps to replicate

  1. Put any of the no-* options in pyproject.toml, e.g. no-emit-index-url = true
  2. Call pip-compile and enjoy.
  3. Call pip-sync and scratch your head, sort out your frustration and try to think, what could possibly be the issue here.

Expected result

The behaviour of pip-compile and pip-sync when using options from pyproject.toml is consistent, well documented and intuitive.

Actual result

The subset of options that work with pip-sync is unexpectedlty smaller than that of pip-compile.

@AndydeCleyre AndydeCleyre added the config Related to pip-tools' configuration label Sep 19, 2023
@chrysle chrysle added the bug Something is not working label Oct 9, 2023
@q0w
Copy link
Contributor

q0w commented Oct 17, 2023

@chrysle I have a problem with resolver option for pip-compile. It fails for pip-sync.
Error: No such config key 'resolver'. Did you mean resolver_name?
But resolver_name is an alias of resolver option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working config Related to pip-tools' configuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants