Package Name Case Sensitivity
See original GitHub issue-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option). -
OS version and name: macOS 14.6
-
Poetry version: 1.0.0b1
Issue
I’m trying to specify a development version of Logbook:
logbook = {rev = "185b9ed959f2a41b605bbd93bdbd83ed9efbc5bd",git = "https://github.com/getlogbook/logbook.git"}
Poetry is complaining:
$ poetry update
Updating dependencies
Resolving dependencies... (1.9s)
[RuntimeError]
The dependency name for logbook does not match the actual package's name: Logbook
Traceback (most recent call last):
File "/Users/iwolosch/.poetry/lib/poetry/_vendor/py3.7/clikit/console_application.py", line 132, in run
status_code = command.handle(parsed_args, io)
File "/Users/iwolosch/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py", line 119, in handle
status_code = self._do_handle(args, io)
File "/Users/iwolosch/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py", line 167, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/Users/iwolosch/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/Users/iwolosch/.poetry/lib/poetry/console/commands/update.py", line 49, in handle
return installer.run()
File "/Users/iwolosch/.poetry/lib/poetry/installation/installer.py", line 74, in run
self._do_install(local_repo)
File "/Users/iwolosch/.poetry/lib/poetry/installation/installer.py", line 161, in _do_install
ops = solver.solve(use_latest=self._whitelist)
File "/Users/iwolosch/.poetry/lib/poetry/puzzle/solver.py", line 38, in solve
packages, depths = self._solve(use_latest=use_latest)
File "/Users/iwolosch/.poetry/lib/poetry/puzzle/solver.py", line 173, in _solve
self._package, self._provider, locked=locked, use_latest=use_latest
File "/Users/iwolosch/.poetry/lib/poetry/mixology/__init__.py", line 7, in resolve_version
return solver.solve()
File "/Users/iwolosch/.poetry/lib/poetry/mixology/version_solver.py", line 79, in solve
next = self._choose_package_version()
File "/Users/iwolosch/.poetry/lib/poetry/mixology/version_solver.py", line 354, in _choose_package_version
packages = self._provider.search_for(dependency)
File "/Users/iwolosch/.poetry/lib/poetry/puzzle/provider.py", line 130, in search_for
packages = self.search_for_vcs(dependency)
File "/Users/iwolosch/.poetry/lib/poetry/puzzle/provider.py", line 171, in search_for_vcs
name=dependency.name,
File "/Users/iwolosch/.poetry/lib/poetry/puzzle/provider.py", line 207, in get_package_from_vcs
package = cls.get_package_from_directory(tmp_dir, name=name)
File "/Users/iwolosch/.poetry/lib/poetry/puzzle/provider.py", line 411, in get_package_from_directory
name, package_name
If you look at Logbook, the package name is “Logbook” with an uppercase ‘L’: https://github.com/getlogbook/logbook/blob/develop/setup.py#L188
I believe that Python Package names are supposed to be case insensitive, so I believe this is a bug in Poetry. This appears to be fixed by simply making the if statement on Line 411 ignore case, but I’m not sure if this is more complex than that or not.
I do not see this same problem when trying to install a stable Logbook release from PyPI, I suspect this only affects installing from Path/VCS.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Reopening till we answer your question.
#1305 fixes this issue.