def __init__(self): self._config_dir = os.getcwd() self._config_name = 'Project.yml' self._release_dir = os.path.join(self._config_dir, 'App') self._release_name = 'Release.yml' # load external config self.__dict__ = self._loadYaml([self._config_dir, self._release_dir], [self._config_name, self._release_name]) # project self.__dict__['project']['dir_path'] = os.getcwd() # ??? self._config_dir self.__dict__['project']['subdirs']['app']['path'] = self._absolutePath(self.__dict__['project']['subdirs']['app']['name']) self.__dict__['project']['subdirs']['distribution']['path'] = self._absolutePath(self.__dict__['project']['subdirs']['distribution']['name']) self.__dict__['project']['subdirs']['scripts']['path'] = self._absolutePath(self.__dict__['project']['subdirs']['scripts']['name']) self.__dict__['project']['subdirs']['certificates']['path'] = self._absolutePath(self.__dict__['project']['subdirs']['certificates']['name']) self.__dict__['project']['subdirs']['examples']['path'] = self._absolutePath(self.__dict__['project']['subdirs']['examples']['name']) self.__dict__['os']['name'] = BasicFunctions.osName() # scripts self.__dict__['scripts']['silent_install'] = os.path.join(self.__dict__['project']['subdirs']['scripts']['path'], 'SilentInstall.js') # scripts self.__dict__['certificate']['path'] = os.path.join(self.__dict__['project']['subdirs']['certificates']['path'], self.__dict__['certificate']['name'][BasicFunctions.osName()]) self.__dict__['certificate']['zip_path'] = os.path.join(self.__dict__['project']['subdirs']['certificates']['path'], 'codesigning.zip') # user self.__dict__['user']['home_dir'] = os.path.expanduser('~') # freeze self.__dict__['pyinstaller']['lib_path']['cryspy'] = cryspy.__path__[0] self.__dict__['pyinstaller']['lib_path']['easyInterface'] = easyInterface.__path__[0] self.__dict__['pyinstaller']['lib_path']['shiboken2'] = shiboken2.__path__[0] self.__dict__['pyinstaller']['lib_path']['pyside2'] = PySide2.__path__[0] self.__dict__['pyinstaller']['lib_path']['dictdiffer'] = dictdiffer.__path__[0] # freezed app self.__dict__['app']['freezed']['path'] = os.path.join(self.__dict__['project']['subdirs']['distribution']['path'], self.__dict__['app']['name'] + self.__dict__['app']['freezed']['ext'][BasicFunctions.osName()]) # installer framework self.__dict__['qtifw']['setup']['name'] = '{0}.{1}'.format(self.__dict__['qtifw']['setup']['base'][BasicFunctions.osName()], self.__dict__['qtifw']['setup']['ext'][BasicFunctions.osName()]) self.__dict__['qtifw']['setup']['download_url'] = 'https://download.qt.io/official_releases/qt-installer-framework/{0}/{1}'.format(self.__dict__['qtifw']['version'], self.__dict__['qtifw']['setup']['name']) self.__dict__['qtifw']['setup']['download_path'] = os.path.join(self.__dict__['project']['dir_path'], '.soft', self.__dict__['qtifw']['setup']['name']) self.__dict__['qtifw']['setup']['exe_path'] = self._qtifwExe(BasicFunctions.osName()) self.__dict__['qtifw']['bin_dir_path'] = self._qtifwBinDirPath(BasicFunctions.osName()) self.__dict__['qtifw']['dir_path'] = self._qtifwDirPath(BasicFunctions.osName()) self.__dict__['qtifw']['binarycreator_path'] = os.path.join(self.__dict__['qtifw']['bin_dir_path'], 'binarycreator') self.__dict__['qtifw']['installerbase_path'] = os.path.join(self.__dict__['qtifw']['bin_dir_path'], 'installerbase') # installer scripts self.__dict__['installer']['config_control_script']['path'] = os.path.join(self.__dict__['project']['subdirs']['scripts']['path'], self.__dict__['installer']['config_control_script']['name']) self.__dict__['installer']['package_install_script']['path'] = os.path.join(self.__dict__['project']['subdirs']['scripts']['path'], self.__dict__['installer']['package_install_script']['name']) # app installer structure self.__dict__['installer']['dir_name'] = self.__dict__['app']['installer']['name_suffix'] + 'Tmp' self.__dict__['installer']['dir_path'] = os.path.join(self.__dict__['project']['subdirs']['distribution']['path'], self.__dict__['installer']['dir_name']) self.__dict__['installer']['config_dir_path'] = os.path.join(self.__dict__['installer']['dir_path'], 'config') self.__dict__['installer']['config_xml_path'] = os.path.join(self.__dict__['installer']['config_dir_path'], 'config.xml') self.__dict__['installer']['packages_dir_path'] = os.path.join(self.__dict__['installer']['dir_path'], 'packages') self.__dict__['installer']['packages_url_path'] = os.path.join(self.__dict__['installer']['packages_dir_path'], 'org.easydiffraction') self.__dict__['installer']['packages_data_path'] = os.path.join(self.__dict__['installer']['packages_url_path'], 'data') self.__dict__['installer']['packages_meta_path'] = os.path.join(self.__dict__['installer']['packages_url_path'], 'meta') self.__dict__['installer']['package_xml_path'] = os.path.join(self.__dict__['installer']['packages_meta_path'], 'package.xml') # app installer self.__dict__['app']['installer']['name'] = self.__dict__['app']['name'] + self.__dict__['app']['installer']['name_suffix'] self.__dict__['app']['installer']['exe_name'] = self.__dict__['app']['installer']['name'] + self.__dict__['os']['gui_exe_ext'][BasicFunctions.osName()] self.__dict__['app']['installer']['dir_path'] = self.__dict__['project']['subdirs']['distribution']['path'] self.__dict__['app']['installer']['exe_path'] = os.path.join(self.__dict__['app']['installer']['dir_path'], self.__dict__['app']['installer']['exe_name']) self.__dict__['app']['license']['file_path'] = os.path.join(self.__dict__['project']['dir_path'], self.__dict__['app']['license']['file_name'])
dictdiffer_init_py_path = os.path.join( config['pyinstaller']['lib_path']['dictdiffer'], '__init__.py') with open(dictdiffer_init_py_path, 'r') as file: filedata = file.read() filedata = filedata.replace(from_str, to_str) with open(dictdiffer_init_py_path, 'w') as file: file.write(filedata) # MAIN if __name__ == '__main__': BasicFunctions.printTitle('Upgrade PIP and install packages') upgradePip() #installFromGit(owner='ikibalin', repo='cryspy', branch='transition-to-version-0.2') #installFromGit(owner='easyDiffraction', repo='easyInterface', branch='polarisation_start') # Until master branch is uploaded to PIP install('cryspy>=0.2.0', 'scipy>=1.4.1', 'numpy>=1.18.1', 'easyInterface>=0.0.9', 'PySide2>=5.14.1', 'pyinstaller>=3.6', 'requests>=2.23.0', 'uritemplate>=3.0.1', 'pyyaml>=5.3', 'asteval>=0.9.18', 'pytest>=5.3.5', 'pytest_mock>=2.0.0', 'pytest-cov>=2.8.1', 'pytest-qt>=3.3.0', 'wily>=1.16.0', 'codecov>=2.0.16') if BasicFunctions.osName() == 'windows': install('pypiwin32') fixDictdifferNumpy()