python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.76k stars 2.27k forks source link

poetry self update --preview fail on Opensuse Tumbleweed #4620

Closed mess-maker closed 2 years ago

mess-maker commented 3 years ago

Issue

fresh install of poetry using install-poetry.py script trying to update to the lastest preview version via poetry self update --preview fail

mess-maker@localhost ~> poetry --version
Poetry version 1.1.11
mess-maker@localhost ~> poetry self update --preview -vvv
Updating Poetry to 1.2.0a2

Updating dependencies
Resolving dependencies...
   1: fact: poetry-updater is 0.0.0
   1: derived: poetry-updater
   1: fact: poetry-updater depends on poetry (1.2.0a2)
   1: selecting poetry-updater (0.0.0)
   1: derived: poetry (==1.2.0a2)
   1: fact: poetry (1.2.0a2) depends on poetry-core (>=1.1.0a6,<2.0.0)
   1: fact: poetry (1.2.0a2) depends on cleo (>=1.0.0a4,<2.0.0)
   1: fact: poetry (1.2.0a2) depends on crashtest (>=0.3.0,<0.4.0)
   1: fact: poetry (1.2.0a2) depends on requests (>=2.18,<3.0)
   1: fact: poetry (1.2.0a2) depends on cachy (>=0.3.0,<0.4.0)
   1: fact: poetry (1.2.0a2) depends on requests-toolbelt (>=0.9.1,<0.10.0)
   1: fact: poetry (1.2.0a2) depends on cachecontrol (>=0.12.4,<0.13.0)
   1: fact: poetry (1.2.0a2) depends on pkginfo (>=1.5,<2.0)
   1: fact: poetry (1.2.0a2) depends on html5lib (>=1.0,<2.0)
   1: fact: poetry (1.2.0a2) depends on shellingham (>=1.1,<2.0)
   1: fact: poetry (1.2.0a2) depends on tomlkit (>=0.7.0,<1.0.0)
   1: fact: poetry (1.2.0a2) depends on pexpect (>=4.7.0,<5.0.0)
   1: fact: poetry (1.2.0a2) depends on packaging (>=20.4,<21.0)
   1: fact: poetry (1.2.0a2) depends on virtualenv (>=20.4.3,<20.4.5)
   1: fact: poetry (1.2.0a2) depends on keyring (>=21.2.0)
   1: fact: poetry (1.2.0a2) depends on entrypoints (>=0.3,<0.4)
   1: selecting poetry (1.2.0a2)
   1: derived: entrypoints (>=0.3,<0.4)
   1: derived: keyring (>=21.2.0)
   1: derived: virtualenv (>=20.4.3,<20.4.5)
   1: derived: packaging (>=20.4,<21.0)
   1: derived: pexpect (>=4.7.0,<5.0.0)
   1: derived: tomlkit (>=0.7.0,<1.0.0)
   1: derived: shellingham (>=1.1,<2.0)
   1: derived: html5lib (>=1.0,<2.0)
   1: derived: pkginfo (>=1.5,<2.0)
   1: derived: cachecontrol[filecache] (>=0.12.4,<0.13.0)
   1: derived: requests-toolbelt (>=0.9.1,<0.10.0)
   1: derived: cachy (>=0.3.0,<0.4.0)
   1: derived: requests (>=2.18,<3.0)
   1: derived: crashtest (>=0.3.0,<0.4.0)
   1: derived: cleo (>=1.0.0a4,<2.0.0)
   1: derived: poetry-core (>=1.1.0a6,<2.0.0)
   1: selecting entrypoints (0.3)
   1: fact: requests-toolbelt (0.9.1) depends on requests (>=2.0.1,<3.0.0)
   1: selecting requests-toolbelt (0.9.1)
   1: selecting cachy (0.3.0)
   1: fact: cleo (1.0.0a4) depends on pylev (>=1.3.0,<2.0.0)
   1: fact: cleo (1.0.0a4) depends on crashtest (>=0.3.1,<0.4.0)
   1: selecting cleo (1.0.0a4)
   1: derived: crashtest (>=0.3.1,<0.4.0)
   1: derived: pylev (>=1.3.0,<2.0.0)
   1: selecting crashtest (0.3.1)
   1: selecting poetry-core (1.1.0a6)
   1: fact: virtualenv (20.4.4) depends on appdirs (>=1.4.3,<2)
   1: fact: virtualenv (20.4.4) depends on distlib (>=0.3.1,<1)
   1: fact: virtualenv (20.4.4) depends on filelock (>=3.0.0,<4)
   1: fact: virtualenv (20.4.4) depends on six (>=1.9.0,<2)
   1: selecting virtualenv (20.4.4)
   1: derived: six (>=1.9.0,<2)
   1: derived: filelock (>=3.0.0,<4)
   1: derived: distlib (>=0.3.1,<1)
   1: derived: appdirs (>=1.4.3,<2)
   1: fact: pexpect (4.8.0) depends on ptyprocess (>=0.5)
   1: selecting pexpect (4.8.0)
   1: derived: ptyprocess (>=0.5)
   1: selecting pylev (1.4.0)
   1: selecting appdirs (1.4.4)
   1: selecting tomlkit (0.7.2)
   1: fact: html5lib (1.1) depends on six (>=1.9)
   1: fact: html5lib (1.1) depends on webencodings (*)
   1: selecting html5lib (1.1)
   1: derived: webencodings
   1: fact: cachecontrol (0.12.6) depends on cachecontrol (0.12.6)
   1: fact: cachecontrol (0.12.6) depends on requests (*)
   1: fact: cachecontrol (0.12.6) depends on msgpack (>=0.5.2)
   1: fact: cachecontrol (0.12.6) depends on lockfile (>=0.9)
   1: selecting cachecontrol[filecache] (0.12.6)
   1: derived: lockfile (>=0.9)
   1: derived: msgpack (>=0.5.2)
   1: derived: cachecontrol (==0.12.6)
   1: selecting distlib (0.3.3)
   1: selecting ptyprocess (0.7.0)
   1: fact: packaging (20.9) depends on pyparsing (>=2.0.2)
   1: selecting packaging (20.9)
   1: derived: pyparsing (>=2.0.2)
   1: selecting pkginfo (1.7.1)
   1: selecting webencodings (0.5.1)
   1: selecting six (1.16.0)
   1: selecting msgpack (1.0.2)
   1: selecting filelock (3.3.0)
   1: selecting shellingham (1.4.0)
   1: fact: requests (2.26.0) depends on urllib3 (>=1.21.1,<1.27)
   1: fact: requests (2.26.0) depends on certifi (>=2017.4.17)
   1: fact: requests (2.26.0) depends on charset-normalizer (>=2.0.0,<2.1.0)
   1: fact: requests (2.26.0) depends on idna (>=2.5,<4)
   1: selecting requests (2.26.0)
   1: derived: idna (>=2.5,<4)
   1: derived: charset-normalizer (>=2.0.0,<2.1.0)
   1: derived: certifi (>=2017.4.17)
   1: derived: urllib3 (>=1.21.1,<1.27)
   1: fact: keyring (23.2.1) depends on importlib-metadata (>=3.6)
   1: fact: keyring (23.2.1) depends on SecretStorage (>=3.2)
   1: fact: keyring (23.2.1) depends on jeepney (>=0.4.2)
   1: fact: keyring (23.2.1) depends on pywin32-ctypes (<0.1.0 || >0.1.0,<0.1.1 || >0.1.1)
   1: selecting keyring (23.2.1)
   1: derived: pywin32-ctypes (!=0.1.0,!=0.1.1)
   1: derived: jeepney (>=0.4.2)
   1: derived: SecretStorage (>=3.2)
   1: derived: importlib-metadata (>=3.6)
   1: selecting certifi (2021.10.8)
   1: selecting urllib3 (1.26.7)
   1: fact: importlib-metadata (4.8.1) depends on zipp (>=0.5)
   1: selecting importlib-metadata (4.8.1)
   1: derived: zipp (>=0.5)
   1: selecting zipp (3.6.0)
   1: selecting pyparsing (2.4.7)
   1: fact: cachecontrol (0.12.6) depends on requests (*)
   1: fact: cachecontrol (0.12.6) depends on msgpack (>=0.5.2)
   1: selecting cachecontrol (0.12.6)
   1: selecting pywin32-ctypes (0.2.0)
   1: fact: secretstorage (3.3.1) depends on cryptography (>=2.0)
   1: fact: secretstorage (3.3.1) depends on jeepney (>=0.6)
   1: selecting secretstorage (3.3.1)
   1: derived: jeepney (>=0.6)
   1: derived: cryptography (>=2.0)
   1: selecting cryptography (35.0.0)
   1: selecting jeepney (0.7.1)
   1: selecting lockfile (0.12.2)
   1: selecting charset-normalizer (2.0.6)
   1: selecting idna (3.2)
   1: Version solving took 4.076 seconds.
   1: Tried 1 solutions.

Finding the necessary packages for the current system

Package operations: 27 installs, 9 updates, 0 removals

  - Updating certifi (2021.5.30 /usr/lib/python3.8/site-packages -> 2021.10.8)

  Stack trace:

  17  .local/share/pypoetry/venv/lib/python3.8/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

  16  .local/share/pypoetry/venv/lib/python3.8/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():

  15  .local/share/pypoetry/venv/lib/python3.8/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

  14  .local/share/pypoetry/venv/lib/python3.8/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]

  13  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/commands/self/update.py:195 in handle
       193│ 
       194│         if new_update_method:
     → 195│             return self.update_with_new_method(release.version)
       196│ 
       197│         self.update(release)

  12  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/commands/self/update.py:239 in update_with_new_method
       237│         self.line("")
       238│ 
     → 239│         self._update_with_new_method(version)
       240│         self._make_bin()
       241│ 

  11  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/commands/self/update.py:343 in _update_with_new_method
       341│         )
       342│         installer.update(True)
     → 343│         installer.run()
       344│ 
       345│     def _make_bin(self):

  10  .local/share/pypoetry/venv/lib/python3.8/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

   9  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/installer.py:313 in _do_install
       311│ 
       312│         # Execute operations
     → 313│         return self._execute(ops)
       314│ 
       315│     def _write_lock_file(self, repo, force=True):  # type: (Repository, bool) -> None

   8  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/installer.py:367 in _execute
       365│ 
       366│         for op in operations:
     → 367│             self._execute_operation(op)
       368│ 
       369│         return 0

   7  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/installer.py:377 in _execute_operation
       375│         method = operation.job_type
       376│ 
     → 377│         getattr(self, "_execute_{}".format(method))(operation)
       378│ 
       379│     def _execute_install(self, operation):  # type: (Install) -> None

   6  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/installer.py:432 in _execute_update
       430│             return
       431│ 
     → 432│         self._installer.update(source, target)
       433│ 
       434│     def _execute_uninstall(self, operation):  # type: (Uninstall) -> None

   5  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/pip_installer.py:102 in update
       100│             # If the source type has changed, we remove the current
       101│             # package to avoid perpetual updates in some cases
     → 102│             self.remove(package)
       103│ 
       104│         self.install(target, update=True)

   4  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/pip_installer.py:108 in remove
       106│     def remove(self, package):
       107│         try:
     → 108│             self.run("uninstall", package.name, "-y")
       109│         except CalledProcessError as e:
       110│             if "not installed" in str(e):

   3  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/pip_installer.py:129 in run
       127│ 
       128│     def run(self, *args, **kwargs):  # type: (...) -> str
     → 129│         return self._env.run_pip(*args, **kwargs)
       130│ 
       131│     def requirement(self, package, formatted=False):

   2  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/utils/env.py:1148 in run_pip
       1146│         pip = self.get_pip_command()
       1147│         cmd = pip + list(args)
     → 1148│         return self._run(cmd, **kwargs)
       1149│ 
       1150│     def run_python_script(self, content, **kwargs):  # type: (str, Any) -> str

   1  .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/utils/env.py:1554 in _run
       1552│ 
       1553│     def _run(self, cmd, **kwargs):  # type: (List[str], Any) -> Optional[int]
     → 1554│         return super(VirtualEnv, self)._run(cmd, **kwargs)
       1555│ 
       1556│     def is_venv(self):  # type: () -> bool

  EnvCommandError

  Command ['/usr/bin/pip3.8', 'uninstall', 'certifi', '-y'] errored with the following return code 2, and output: 
  Found existing installation: certifi 2021.5.30
  Uninstalling certifi-2021.5.30:
  ERROR: Exception:
  Traceback (most recent call last):
    File "/usr/lib64/python3.8/shutil.py", line 791, in move
      os.rename(src, real_dst)
  OSError: [Errno 18] Invalid cross-device link: '/usr/lib/python3.8/site-packages/certifi' -> '/tmp/pip-uninstall-_e7e79h4'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
      status = self.run(options, args)
    File "/usr/lib/python3.8/site-packages/pip/_internal/commands/uninstall.py", line 89, in run
      uninstall_pathset = req.uninstall(
    File "/usr/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 686, in uninstall
      uninstalled_pathset.remove(auto_confirm, verbose)
    File "/usr/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", line 394, in remove
      moved.stash(path)
    File "/usr/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", line 283, in stash
      renames(path, new_path)
    File "/usr/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 352, in renames
      shutil.move(old, new)
    File "/usr/lib64/python3.8/shutil.py", line 809, in move
      rmtree(src)
    File "/usr/lib64/python3.8/shutil.py", line 718, in rmtree
      _rmtree_safe_fd(fd, path, onerror)
    File "/usr/lib64/python3.8/shutil.py", line 655, in _rmtree_safe_fd
      _rmtree_safe_fd(dirfd, fullname, onerror)
    File "/usr/lib64/python3.8/shutil.py", line 675, in _rmtree_safe_fd
      onerror(os.unlink, fullname, sys.exc_info())
    File "/usr/lib64/python3.8/shutil.py", line 673, in _rmtree_safe_fd
      os.unlink(entry.name, dir_fd=topfd)
  PermissionError: [Errno 13] Permission denied: '__init__.cpython-38.opt-1.pyc'

  at .local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/utils/env.py:1183 in _run
      1179│                 output = subprocess.check_output(
      1180│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1181│                 )
      1182│         except CalledProcessError as e:
    → 1183│             raise EnvCommandError(e, input=input_)
      1184│ 
      1185│         return decode(output)
      1186│ 
      1187│     def execute(self, bin, *args, **kwargs):
finswimmer commented 2 years ago

Hello @mess-maker ,

you haven't come back to this issue for a long while. So I assume this is solved in the meantime and I can close this ticket.

Feel free to leave a comment if you disagree.

fin swimmer

github-actions[bot] commented 8 months ago

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.