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

Package Name Case Sensitivity #1303

Closed
3 tasks done
iwoloschin opened this issue Aug 15, 2019 · 6 comments
Closed
3 tasks done

Package Name Case Sensitivity #1303

iwoloschin opened this issue Aug 15, 2019 · 6 comments
Labels
kind/bug Something isn't working as expected

Comments

@iwoloschin
Copy link

  • 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.

@brycedrennan
Copy link
Contributor

Thanks for taking the time to submit an issue. Python imports are case-sensitive so I don't think there's anything to fix here.

@iwoloschin
Copy link
Author

@brycedrennan isn't the import statement case sensitive, but the package naming itself not case sensitive? I think in this case Poetry should be case insensitive, but the application one might build with poetry would need to be case sensitive when actually using whatever dependencies Poetry is managing?

https://www.python.org/dev/peps/pep-0508/#id21

@iwoloschin
Copy link
Author

Alternatively, if this is not a poetry bug, how would you recommend adding the development branch of Logbook as a dependency to a project managed by poetry?

Thanks!

@brycedrennan brycedrennan added the kind/bug Something isn't working as expected label Aug 16, 2019
@brycedrennan
Copy link
Contributor

Reopening till we answer your question.

@kasteph
Copy link
Member

kasteph commented Sep 24, 2019

#1305 fixes this issue.

Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants