eric7/PipInterface/Pip.py

branch
eric7
changeset 8976
ca442cd49b9e
parent 8973
ad4848b7fd9b
child 8977
663521af48b2
equal deleted inserted replaced
8975:ae4c3da05550 8976:ca442cd49b9e
769 data = json.loads(dataStr) 769 data = json.loads(dataStr)
770 result = list(data["releases"].keys()) 770 result = list(data["releases"].keys())
771 771
772 return result 772 return result
773 773
774 def getFrozenPackages(self, envName, localPackages=True, usersite=False,
775 requirement=None):
776 """
777 Public method to get the list of package specifiers to freeze them.
778
779 @param envName name of the environment to get the package specifiers
780 for
781 @type str
782 @param localPackages flag indicating to get package specifiers for
783 local packages only
784 @type bool
785 @param usersite flag indicating to get package specifiers for packages
786 installed in user-site only
787 @type bool
788 @param requirement name of a requirements file
789 @type str
790 @return list of package specifiers
791 @rtype list of str
792 """
793 specifiers = []
794
795 if envName:
796 interpreter = self.getVirtualenvInterpreter(envName)
797 if interpreter:
798 args = [
799 "-m", "pip",
800 "freeze",
801 ]
802 if localPackages:
803 args.append("--local")
804 if usersite:
805 args.append("--user")
806 if requirement and os.path.exists(requirement):
807 args.append("--requirement")
808 args.append(requirement)
809
810 success, output = self.runProcess(args, interpreter)
811 if success and output:
812 specifiers = [spec.strip() for spec in output.splitlines()
813 if spec.strip()]
814
815 return specifiers
816
774 ####################################################################### 817 #######################################################################
775 ## Cache handling methods below 818 ## Cache handling methods below
776 ####################################################################### 819 #######################################################################
777 820
778 def showCacheInfo(self, venvName): 821 def showCacheInfo(self, venvName):

eric ide

mercurial