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/CHANGELOG.rst b/CHANGELOG.rst index c7ec14c..e591711 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,8 @@ What's new in version 0.8 - Added `subsets` attribute to QueryResult. (:issue:`198`) - Fixed a bug where more than 64 categories could result in an error. (:issue:`193`) +Patch release 0.8.1 handles deprecations in dependencies. + What's new in version 0.7 ------------------------- diff --git a/LICENSE b/LICENSE index 978b52a..3ee3098 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ New BSD License -Copyright (c) 2018 Joel Nothman. +Copyright (c) 2018-2023 Joel Nothman. All rights reserved. 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/doc/conf.py b/doc/conf.py index 5cdde3e..92a2790 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -67,7 +67,7 @@ # General information about the project. project = u'upsetplot' -copyright = u'2018-2022, Joel Nothman' +copyright = u'2018-2023, Joel Nothman' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/setup.py b/setup.py index 44edbdf..501a5af 100644 --- a/setup.py +++ b/setup.py @@ -19,8 +19,7 @@ def setup_package(): version=version, packages=["upsetplot"], license='BSD-3-Clause', - setup_requires=['pytest-runner'], - tests_require=['pytest>=2.7', 'pytest-cov<2.6'], + extras_require={'testing': ['pytest>=2.7', 'pytest-cov<2.6']}, # TODO: check versions install_requires=['pandas>=0.23', 'matplotlib>=2.0']) finally: diff --git a/upsetplot/__init__.py b/upsetplot/__init__.py index 9dcc033..d4d23dd 100644 --- a/upsetplot/__init__.py +++ b/upsetplot/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.8.0' +__version__ = '0.8.2' import os diff --git a/upsetplot/plotting.py b/upsetplot/plotting.py index 875ef8b..baf086c 100644 --- a/upsetplot/plotting.py +++ b/upsetplot/plotting.py @@ -656,7 +656,10 @@ def plot_matrix(self, ax): "linewidth": "linewidths", "linestyle": "linestyles", "hatch": "hatch"} - styles = pd.DataFrame(styles).reindex(columns=style_columns.keys()) + styles = (pd.DataFrame(styles) + .reindex(columns=style_columns.keys()) + .astype({"facecolor": 'O', + "edgecolor": 'O', "linewidth": float, "linestyle": 'O', "hatch": 'O'})) styles["linewidth"].fillna(1, inplace=True) styles["facecolor"].fillna(self._facecolor, inplace=True) styles["edgecolor"].fillna(styles["facecolor"], inplace=True) diff --git a/upsetplot/tests/test_data.py b/upsetplot/tests/test_data.py index 5937762..add18e9 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) @@ -111,7 +111,8 @@ def test_from_contents_vs_memberships(data, typ, id_column): assert_series_equal(baseline[id_column].reset_index(drop=True), pd.Series(['aa', 'bb', 'cc', 'dd', 'ee', 'ff'], name=id_column)) - assert_frame_equal(baseline.drop([id_column], axis=1), expected) + baseline_without_id = baseline.drop([id_column], axis=1) + assert_frame_equal(baseline_without_id, expected, check_column_type=baseline_without_id.shape[1] > 0) def test_from_contents(typ=set, id_column='id'): 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