Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -33,4 +33,4 @@ jobs:
- name: Test build
if: always()
run: |
python -m build
python -m build
26 changes: 14 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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"
2 changes: 1 addition & 1 deletion test/models/test_repr.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions test/test_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down