pypa / pypa/setuptools

Bug: console_scripts installed even when extras not requested

Open
#2,282 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Summary

When [some_extra] is present in console_scripts and the package is installed using pip3 install package (without [some_extra]), the script is still installed. If the extra requires additional dependencies, then the resulting command is broken.

Steps to reproduce

Steps using a real-life example
  1. Get a system with git and pip3 installed, but without click, requests or toml
  2. git clone -b cli https://github.com/Kixunil/lnurl
  3. cd lnurl
  4. sudo pip3 install lnurl
  5. lnurl
Expected behavior:

lnurl: command not found error, no lnurl in /usr/local/bin

What happens

lnurl command actually exists and runs throwing exceptions about missing dependencies. Of course sudo pip3 install .[cli] installs the required dependencies, so lnurl runs fine - this works as intended.

Meta

Python version: 3.7
OS: Debian 10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with the listed git and pip3 commands, especially installing without the extra and checking whether lnurl appears. Then trace setuptools' console_scripts handling for extras; done means a script requiring an unrequested extra is not installed, while installing with [cli] still provides a working command.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.