diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec6e4933..73f05e86 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, macOS-latest, windows-latest] steps: @@ -21,6 +21,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true cache: pip cache-dependency-path: "pyproject.toml" diff --git a/pyproject.toml b/pyproject.toml index 9967d55f..ab89ab45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dynamic = ["version"] diff --git a/tests/requirements.txt b/tests/requirements.txt index b127f186..abfc1b5f 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -3,7 +3,6 @@ pytest-cov MarkupPy odfpy openpyxl>=2.6.0 -pandas pyyaml tabulate xlrd diff --git a/tests/test_tablib.py b/tests/test_tablib.py index 93e8db3a..a3d86b48 100755 --- a/tests/test_tablib.py +++ b/tests/test_tablib.py @@ -13,6 +13,7 @@ from pathlib import Path from uuid import uuid4 +import pytest from MarkupPy import markup from openpyxl.reader.excel import load_workbook @@ -21,6 +22,11 @@ from tablib.exceptions import UnsupportedFormat from tablib.formats import registry +try: + import pandas +except ImportError: # pragma: no cover + pandas = None + class BaseTestCase(unittest.TestCase): def setUp(self): @@ -264,6 +270,7 @@ def test_str_no_columns(self): 'c|3' ]) + @pytest.mark.skipif(pandas is None, reason="pandas is not installed") def test_unicode_append(self): """Passes in a single unicode character and exports.""" @@ -272,6 +279,7 @@ def test_unicode_append(self): data.append(new_row) self._test_export_data_in_all_formats(data) + @pytest.mark.skipif(pandas is None, reason="pandas is not installed") def test_datetime_append(self): """Passes in a single datetime and a single date and exports.""" @@ -283,6 +291,7 @@ def test_datetime_append(self): data.append(new_row) self._test_export_data_in_all_formats(data) + @pytest.mark.skipif(pandas is None, reason="pandas is not installed") def test_separator_append(self): for a in range(3): data.append_separator('foobar') @@ -328,6 +337,7 @@ def test_empty_file(self): dset = tablib.Dataset().load(tmp_file, 'yaml') self.assertEqual(dset.json, '[]') + @pytest.mark.skipif(pandas is None, reason="pandas is not installed") def test_auto_format_detect(self): """Test auto format detection.""" # html, jira, latex, rst are export only. diff --git a/tox.ini b/tox.ini index d1097a8f..03854baa 100644 --- a/tox.ini +++ b/tox.ini @@ -4,12 +4,13 @@ minversion = 2.4 envlist = docs lint - py{37,38,39,310,311} + py{37,38,39,310,311,312} [testenv] deps = -rtests/requirements.txt -extras = pandas +commands_pre = + - {envpython} -m pip install --only-binary :all: pandas passenv = FORCE_COLOR commands =