diff --git a/poetry.lock b/poetry.lock index ce81dcd..de4172a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -22,9 +22,6 @@ files = [ {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, ] -[package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - [package.extras] cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] dev = ["attrs[docs,tests]", "pre-commit"] @@ -43,44 +40,6 @@ files = [ {file = "backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba"}, ] -[[package]] -name = "boto3" -version = "1.28.45" -description = "The AWS SDK for Python" -optional = true -python-versions = ">= 3.7" -files = [ - {file = "boto3-1.28.45-py3-none-any.whl", hash = "sha256:682abbd304e93e726163d7de7448c1bf88108c72cf6a23dceb6bba86fdc86dff"}, - {file = "boto3-1.28.45.tar.gz", hash = "sha256:4ee914266c9bed16978677a367fd05053d8dcaddcbe998c9df30787ab73f87aa"}, -] - -[package.dependencies] -botocore = ">=1.31.45,<1.32.0" -jmespath = ">=0.7.1,<2.0.0" -s3transfer = ">=0.6.0,<0.7.0" - -[package.extras] -crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] - -[[package]] -name = "botocore" -version = "1.31.45" -description = "Low-level, data-driven core of boto 3." -optional = true -python-versions = ">= 3.7" -files = [ - {file = "botocore-1.31.45-py3-none-any.whl", hash = "sha256:cceb150cff1d7f7a6faf655510a8384eb4505a33b430495fe1744d03a70dc66a"}, - {file = "botocore-1.31.45.tar.gz", hash = "sha256:85ff64a0ac2705c4ba36268c3b2dbc1184062e9cf729a89dd66c2f54f730fc79"}, -] - -[package.dependencies] -jmespath = ">=0.7.1,<2.0.0" -python-dateutil = ">=2.1,<3.0.0" -urllib3 = ">=1.25.4,<1.27" - -[package.extras] -crt = ["awscrt (==0.16.26)"] - [[package]] name = "certifi" version = "2023.7.22" @@ -265,7 +224,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "colorama" @@ -367,22 +325,6 @@ six = ">=1.10,<2.0" [package.extras] scandir = ["scandir (>=1.5,<2.0)"] -[[package]] -name = "fs-s3fs" -version = "1.1.1" -description = "Amazon S3 filesystem for PyFilesystem2" -optional = true -python-versions = "*" -files = [ - {file = "fs-s3fs-1.1.1.tar.gz", hash = "sha256:b57f8c7664460ff7b451b4b44ca2ea9623a374d74e1284c2d5e6df499dc7976c"}, - {file = "fs_s3fs-1.1.1-py2.py3-none-any.whl", hash = "sha256:9ba160eaa93390cc5992a857675666cb2fbb3721b872474dfdc659a715c39280"}, -] - -[package.dependencies] -boto3 = ">=1.9,<2.0" -fs = ">=2.4,<3.0" -six = ">=1.10,<2.0" - [[package]] name = "greenlet" version = "2.0.2" @@ -471,26 +413,6 @@ files = [ {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] -[[package]] -name = "importlib-metadata" -version = "4.13.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "importlib_metadata-4.13.0-py3-none-any.whl", hash = "sha256:8a8a81bcf996e74fee46f0d16bd3eaa382a7eb20fd82445c3ad11f4090334116"}, - {file = "importlib_metadata-4.13.0.tar.gz", hash = "sha256:dd0173e8f150d6815e098fd354f6414b0f079af4644ddfe90c71e2fc6174346d"}, -] - -[package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] -perf = ["ipython"] -testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] - [[package]] name = "importlib-resources" version = "5.12.0" @@ -531,17 +453,6 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] -[[package]] -name = "jmespath" -version = "1.0.1" -description = "JSON Matching Expressions" -optional = true -python-versions = ">=3.7" -files = [ - {file = "jmespath-1.0.1-py3-none-any.whl", hash = "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980"}, - {file = "jmespath-1.0.1.tar.gz", hash = "sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"}, -] - [[package]] name = "joblib" version = "1.3.2" @@ -583,11 +494,9 @@ files = [ [package.dependencies] attrs = ">=17.4.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""} pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] @@ -670,9 +579,6 @@ files = [ {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -710,9 +616,6 @@ files = [ {file = "PyJWT-2.8.0.tar.gz", hash = "sha256:57e28d156e3d5c10088e0c68abb90bfac3df82b40a71bd0daa20c65ccd5c23de"}, ] -[package.dependencies] -typing-extensions = {version = "*", markers = "python_version <= \"3.7\""} - [package.extras] crypto = ["cryptography (>=3.4.0)"] dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.4.0)", "pre-commit", "pytest (>=6.0.0,<7.0.0)", "sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] @@ -769,7 +672,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -923,21 +825,23 @@ socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] -name = "s3transfer" -version = "0.6.2" -description = "An Amazon S3 Transfer Manager" -optional = true -python-versions = ">= 3.7" +name = "requests-mock" +version = "1.11.0" +description = "Mock out responses from the requests package" +optional = false +python-versions = "*" files = [ - {file = "s3transfer-0.6.2-py3-none-any.whl", hash = "sha256:b014be3a8a2aab98cfe1abc7229cc5a9a0cf05eb9c1f2b86b230fd8df3f78084"}, - {file = "s3transfer-0.6.2.tar.gz", hash = "sha256:cab66d3380cca3e70939ef2255d01cd8aece6a4907a9528740f668c4b0611861"}, + {file = "requests-mock-1.11.0.tar.gz", hash = "sha256:ef10b572b489a5f28e09b708697208c4a3b2b89ef80a9f01584340ea357ec3c4"}, + {file = "requests_mock-1.11.0-py2.py3-none-any.whl", hash = "sha256:f7fae383f228633f6bececebdab236c478ace2284d6292c6e7e2867b9ab74d15"}, ] [package.dependencies] -botocore = ">=1.12.36,<2.0a.0" +requests = ">=2.3,<3" +six = "*" [package.extras] -crt = ["botocore[crt] (>=1.20.29,<2.0a.0)"] +fixture = ["fixtures"] +test = ["fixtures", "mock", "purl", "pytest", "requests-futures", "sphinx", "testtools"] [[package]] name = "setuptools" @@ -1065,7 +969,6 @@ backoff = ">=2.0.0,<3.0" click = ">=8.0,<9.0" cryptography = ">=3.4.6,<42.0.0" fs = ">=2.4.16,<3.0.0" -importlib-metadata = {version = "<5.0.0", markers = "python_version < \"3.8\""} importlib-resources = {version = "5.12.0", markers = "python_version < \"3.9\""} inflection = ">=0.5.1,<0.6.0" joblib = ">=1.0.1,<2.0.0" @@ -1154,7 +1057,6 @@ files = [ [package.dependencies] greenlet = {version = "!=0.4.17", markers = "platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} typing-extensions = ">=4.2.0" [package.extras] @@ -1234,10 +1136,7 @@ files = [ docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] -[extras] -s3 = ["fs-s3fs"] - [metadata] lock-version = "2.0" -python-versions = "<3.12,>=3.7.1" -content-hash = "24583ce0f0d62b9140219c0471a9fe5f9e2aac34cce04d72c850f2d69bc888b4" +python-versions = "<3.12,>=3.8.0" +content-hash = "8b47e688e4f02d87d7c499df2ca609c1dc65d0c1553c4383d1ac5da6e4980847" diff --git a/pyproject.toml b/pyproject.toml index 7d1187e..2407e30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ requests = "^2.31.0" [tool.poetry.group.dev.dependencies] pytest = "^7.4.0" singer-sdk = { version="^0.31.1", extras = ["testing"] } +requests-mock = "^1.11.0" [tool.mypy] python_version = "3.9" @@ -34,7 +35,7 @@ ignore = [ ] select = ["ALL"] src = ["tap_linear"] -target-version = "py311" +target-version = "py38" [tool.ruff.flake8-annotations] diff --git a/tests/test_core.py b/tests/test_core.py index da2d03b..1a66443 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -2,18 +2,19 @@ import datetime -from singer_sdk.testing import get_tap_test_class +from singer_sdk.testing.legacy import get_standard_tap_tests from tap_linear.tap import TapLinear SAMPLE_CONFIG = { - "start_date": datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%d"), + "start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"), "auth_token": "test", } -# Run standard built-in tap tests from the SDK: -TestTapLinear = get_tap_test_class( - tap_class=TapLinear, - config=SAMPLE_CONFIG, -) +def test_standard_tap_tests(requests_mock) -> None: # noqa: ANN001 + """Run standard built-in tap tests from the SDK.""" + requests_mock.post("/graphql", json={"data": {"results": {"nodes": []}}}) + tests = get_standard_tap_tests(TapLinear, config=SAMPLE_CONFIG) + for test in tests: + test() diff --git a/tox.ini b/tox.ini index 70b9e4a..8de2dab 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ # This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy [tox] -envlist = py37, py38, py39, py310, py311 +envlist = py38, py39, py310, py311 isolated_build = true [testenv] @@ -13,7 +13,7 @@ commands = [testenv:pytest] # Run the python tests. # To execute, run `tox -e pytest` -envlist = py37, py38, py39, py310, py311 +envlist = py38, py39, py310, py311 commands = poetry install -v poetry run pytest