From 358f8208a6e9d15810a21398b81172e640a4070f Mon Sep 17 00:00:00 2001 From: felix Date: Wed, 20 Jun 2018 09:58:56 -0400 Subject: [PATCH] Use requirements.txt instead of installing using pip.main - Modified README accordingly - Modified CI files accordingly - Removed pip.main parts in setup script. --- .appveyor.yml | 1 + .travis.yml | 4 ++-- README.rst | 3 ++- requirements.txt | 5 +++++ setup.py | 16 ---------------- 5 files changed, 10 insertions(+), 19 deletions(-) create mode 100644 requirements.txt diff --git a/.appveyor.yml b/.appveyor.yml index 836b036..e1a7c7c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -10,6 +10,7 @@ install: - conda update --yes conda - conda create -y -q -n test-environment python=%PYTHON_VERSION% - activate test-environment + - pip install -r requirements.txt - python setup.py develop test_script: - pytest diff --git a/.travis.yml b/.travis.yml index 2ca3662..70d1ce2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ before_install: - source activate test-environment # install auxiclean package install: + - pip install -r requirements.txt - python setup.py develop # execute tests script: @@ -49,8 +50,7 @@ after_success: before_deploy: - pip install pyinstaller - # there is a bug with pyinstaller and anaconda. Reverting to python 3.6.0 when bundling seems to fix this. - - conda install --yes python==3.6.0 + - conda install --yes python==$TRAVIS_PYTHON_VERSION - python bundle.py deploy: - provider: releases diff --git a/README.rst b/README.rst index 920ece4..008522f 100644 --- a/README.rst +++ b/README.rst @@ -47,8 +47,9 @@ Ensuite, cloner ou télécharger le projet sur le `répertoire officiel `__ du projet sur GitHub et décompresser le fichier si nécéssaire. -Pour installer le module, il faut executer le script d'installation `setup.py`:: +Pour installer le module, il faut d'abord installer les prérequis et ensuite executer le script d'installation `setup.py`:: + $ pip install -r requirements.txt $ python setup.py install Pour une installation de développement, utiliser l'argument ``develop`` au lieu diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..637e584 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +openpyxl +pytest +pytest-cov +coverage +pep8 diff --git a/setup.py b/setup.py index f892708..7622fdf 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,8 @@ from setuptools import setup -import pip import sys import versioneer -def win_pip_install(package, install_list): - if package not in install_list: - return - print("Installing %s using pip instead of setuptools." % package) - pip.main(["install", package]) - install_list.remove(package) - - # package required install_packages = ["openpyxl", # to manage excel spreadsheets ] @@ -26,13 +17,6 @@ def win_pip_install(package, install_list): " purposes:"), develop_packages) install_packages += develop_packages -# if on windows, there is a bug when installing some packages with setuptools. -# installing them with pip before setup fixes this. -problematics = ("coverage", ) -if sys.platform == "win32": - for problematic in problematics: - win_pip_install(problematic, install_packages) - setup(name="auxiclean", version=versioneer.get_version(), description="Distributeur de taches d'auxiliariat d'enseignement",