From: PASCALE NOYRET Date: Wed, 26 Jan 2022 18:04:51 +0000 (+0100) Subject: setup.py X-Git-Tag: merge_uncertainty_odysee_1210~130 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4a42e2017e85263046336a3977dc7b6a643d147f;p=tools%2Feficas.git setup.py --- diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..eecde223 --- /dev/null +++ b/setup.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +"""Installation script of the package.""" + +# TO DO. ajouter des options --with-qt, --with-fancyTree... +# enlever la directory reacteurNumerique ? + +from setuptools import setup, find_packages +from sphinx.setup_command import BuildDoc +from InterfaceQT4 import getVersion +from pyqt_distutils.build_ui import build_ui + +import os +import pathlib + +maVersion = getVersion.getEficasVersion() +cmdclass = {'build_sphinx': BuildDoc } +# 'build_ui': build_ui} + +def package_files(directory,extension=None): + paths = [] + for (path, directories, filenames) in os.walk(directory): + for filename in filenames: + if extension==None : paths.append(os.path.join('..', path, filename)) + elif pathlib.Path(filename).suffix == extension : paths.append(os.path.join('..', path, filename)) + return paths + +doc_files = package_files('Doc') +aide_files = package_files('Aide') +rn_files = package_files('ReacteurNumerique') +#ui_files = package_files('UiQT5', '.ui') +pyui_files = package_files('UiQT5', '.py') +icons_files = package_files('Editeur/icons') + +packages_data_files = doc_files + aide_files + rn_files + pyui_files + icons_files + +setup( + name="eficas_RN", + version=maVersion, + author="Pascale Noyret", + author_email="pascale.noyret@edf.fr", + description=( + "Tool used by the Réacteur Numérique project to " + "check data validity. also provides an GUI for setting up cases"), + + packages = find_packages( + include=['Accas','Editeur', 'Efi2Xsd', 'Extensions', 'Ihm', 'InterfaceQT4', 'Noyau', 'Validation'], + exclude=['convert', 'generator'], + ), + data_files=[('convert',['convert/parseur_python.py', 'convert/__init__.py', 'convert/convert_pyth.py','convert/convert_python.py', 'convert/autre_parseur.py']), + ('generator',['generator/Formatage.py', 'generator/generator_aplat.py', 'generator/generator_python.py', 'generator/generator_XML.py', 'generator/__init__.py']), + ], + + package_data = {'': packages_data_files ,}, + + cmdclass=cmdclass, + command_options={ + 'build_sphinx': { + 'project': ('setup.py', u'Eficas IHM'), + 'version': ('setup.py', maVersion), + 'source_dir': ('setup.py', 'Doc')}, + 'build_ui': { + 'source_dir': ('setup.py', 'UiQT5')} + }, + install_requires=[ + "sphinx>=1.0.1", + ], + python_requires=">=3.1" +)