Skip to content

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

@tscheburaschka

Description

@tscheburaschka

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not workingconfigRelated to pip-tools' configuration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions