From 8943caa113c4143e65dd3bcce512f342381c1d39 Mon Sep 17 00:00:00 2001 From: Denis Arrivault <denis.arrivault@lif.univ-mrs.fr> Date: Wed, 26 Apr 2017 18:07:30 +0200 Subject: [PATCH] Up with a setup approach --- .gitignore | 2 +- .gitlab-ci.yml | 25 +++++++++++++++++++++---- setup.py | 20 ++++++++++---------- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 24b79a0..78fa932 100644 --- a/.gitignore +++ b/.gitignore @@ -84,7 +84,7 @@ pytests_results.txt .coverage .html .png -htmlcov/ +.eggs LtfatPyt.egg-info/ .cache/ dist/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b78507d..e0fea78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - build - test + - dist # Global runner/docker image definition image: ubuntu:latest @@ -28,20 +29,36 @@ build: tags: - docker script: - - pip3 install -e . + - python setup.py install # Tests test: stage: test tags: - docker - dependencies: - - build script: + - python setup.py test + artifacts: + when: always + untracked: true + paths: + - build/ + expire_in: 8d + +# Installation and test with pip +dist: + stage: dist + tags: + - docker + script: + - pip install -e . - nosetests artifacts: when: always untracked: true paths: - build/ - expire_in: 8d \ No newline at end of file + expire_in: 8d + +after_script: + - pip3 uninstall ltfatpy \ No newline at end of file diff --git a/setup.py b/setup.py index cf02de4..48839a8 100755 --- a/setup.py +++ b/setup.py @@ -129,7 +129,7 @@ def run_cmake(root_dir): except ds.DistutilsExecError: print("Error while running cmake") print("run 'setup.py build --help' for build options") - print("You may also try editing the settings in CMakeLists.txt file " + + print("You may also try editing the settings in CMakeLists.txt file " + "and re-running setup") sys.exit(-1) @@ -147,7 +147,7 @@ def run_make(root_dir): except ds.DistutilsExecError: print("Error while running make") print("run 'setup.py build --help' for build options") - print("You may also try editing the settings in CMakeLists.txt file " + + print("You may also try editing the settings in CMakeLists.txt file " + "and re-running setup") sys.exit(-1) @@ -166,7 +166,7 @@ def run_make_install(root_dir): except ds.DistutilsExecError: print("Error while running make install") print("run 'setup.py build --help' for build options") - print("You may also try editing the settings in CMakeLists.txt file " + + print("You may also try editing the settings in CMakeLists.txt file " + "and re-running setup") sys.exit(-1) @@ -184,7 +184,7 @@ def run_uninstall(root_dir): except ds.DistutilsExecError: print("Error while running make uninstall") print("run 'setup.py build --help' for build options") - print("You may also try editing the settings in CMakeLists.txt file " + + print("You may also try editing the settings in CMakeLists.txt file " + "and re-running setup") sys.exit(-1) @@ -313,8 +313,8 @@ def setup_package(): setup(name="ltfatpy", version=VERSION, description='The Large Time-Frequency Toolbox (LTFAT) in Python', - long_description=(read('README.rst') + '\n\n' + - read('HISTORY.rst') + '\n\n' + + long_description=(read('README.rst') + '\n\n' + + read('HISTORY.rst') + '\n\n' + read('AUTHORS.rst')), packages=find_packages(), package_data={'ltfatpy.signals': ['*.wav'], @@ -323,11 +323,11 @@ def setup_package(): url="https://gitlab.lif.univ-mrs.fr/dev/ltfatpy", license='GNU GPL V3', author='Denis Arrivault and Florent Jaillet', - author_email='denis.arrivault@lif.univ-mrs.fr ' + + author_email='denis.arrivault@lif.univ-mrs.fr ' + 'florent.jaillet@lif.univ-mrs.fr', - # install_requires=['numpy'], ext_modules=extensions, - tests_require=['pytest'], + test_suite='nose.collector', + tests_require=['nose', 'coverage'], cmdclass={'build_ext': m_build_ext, 'clean': m_clean, 'sdist': m_sdist}, classifiers=['Development Status :: 5 - Production/Stable', @@ -344,7 +344,7 @@ def setup_package(): 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering' ], - install_requires=['numpy>=1.8', 'matplotlib>=1.4', 'six>=1.10'], + install_requires=['scipy>=0.18', 'numpy>=1.8', 'matplotlib>=1.4', 'six>=1.10'], ) -- GitLab