src/eric7/PipInterface/Pip.py

branch
eric7
changeset 10622
eb5303a42b4b
parent 10620
699b5ceb39aa
child 10641
42536596df9e
equal deleted inserted replaced
10621:f5631f40c4d9 10622:eb5303a42b4b
573 "The selected 'pyproject.toml' file does not contain" 573 "The selected 'pyproject.toml' file does not contain"
574 " a 'project.dependencies' section. Aborting..." 574 " a 'project.dependencies' section. Aborting..."
575 ), 575 ),
576 ) 576 )
577 return 577 return
578 except (tomlkit.exceptions.ParseError, OSError) as err: 578 except (OSError, tomlkit.exceptions.ParseError) as err:
579 EricMessageBox.warning( 579 EricMessageBox.warning(
580 None, 580 None,
581 self.tr("Install 'pyproject' Dependencies"), 581 self.tr("Install 'pyproject' Dependencies"),
582 self.tr( 582 self.tr(
583 "<p>The selected 'pyproject.toml' file could not be read." 583 "<p>The selected 'pyproject.toml' file could not be read."
704 " contain a 'project.dependencies' section." 704 " contain a 'project.dependencies' section."
705 " Aborting..." 705 " Aborting..."
706 ), 706 ),
707 ) 707 )
708 return 708 return
709 except (tomlkit.exceptions.ParseError, OSError) as err: 709 except (OSError, tomlkit.exceptions.ParseError) as err:
710 EricMessageBox.warning( 710 EricMessageBox.warning(
711 None, 711 None,
712 self.tr("Uninstall 'pyproject' Dependencies"), 712 self.tr("Uninstall 'pyproject' Dependencies"),
713 self.tr( 713 self.tr(
714 "<p>The selected 'pyproject.toml' file could not be" 714 "<p>The selected 'pyproject.toml' file could not be"
719 719
720 # Do not uninstall pip. 720 # Do not uninstall pip.
721 pipre = re.compile(r"^pip\s*(~=|==|!=|<=|>=|<|>|===)") 721 pipre = re.compile(r"^pip\s*(~=|==|!=|<=|>=|<|>|===)")
722 for dependency in dependencies: 722 for dependency in dependencies:
723 if pipre.search(dependency): 723 if pipre.search(dependency):
724 dependencies.remove(dependency) 724 dependencies.remove(dependency) # noqa: M538
725 break 725 break
726 726
727 dlg = DeleteFilesConfirmationDialog( 727 dlg = DeleteFilesConfirmationDialog(
728 self.parent(), 728 self.parent(),
729 self.tr("Uninstall Packages"), 729 self.tr("Uninstall Packages"),

eric ide

mercurial