Skip to content

Per-command dependencies #1201

@Kentzo

Description

@Kentzo

It's not unusual for a setuptools command to have dependencies. The most common example is tests_require, but there are other applications. Often this is resolved by introspecting name of the command at runtime and constructing list for setup_requires accordingly.

With installation requirements there is more or less standard practice of having common dependencies expressed via install_requires and optional via extras_require.

I propose the similar hierarchy for setuptools commands:

  • setup_requires should be used for common dependencies
  • setup_extra_requires should be used similarly to extra_requires where keys are commands like test, install, or any other string allowed as a command name

Backward compatibility

  • tests_require should be an alias to setup_extra_requires['test']; if both are specified error should be issued
  • install_requires is independent from setup_extra_requires['install'] because it expresses package requirements, not setuptools command execution requirements

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions