diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d5cbdee --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: Lintbb +on: [push] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install . + - name: Lint with Ruff + run: | + pip install ruff + ruff --output-format=github . + continue-on-error: true \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..919948f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +name: Build +on: [push] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + conda-deps: + - python=3.6 pandas=1.0 matplotlib=2.1.2 numpy=1.17 + - pandas matplotlib numpy + steps: + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + - name: conda debug info + shell: bash -el {0} + run: conda info -a + - name: install + shell: bash -el {0} + run: | + conda install pytest pytest-cov coveralls ${{ matrix.conda-deps }} + python setup.py install + cp ci/matplotlibrc matplotlibrc + - name: test + shell: bash -el {0} + run: pytest + - name: Coveralls + uses: coverallsapp/github-action@v2 \ No newline at end of file diff --git a/.gitignore b/.gitignore index cfbfa36..f4f34a3 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ .ipynb_checkpoints .tags .cache/ +.direnv/ # Compiled source # ################### @@ -84,3 +85,4 @@ Thumbs.db *.cpp .pytest_cache +.envrc diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 52097b2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: generic - -install: - - test -x $HOME/miniconda/bin/conda || (sudo apt-get update; wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; bash miniconda.sh -u -b -p $HOME/miniconda) - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - # Useful for debugging any issues with conda - - conda info -a - - - conda create -c conda-forge -q -n test-environment $CONDA_DEPS $FIXED_CONDA_DEPS - - source activate test-environment - - python setup.py install - - pip list - - cp ci/matplotlibrc matplotlibrc -script: - - pytest - - pip install flake8 # fixes issue with missing typing import - - flake8 -after_success: - - coveralls - -env: - global: - - FIXED_CONDA_DEPS="flake8 pytest pytest-cov<2.6 coveralls" -matrix: - include: - - env: CONDA_DEPS="python=3.6 pandas=1.0 matplotlib=2.1.2 numpy=1.17" - - env: CONDA_DEPS="python=3.10 pandas matplotlib seaborn" - - env: CONDA_DEPS="python pandas matplotlib seaborn scikit-learn" # extra deps to run examples - -branches: - only: - - master - - /^[0-9]+\.[0-9]+.*$/ diff --git a/README.rst b/README.rst index 9f5505d..e56155e 100644 --- a/README.rst +++ b/README.rst @@ -164,10 +164,10 @@ References :alt: Latest version on PyPi :target: https://badge.fury.io/py/UpSetPlot -.. |build| image:: https://travis-ci.org/jnothman/UpSetPlot.svg?branch=master - :alt: Travis CI build status +.. |build| image:: https://github.com/jnothman/upsetplot/actions/workflows/test.yml/badge.svg + :alt: Github Workflows CI build status :scale: 100% - :target: https://travis-ci.org/jnothman/UpSetPlot + :target: https://github.com/jnothman/UpSetPlot/actions/workflows/test.yml .. |issues| image:: https://img.shields.io/github/issues/jnothman/UpSetPlot.svg :alt: Issue tracker diff --git a/upsetplot/tests/test_data.py b/upsetplot/tests/test_data.py index 5937762..07611de 100644 --- a/upsetplot/tests/test_data.py +++ b/upsetplot/tests/test_data.py @@ -3,7 +3,7 @@ import pandas as pd import numpy as np from distutils.version import LooseVersion -from pandas.util.testing import (assert_series_equal, assert_frame_equal, +from pandas.testing import (assert_series_equal, assert_frame_equal, assert_index_equal) from upsetplot import (from_memberships, from_contents, from_indicators, generate_data) diff --git a/upsetplot/tests/test_reformat.py b/upsetplot/tests/test_reformat.py index 684751f..3e171b2 100644 --- a/upsetplot/tests/test_reformat.py +++ b/upsetplot/tests/test_reformat.py @@ -1,6 +1,6 @@ import pytest import pandas as pd -from pandas.util.testing import assert_series_equal, assert_frame_equal +from pandas.testing import assert_series_equal, assert_frame_equal from upsetplot import generate_counts, generate_samples from upsetplot import query diff --git a/upsetplot/tests/test_upsetplot.py b/upsetplot/tests/test_upsetplot.py index 2ee0e6e..cd73196 100644 --- a/upsetplot/tests/test_upsetplot.py +++ b/upsetplot/tests/test_upsetplot.py @@ -2,7 +2,7 @@ import itertools import pytest -from pandas.util.testing import ( +from pandas.testing import ( assert_series_equal, assert_frame_equal, assert_index_equal) from numpy.testing import assert_array_equal import pandas as pd