Skip to content

pip should read configuration from pyproject.toml for local projects #13003

@notatallshaw

Description

@notatallshaw

What's the problem this feature will solve?

Increasingly users expect tools to be able to read from their pyproject.toml for their local project. At this point pip stands as an outlier in not being able to define pip configuration in pyproject.toml.

Describe the solution you'd like

When installing a local package that has a pyproject.toml check for a section [tool.pip] and prioritize any configuration there as more important than configuration in environmental variables or configuration in the users environment (e.g. system directory, user directory, venv directory), but not as important as configuration passed on the command line.

Alternative Solutions

Do nothing

Additional context

This ticket is created to track this feature and point issues that require it to here. I think this would require a lot of design choices and I am not volunteering to lead it. But perhaps someone else might be sufficiently motivated!

Some immediate design choices that come to mind are:

  • Most tools that offer pyproject.toml configuration in [tool.{tool-name}] also offer {tool-name}.toml configuration, would pip want to also read from a dedicated pip.toml?
  • If pip supports pip.toml should it be possible to use a pip.toml in all the current places pip allows pip.[conf|ini] and in which case would it be the recommended format going forward?
  • Should there be an option to specify the file location of the toml configuration file?
  • For places where pip allows the user to provide a list of values via space separation would it make sense in the toml file to only allow this as an actual list?

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions