jazzband / pip-tools

A set of tools to keep your pinned Python dependencies fresh.
https://pip-tools.rtfd.io
BSD 3-Clause "New" or "Revised" License
7.69k stars 610 forks source link

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

Closed tscheburaschka closed 9 months ago

tscheburaschka commented 12 months ago

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.

q0w commented 11 months ago

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