diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..503fa8c62 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,97 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: [pull_request] + +jobs: + test_conda: + name: Conda (${{ matrix.python-version }}, ${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + python-version: ["3.7", "3.8"] + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + channels: conda-forge,spyder-ide + channel-priority: flexible + + - name: Conda info + shell: bash -l {0} + run: conda info + - name: Add conda to system path + shell: bash -l {0} + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + shell: bash -l {0} + run: | + conda config --set always_yes yes --set changeps1 no + conda update -n base conda --yes + conda env create -f tests/requirements.txt -n yellowbrick python=${{ matrix.python-version }} + - name: Test with pytest + shell: bash -l {0} + run: | + conda activate yellowbrick + python -m nltk.downloader popular + make test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: false + + + test_pypi: + name: PyPi (${{ matrix.python-version }}, ${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8] + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r tests/requirements.txt + python -m pip install coveralls + - name: Test with pytest + run: | + python -m nltk.downloader popular + make test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: false + + + slackNotification: + name: Slack Notification + needs: [test_pypi, test_conda] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 40315334c..000000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -dist: xenial -language: python -matrix: - include: - - name: "Python 3.7 on Xenial Linux" - python: '3.7' - - - name: "Python 3.8 on Xenial Linux" - python: '3.8' - - - name: "Miniconda 3.7 on Xenial Linux" - env: ANACONDA="3.7" - - - name: "Miniconda 3.8 on Xenial Linux" - env: ANACONDA="3.8" - -before_install: -- sudo apt-get update; -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - sudo apt-get build-dep python-scipy; - MINICONDA_OS="Linux"; - fi - -install: -- if [[ -z ${ANACONDA} ]]; then - pip install -r tests/requirements.txt; - pip install -r requirements.txt; - pip install coveralls; - else - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-$MINICONDA_OS-x86_64.sh -O miniconda.sh; - bash miniconda.sh -b -p $HOME/miniconda; - export PATH="$HOME/miniconda/bin:$PATH"; - hash -r; - conda config --set always_yes yes --set changeps1 no; - export BASE_PYTHON=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`; - echo "Base Anaconda Python is $BASE_PYTHON"; - echo "Creating Anaconda Python $ANACONDA conda environment"; - conda update -n base conda --yes; - conda config --add channels conda-forge; - conda env create -f tests/requirements.txt -n yellowbrick python=$ANACONDA; - source activate yellowbrick; - conda install coveralls; - fi - -script: -- python -m nltk.downloader popular -- make test - -after_success: coveralls - -notifications: - slack: - secure: YvJ/aF5Ev2wgqoSc+QG4LA8XCovdfW7w7FiOMiRA6zrLjywEC12KzVDBTotIRFJVncCmh/WuyTCJUYfYA1Q0MrySpAF8cDr4fdGnO3skopU9Nx7pVuXOrHQ2LcVTEE0sGAeYH+hGrT+7TsbGR9iwki5xkkT0g1QEgJqvLhph6Y6gQMAtPceXU7wnIJf9Fn4IdTrDbeAawxhYsuVLTptGSS9UHYsV0P3lwPg1FItduE1UzNhyicBXzj/8f56/xBxNeYEGwFMhE1oad3lm9BRLzpqGwsIHWR5JLIYcX+y1YceFvB+vz4Xsf6H+XaCCb7uzBfC2BAc9+gr0zjUbiLcTyA1LyuR9kOlFCUx/nSGkJyhXcMb+NbA0vK9JY7ss2kempoxCDCkzpjFNasqGJMyPagI3na8YRu1RTTmBJUip9U+oN80Kr4lSMzbLDCDA2LTQBeL3zSSW51foiQPIDowK/CYQSMo/0IVp2x9ronWhDBbszHkXoWCv6/AMzjGhASDDg4AJD40zLo/pcEevcJdTraO915Sp8PtltbLnuuklJSi1xci5O6ja/ldyC7lKPm77z9nlx805349dLTkNpD27xXpALWPUJBNNrVpD3H6SvYB3b2IVgVjENdHZGLcCjlbwgdZ30zPik4Sj/w+8GoGxh5l/V6wHUhwOMm7ZKr7lcXk= diff --git a/setup.cfg b/setup.cfg index 205435551..4fb393171 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,7 +10,7 @@ tests = True test=pytest [tool:pytest] -addopts = --verbose --cov=yellowbrick --flakes --spec +addopts = --verbose --cov=yellowbrick --flakes --spec --cov-report=xml --cov-report term python_files = tests/* flakes-ignore = __init__.py UnusedImport diff --git a/tests/requirements.txt b/tests/requirements.txt index 09db188f1..87ea5b819 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -14,7 +14,7 @@ cycler==0.10.0 pytest==6.1.1 pytest-cov==2.10.1 pytest-flakes==4.0.2 -pytest-spec==3.0.4 +pytest-spec>=2.0.0 coverage==5.3 # Optional Testing Dependencies