diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 10df02c04..1f4614088 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11'] runs-on: ${{ matrix.os }} @@ -33,4 +33,4 @@ jobs: - name: Test build if: always() run: | - python -m build \ No newline at end of file + python -m build diff --git a/pyproject.toml b/pyproject.toml index ee793ec41..717ca7cde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=45.0", "versioneer>=0.24", "wheel"] +requires = ["setuptools>=68.0", "versioneer>=0.29", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -12,39 +12,41 @@ license = {file = "LICENSE"} readme = "README.md" dependencies = [ - 'defusedxml>=0.7.1', - 'packaging>=22.0', # bumping to minimum version required by black - 'requests>=2.28', - 'urllib3~=1.26.8', + 'defusedxml>=0.7.1', # latest as at 7/31/23 + 'packaging>=23.1', # latest as at 7/31/23 + 'requests>=2.31', # latest as at 7/31/23 + 'urllib3==2.0.4', # latest as at 7/31/23 ] requires-python = ">=3.7" classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10" + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12" ] [project.urls] repository = "https://github.com/tableau/server-client-python" [project.optional-dependencies] -test = ["argparse", "black", "mock", "mypy", "pytest>=7.0", "pytest-subtests", "requests-mock>=1.0,<2.0"] +test = ["argparse", "black==23.7", "mock", "mypy==1.4", "pytest>=7.0", "pytest-subtests", "requests-mock>=1.0,<2.0"] [tool.black] line-length = 120 -target-version = ['py37', 'py38', 'py39', 'py310'] +target-version = ['py37', 'py38', 'py39', 'py310', 'py311', 'py312'] [tool.mypy] +check_untyped_defs = false disable_error_code = [ 'misc', - 'import' + # tableauserverclient\server\endpoint\datasources_endpoint.py:48: error: Cannot assign multiple types to name "FilePath" without an explicit "Type[...]" annotation [misc] + 'annotation-unchecked' # can be removed when check_untyped_defs = true ] files = ["tableauserverclient", "test"] show_error_codes = true -ignore_missing_imports = true - +ignore_missing_imports = true # defusedxml library has no types [tool.pytest.ini_options] testpaths = ["test"] addopts = "--junitxml=./test.junit.xml" diff --git a/test/models/test_repr.py b/test/models/test_repr.py index f3da9fde2..d21e4bc4a 100644 --- a/test/models/test_repr.py +++ b/test/models/test_repr.py @@ -1,7 +1,7 @@ import pytest from unittest import TestCase -import _models +import _models # type: ignore # did not set types for this # ensure that all models have a __repr__ method implemented diff --git a/test/test_datasource.py b/test/test_datasource.py index 730e382da..e299e5291 100644 --- a/test/test_datasource.py +++ b/test/test_datasource.py @@ -2,12 +2,14 @@ import tempfile import unittest from io import BytesIO +from typing import Optional from zipfile import ZipFile import requests_mock from defusedxml.ElementTree import fromstring import tableauserverclient as TSC +from tableauserverclient import ConnectionItem from tableauserverclient.datetime_helpers import format_datetime from tableauserverclient.server.endpoint.exceptions import InternalServerError from tableauserverclient.server.endpoint.fileuploads_endpoint import Fileuploads @@ -167,9 +169,9 @@ def test_populate_connections(self) -> None: single_datasource._id = "9dbd2263-16b5-46e1-9c43-a76bb8ab65fb" self.server.datasources.populate_connections(single_datasource) self.assertEqual("9dbd2263-16b5-46e1-9c43-a76bb8ab65fb", single_datasource.id) - connections = single_datasource.connections + connections: Optional[list[ConnectionItem]] = single_datasource.connections - self.assertTrue(connections) + self.assertIsNotNone(connections) ds1, ds2 = connections self.assertEqual("be786ae0-d2bf-4a4b-9b34-e2de8d2d4488", ds1.id) self.assertEqual("textscan", ds1.connection_type)