From 39e1619d5f302883f538fb913093cb10cb9d1b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:24:52 -0600 Subject: [PATCH] refactor: Remove `pytest-durations` dependency from `testing` and use native pytest option `--durations` (#2599) packaging: Remove `testing` dependency on `pytest-durations` --- .../{{cookiecutter.mapper_id}}/pyproject.toml | 3 ++ .../{{cookiecutter.tap_id}}/pyproject.toml | 3 ++ .../{{cookiecutter.target_id}}/pyproject.toml | 7 +++ poetry.lock | 50 +++++++------------ pyproject.toml | 5 +- 5 files changed, 32 insertions(+), 36 deletions(-) diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml index 7c4568934..e77cf5346 100644 --- a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml +++ b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml @@ -41,6 +41,9 @@ singer-sdk = { version="~=0.39.1", extras = ["testing"] } [tool.poetry.extras] s3 = ["fs-s3fs"] +[tool.pytest.ini_options] +addopts = '--durations=10' + [tool.mypy] python_version = "3.12" warn_unused_configs = true diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml index 6556a2f1b..98851d925 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml @@ -51,6 +51,9 @@ singer-sdk = { version="~=0.39.1", extras = ["testing"] } [tool.poetry.extras] s3 = ["fs-s3fs"] +[tool.pytest.ini_options] +addopts = '--durations=10' + [tool.mypy] python_version = "3.12" warn_unused_configs = true diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml b/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml index 9cf626117..5aa268f7c 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml @@ -43,6 +43,13 @@ singer-sdk = { version="~=0.39.1", extras = ["testing"] } [tool.poetry.extras] s3 = ["fs-s3fs"] +[tool.pytest.ini_options] +addopts = '--durations=10' + +[tool.mypy] +python_version = "3.12" +warn_unused_configs = true + [tool.ruff] src = ["{{cookiecutter.library_name}}"] target-version = "py38" diff --git a/poetry.lock b/poetry.lock index ace6f7f76..a238790e1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -43,13 +43,13 @@ tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] [[package]] name = "babel" -version = "2.15.0" +version = "2.16.0" description = "Internationalization utilities" optional = true python-versions = ">=3.8" files = [ - {file = "Babel-2.15.0-py3-none-any.whl", hash = "sha256:08706bdad8d0a3413266ab61bd6c34d0c28d6e1e7badf40a2cebe67644e2e1fb"}, - {file = "babel-2.15.0.tar.gz", hash = "sha256:8daf0e265d05768bc6c7a314cf1321e9a123afc328cc635c18622a2f30a04413"}, + {file = "babel-2.16.0-py3-none-any.whl", hash = "sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b"}, + {file = "babel-2.16.0.tar.gz", hash = "sha256:d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316"}, ] [package.extras] @@ -129,17 +129,17 @@ lxml = ["lxml"] [[package]] name = "boto3" -version = "1.34.156" +version = "1.34.157" description = "The AWS SDK for Python" optional = true python-versions = ">=3.8" files = [ - {file = "boto3-1.34.156-py3-none-any.whl", hash = "sha256:cbbd453270b8ce94ef9da60dfbb6f9ceeb3eeee226b635aa9ec44b1def98cc96"}, - {file = "boto3-1.34.156.tar.gz", hash = "sha256:b33e9a8f8be80d3053b8418836a7c1900410b23a30c7cb040927d601a1082e68"}, + {file = "boto3-1.34.157-py3-none-any.whl", hash = "sha256:3cc357156df5482154a016f138d1953061a181b4c594f8b6302c9d6c024bd950"}, + {file = "boto3-1.34.157.tar.gz", hash = "sha256:7ef19ed38cba9863b58430fb4a66a72a5c250304f234bd1c16b860f9bf25677b"}, ] [package.dependencies] -botocore = ">=1.34.156,<1.35.0" +botocore = ">=1.34.157,<1.35.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -148,13 +148,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.156" +version = "1.34.157" description = "Low-level, data-driven core of boto 3." optional = true python-versions = ">=3.8" files = [ - {file = "botocore-1.34.156-py3-none-any.whl", hash = "sha256:c48f8c8996216dfdeeb0aa6d3c0f2c7ae25234766434a2ea3e57bdc08494bdda"}, - {file = "botocore-1.34.156.tar.gz", hash = "sha256:5d1478c41ab9681e660b3322432fe09c4055759c317984b7b8d3af9557ff769a"}, + {file = "botocore-1.34.157-py3-none-any.whl", hash = "sha256:c6cba6de8eb86ca4d2f934e009b37adbe1e7fdcfa52fbab74783f4c30676e07d"}, + {file = "botocore-1.34.157.tar.gz", hash = "sha256:5628a36cec123cdc8c1158d05a7b06aa5e53649ad73796c50ef3fb51199785fb"}, ] [package.dependencies] @@ -641,13 +641,13 @@ test = ["pytest (>=6)"] [[package]] name = "faker" -version = "26.2.0" +version = "26.3.0" description = "Faker is a Python package that generates fake data for you." optional = true python-versions = ">=3.8" files = [ - {file = "Faker-26.2.0-py3-none-any.whl", hash = "sha256:7b123090774deff5f2cd3eb92a84dcbbf1e163f30a6d07321b7852c11bfe6a75"}, - {file = "Faker-26.2.0.tar.gz", hash = "sha256:81768de19012147521140f0d8bf5353e501ac42c1065d25e0cac455d3615c0a7"}, + {file = "Faker-26.3.0-py3-none-any.whl", hash = "sha256:97fe1e7e953dd640ca2cd4dfac4db7c4d2432dd1b7a244a3313517707f3b54e9"}, + {file = "Faker-26.3.0.tar.gz", hash = "sha256:7c10ebdf74aaa0cc4fe6ec6db5a71e8598ec33503524bd4b5f4494785a5670dd"}, ] [package.dependencies] @@ -1492,20 +1492,6 @@ compat = ["pytest-benchmark (>=4.0.0,<4.1.0)", "pytest-xdist (>=2.0.0,<2.1.0)"] lint = ["mypy (>=1.3.0,<1.4.0)", "ruff (>=0.3.3,<0.4.0)"] test = ["pytest (>=7.0,<8.0)", "pytest-cov (>=4.0.0,<4.1.0)"] -[[package]] -name = "pytest-durations" -version = "1.2.0" -description = "Pytest plugin reporting fixtures and test functions execution time." -optional = true -python-versions = ">=3.6.2" -files = [ - {file = "pytest-durations-1.2.0.tar.gz", hash = "sha256:75793f7c2c393a947de4a92cc205e8dcb3d7fcde492628926cca97eb8e87077d"}, - {file = "pytest_durations-1.2.0-py3-none-any.whl", hash = "sha256:210c649d989fdf8e864b7f614966ca2c8be5b58a5224d60089a43618c146d7fb"}, -] - -[package.dependencies] -pytest = ">=4.6" - [[package]] name = "pytest-snapshot" version = "0.9.0" @@ -2403,13 +2389,13 @@ files = [ [[package]] name = "types-pyyaml" -version = "6.0.12.20240724" +version = "6.0.12.20240808" description = "Typing stubs for PyYAML" optional = false python-versions = ">=3.8" files = [ - {file = "types-PyYAML-6.0.12.20240724.tar.gz", hash = "sha256:cf7b31ae67e0c5b2919c703d2affc415485099d3fe6666a6912f040fd05cb67f"}, - {file = "types_PyYAML-6.0.12.20240724-py3-none-any.whl", hash = "sha256:e5becec598f3aa3a2ddf671de4a75fa1c6856fbf73b2840286c9d50fae2d5d48"}, + {file = "types-PyYAML-6.0.12.20240808.tar.gz", hash = "sha256:b8f76ddbd7f65440a8bda5526a9607e4c7a322dc2f8e1a8c405644f9a6f4b9af"}, + {file = "types_PyYAML-6.0.12.20240808-py3-none-any.whl", hash = "sha256:deda34c5c655265fc517b546c902aa6eed2ef8d3e921e4765fe606fe2afe8d35"}, ] [[package]] @@ -2519,9 +2505,9 @@ faker = ["faker"] jwt = ["PyJWT", "cryptography"] parquet = ["numpy", "numpy", "pyarrow"] s3 = ["fs-s3fs"] -testing = ["pytest", "pytest-durations"] +testing = ["pytest"] [metadata] lock-version = "2.0" python-versions = ">=3.8" -content-hash = "a9608352516ffcc098a93ce4e3375b11989c328c7520cad28ab89c458c1dbc3b" +content-hash = "8d0665d7e5397609e616976d470dca9863a925a12f513c0b78439f055aeb664a" diff --git a/pyproject.toml b/pyproject.toml index 030f94b96..68faa36ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,7 +83,6 @@ pyarrow = { version = ">=13", optional = true } # Testing dependencies installed as optional 'testing' extras pytest = {version=">=7.2.1", optional = true} -pytest-durations = {version = ">=1.2.0", optional = true} # installed as optional 'faker' extra faker = {version = ">=22.5,<27.0", optional = true} @@ -110,7 +109,6 @@ docs = [ s3 = ["fs-s3fs"] testing = [ "pytest", - "pytest-durations" ] parquet = ["numpy", "pyarrow"] faker = ["faker"] @@ -143,7 +141,7 @@ types-PyYAML = ">=6.0.12" pytest-codspeed = ">=2.2.0" [tool.pytest.ini_options] -addopts = '--ignore=singer_sdk/helpers/_simpleeval.py -m "not external"' +addopts = '--durations=10 --ignore=singer_sdk/helpers/_simpleeval.py -m "not external"' filterwarnings = [ "error", "ignore:Could not configure external gitlab tests:UserWarning", @@ -251,7 +249,6 @@ DEP002 = [ "sphinx-reredirects", # Plugins "fs-s3fs", - "pytest-durations", ] [tool.mypy]