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

Poetry dependency names not case insensitive #4770

Closed
h3llrais3r opened this issue Nov 15, 2021 · 3 comments
Closed

Poetry dependency names not case insensitive #4770

h3llrais3r opened this issue Nov 15, 2021 · 3 comments
Labels
kind/bug Something isn't working as expected

Comments

@h3llrais3r
Copy link

h3llrais3r commented Nov 15, 2021

  • [x ] I am on the latest Poetry version.
  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

Pyproject is already containing the dependency in ´[tool.poetry.dependencies]´: gitpython = "3.1.18"
This has been added manually, because I migrated from requirements.txt to pyproject.toml.
When updating the version with poetry add gitpython@3.1.20 it writes a new entry to the [tool.poetry.dependencies]: GitPython = "3.1.20" which causes poetry to think there are 2 versions required:
Poetry fails with error:

$ poetry add gitpython@3.1.20 -vvv
Using virtualenv: C:\Tools\GitHub\Auto-Subliminal\.venv
PyPI: No release information found for gitpython-2.1.2, skipping
PyPI: 1 packages found for gitpython 3.1.20

Updating dependencies
Resolving dependencies...
   1: fact: autosubliminal is 0.0.0
   1: derived: autosubliminal
   0: Duplicate dependencies for gitpython
   1: fact: autosubliminal depends on babelfish (0.6.0)
   1: fact: autosubliminal depends on cherrypy (18.6.1)
   1: fact: autosubliminal depends on deathbycaptcha (0.1.1)
   1: fact: autosubliminal depends on dogpile.cache (1.1.4)
   1: fact: autosubliminal depends on enzyme (0.4.1)
   1: fact: autosubliminal depends on gitpython (3.1.18)
   1: fact: autosubliminal depends on GitPython (3.1.20)
   1: fact: autosubliminal depends on gntp (1.0.3)
   1: fact: autosubliminal depends on guessit (3.4.2)
   1: fact: autosubliminal depends on html5lib (1.1)
   1: fact: autosubliminal depends on imdbpie (rev 75c300af1bf87c49baef09f17002a3e35b0ed3cc)
   1: fact: autosubliminal depends on importlib-metadata (4.2.0)
   1: fact: autosubliminal depends on jsonpickle (2.0.0)
   1: fact: autosubliminal depends on langdetect (1.0.9)
   1: fact: autosubliminal depends on pysrt (1.1.2)
   1: fact: autosubliminal depends on python-anticaptcha (0.7.1)
   1: fact: autosubliminal depends on python-dateutil (2.8.2)
   1: fact: autosubliminal depends on python-twitter (3.5)
   1: fact: autosubliminal depends on pywin32 (302)
   1: fact: autosubliminal depends on rebulk (3.1.0)
   1: fact: autosubliminal depends on requests (2.26.0)
   1: fact: autosubliminal depends on requests-oauthlib (1.3.0)
   1: fact: autosubliminal depends on schema (0.7.4)
   1: fact: autosubliminal depends on simplejson (3.17.5)
   1: fact: autosubliminal depends on subliminal (rev 6ac2fa23ee5baa7d8452552edaa7c4a8a00d237a)
   1: fact: autosubliminal depends on tailer (0.4.1)
   1: fact: autosubliminal depends on tvdb_api (rev 1210df9dd5869ccc5b63149b1b80630310a14f40)
   1: fact: autosubliminal depends on unidecode (1.3.2)
   1: fact: autosubliminal depends on ws4py (0.5.1)
   1: fact: autosubliminal depends on coverage (6.1.2)
   1: fact: autosubliminal depends on coveralls (3.3.1)
   1: fact: autosubliminal depends on pytest (6.2.5)
   1: fact: autosubliminal depends on pytest-mock (3.6.1)
   1: fact: autosubliminal depends on requests-mock (1.9.3)
   1: fact: autosubliminal depends on vcrpy (4.1.1)
   1: fact: autosubliminal depends on autopep8 (1.6.0)
   1: fact: autosubliminal depends on flake8 (4.0.1)
   1: fact: autosubliminal depends on isort (5.8.0)
   1: fact: autosubliminal depends on pigar (0.10.0)
   1: fact: autosubliminal depends on coverage (6.1.2)
   1: fact: autosubliminal depends on coveralls (3.3.1)
   1: fact: autosubliminal depends on pytest (6.2.5)
   1: fact: autosubliminal depends on pytest-mock (3.6.1)
   1: fact: autosubliminal depends on requests-mock (1.9.3)
   1: fact: autosubliminal depends on vcrpy (4.1.1)
   1: fact: autosubliminal depends on autopep8 (1.6.0)
   1: fact: autosubliminal depends on flake8 (4.0.1)
   1: fact: autosubliminal depends on isort (5.8.0)
   1: fact: autosubliminal depends on pigar (0.10.0)
   1: selecting autosubliminal (0.0.0)
   1: derived: pigar (==0.10.0)
   1: derived: isort (==5.8.0)
   1: derived: flake8 (==4.0.1)
   1: derived: autopep8 (==1.6.0)
   1: derived: vcrpy (==4.1.1)
   1: derived: requests-mock (==1.9.3)
   1: derived: pytest-mock (==3.6.1)
   1: derived: pytest (==6.2.5)
   1: derived: coveralls (==3.3.1)
   1: derived: coverage (==6.1.2)
   1: derived: ws4py (==0.5.1)
   1: derived: unidecode (==1.3.2)
   1: derived: tvdb_api (3.0.0 git rev 1210df9dd5869ccc5b63149b1b80630310a14f40)
   1: derived: tailer (==0.4.1)
   1: derived: subliminal (2.1.0.dev0 git rev 6ac2fa23ee5baa7d8452552edaa7c4a8a00d237a)
   1: derived: simplejson (==3.17.5)
   1: derived: schema (==0.7.4)
   1: derived: requests-oauthlib (==1.3.0)
   1: derived: requests (==2.26.0)
   1: derived: rebulk (==3.1.0)
   1: derived: pywin32 (==302)
   1: derived: python-twitter (==3.5)
   1: derived: python-dateutil (==2.8.2)
   1: derived: python-anticaptcha (==0.7.1)
   1: derived: pysrt (==1.1.2)
   1: derived: langdetect (==1.0.9)
   1: derived: jsonpickle (==2.0.0)
   1: derived: importlib-metadata (==4.2.0)
   1: derived: imdbpie (5.6.4.dev0 git rev 75c300af1bf87c49baef09f17002a3e35b0ed3cc)
   1: derived: html5lib (==1.1)
   1: derived: guessit (==3.4.2)
   1: derived: gntp (==1.0.3)
   1: derived: GitPython (==3.1.20)
   1: conflict: autosubliminal depends on gitpython (3.1.18)
   1: ! not  gitpython (3.1.18) is satisfied by  GitPython (3.1.20)
   1: ! which is caused by "autosubliminal depends on GitPython (3.1.20)"
   1: ! thus: version solving failed
   1: Version solving took 64.837 seconds.
   1: Tried 1 solutions.

  Stack trace:

  8  ~\AppData\Roaming\pypoetry\venv\lib\site-packages\clikit\console_application.py:131 in run
      129│             parsed_args = resolved_command.args
      130│
    → 131│             status_code = command.handle(parsed_args, io)
      132│         except KeyboardInterrupt:
      133│             status_code = 1

  7  ~\AppData\Roaming\pypoetry\venv\lib\site-packages\clikit\api\command\command.py:120 in handle
      118│     def handle(self, args, io):  # type: (Args, IO) -> int
      119│         try:
    → 120│             status_code = self._do_handle(args, io)
      121│         except KeyboardInterrupt:
      122│             if io.is_debug():

  6  ~\AppData\Roaming\pypoetry\venv\lib\site-packages\clikit\api\command\command.py:171 in _do_handle
      169│         handler_method = self._config.handler_method
      170│
    → 171│         return getattr(handler, handler_method)(args, io, self)
      172│
      173│     def __repr__(self):  # type: () -> str

  5  ~\AppData\Roaming\pypoetry\venv\lib\site-packages\cleo\commands\command.py:92 in wrap_handle
       90│         self._command = command
       91│
    →  92│         return self.handle()
       93│
       94│     def handle(self):  # type: () -> Optional[int]

  4  ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\console\commands\add.py:173 in handle
      171│             self._installer.whitelist([r["name"] for r in requirements])
      172│
    → 173│             status = self._installer.run()
      174│         except BaseException:
      175│             # Using BaseException here as some exceptions, eg: KeyboardInterrupt, do not inherit from Exception

  3  ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\installation\installer.py:103 in run
      101│         local_repo = Repository()
      102│
    → 103│         return self._do_install(local_repo)
      104│
      105│     def dry_run(self, dry_run=True):  # type: (bool) -> Installer

  2  ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\installation\installer.py:235 in _do_install
      233│             )
      234│
    → 235│             ops = solver.solve(use_latest=self._whitelist)
      236│         else:
      237│             self._io.write_line("Installing dependencies from lock file")

  1  ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\puzzle\solver.py:65 in solve
       63│         with self._provider.progress():
       64│             start = time.time()
    →  65│             packages, depths = self._solve(use_latest=use_latest)
       66│             end = time.time()
       67│

  SolverProblemError

  Because autosubliminal depends on both gitpython (3.1.18) and GitPython (3.1.20), version solving failed.

  at ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\puzzle\solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes
@h3llrais3r h3llrais3r added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 15, 2021
h3llrais3r added a commit to h3llrais3r/Auto-Subliminal that referenced this issue Nov 16, 2021
@jaens
Copy link

jaens commented Nov 22, 2021

The casing is also not normalized with the poetry init command - when interactively adding dependencies there, the dependencies get directly written with the case as entered, but later adding dependencies with poetry add will normalize the case - leading again to this issue.

@mkniewallner
Copy link
Member

This has since been fixed by #5700, which was released in 1.2.0b2.

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jul 9, 2022
Copy link

github-actions bot commented Mar 1, 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 1, 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