Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntryPoint and entrypoint with different casing disrupts uninstallation. #4771

Closed
renxida opened this issue Oct 5, 2017 · 7 comments
Closed
Labels
C: scripts How scripts and entry points are managed kind: crash For situations where pip crashes type: bug A confirmed bug or unintended behavior

Comments

@renxida
Copy link

renxida commented Oct 5, 2017

  • Pip version: 9.0.1
  • Python version: 3.6.0
  • Operating system: Ubuntu 16.10
xren@ecoli:~$ pip --version
lpip 9.0.1 from /home/xren/anaconda3/lib/python3.6/site-packages (python 3.6)
xren@ecoli:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.10
Release:	16.10
Codename:	yakkety
xren@ecoli:~$ python --version
Python 3.6.0 :: Anaconda 4.3.1 (64-bit)

Description:

Having entrypoints that are the same words but in different case in setup.py makes package impossible to uninstall.

What I've done

Setup.py:

 setup(
     name='FlowCal',
 
     entry_points = {
         'console_scripts': [
             'flowcal=FlowCal.excel_ui:run_command_line',
             'FlowCal=FlowCal.excel_ui:run_command_line',
         ]
     },

Commandline:

$pip install .
$ pip uninstall flowcal
Exception:
Traceback (most recent call last):
  File "/home/xren/anaconda3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/xren/anaconda3/lib/python3.6/site-packages/pip/commands/uninstall.py", line 76, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/home/xren/anaconda3/lib/python3.6/site-packages/pip/req/req_set.py", line 346, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/home/xren/anaconda3/lib/python3.6/site-packages/pip/req/req_install.py", line 734, in uninstall
    FakeFile(dist.get_metadata_lines('entry_points.txt'))
  File "/home/xren/anaconda3/lib/python3.6/configparser.py", line 760, in readfp
    self.read_file(fp, source=filename)
  File "/home/xren/anaconda3/lib/python3.6/configparser.py", line 715, in read_file
    self._read(f, source)
  File "/home/xren/anaconda3/lib/python3.6/configparser.py", line 1089, in _read
    fpname, lineno)
configparser.DuplicateOptionError: While reading from '<???>' [line  3]: option 'flowcal' in section 'console_scripts' already exists
@renxida
Copy link
Author

renxida commented Oct 5, 2017

I wonder if I should have posted this in the setuptools repo?

@pradyunsg
Copy link
Member

This should, maybe, not be allowed since on a case insensitive system, you can't actually install both of these scripts. I'll defer that decision to someone else though.

Also, #3801 is sorta related to this.

@pradyunsg pradyunsg added kind: crash For situations where pip crashes C: scripts How scripts and entry points are managed labels Oct 6, 2017
@pradyunsg
Copy link
Member

pradyunsg commented Oct 6, 2017

For what it's worth, pip will use wheels to install directories in the future...

Could you try the following and provide the output?

pip install --upgrade wheel setuptools pip
python setup.py bdist_wheel
pip install dist/*.whl
pip uninstall flowcal

@ghost
Copy link

ghost commented Oct 6, 2017

This should, maybe, not be allowed since on a case insensitive system, you can't actually install both of these scripts. I'll defer that decision to someone else though.

Yes, but ultimately I think the goal here is that if someone types the same two commands on linux and windows, then they will both work. Ultimately, pip should fail if the two commands point to different entry points if it's going to fail at all (though I don't see a way to avoid failure if in fact that is the case).

@renxida
Copy link
Author

renxida commented Oct 6, 2017

From my pov, I don't really care if I can make both commands work. I just don't want pip to be installing something it cannot uninstall. Expect the wheel output soon.

@renxida
Copy link
Author

renxida commented Oct 6, 2017

@xoviat Checked. Same problem occurs when uninstalling, even when I bdist_wheel and install the wheel.

pip, setuptools, and wheels all upgraded to newest, doesn't solve problem.

@pradyunsg pradyunsg added type: bug A confirmed bug or unintended behavior and removed type: bug A confirmed bug or unintended behavior labels May 11, 2018
@pradyunsg
Copy link
Member

pip uninstall no longer contains a reference to entry_points.txt.

I am going to close this, given the lack of activity on this issue -- I reckon that this has been resolved at some point.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: scripts How scripts and entry points are managed kind: crash For situations where pip crashes type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants