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

When docopt and docopt-ng are in the same venv, docopt takes precedence #22

Open
matthewdeanmartin opened this issue Dec 6, 2021 · 6 comments

Comments

@matthewdeanmartin
Copy link

If you install
pipenv install pipreqs pip-upgrader docopt-ng
Which sometimes happens, you can't put everything into system or pipx.

Then apps use the wrong docopt.

$ python
>>> import docopt
>>> docopt.__file__
'C:\\Users\\matth\\.virtualenvs\\demo_doc-j-5bRj6B\\lib\\site-packages\\docopt.py'
>>> exit()

$ pip install docopt-ng
Requirement already satisfied: docopt-ng in c:\users\matth\.virtualenvs\demo_doc-j-5brj6b\lib\site-packages (0.7.2)

In C# there was a way to handle this and ensure that two similarly named dlls weren't confused with each other, I don't know what the python way is to handle this scenario.

@NickCrews
Copy link
Contributor

Thanks for this issue @matthewdeanmartin.

I feel like in hindsight, it would have been nice if the original forker had named the package (package meaning what you use with import docopt) to something new and unique, even docopt2. Now though, we might be a bit stuck with their choices. I'm open to working on fixing this, but I'm not exactly sure what the implications of renaming the package are. Anyone know any other moderately popular packages that have changed their package name? How they did it?

Renaming the distribution (eg what you use with pip install docopt-ng) is easier to do and is backwards compatible, per https://github.com/simonw/pypi-rename, but that is less important that than the package name, which actually blocks certain installs.

@matthewdeanmartin
Copy link
Author

All I can think of is leaving the old docopt-ng as is and publishing going forward with a new package name and new module name, e.g. pip install docopt2 and import docoptng. Without something like .net's 4 part assembly names or other name clash strategies, this is a problem bigger than doctopt(-ng). I don't know which option is better, they are all bad options.

@NickCrews
Copy link
Contributor

See the discussion I started on discuss.python.org. I emailed the listed docopt maintainer for transferring the name of docopt on PyPI.

@graingert
Copy link
Member

You should do a pep 541 name request

@NickCrews
Copy link
Contributor

See #48 for more info on PEP 541 name request.

@bittner bittner changed the title When docopt and docopt-ng are in the same venv, docopt takes precidence When docopt and docopt-ng are in the same venv, docopt takes precedence May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants