From ee4b0551f75f6d9bbf0671dc811f145c7af3bd73 Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Sat, 26 Oct 2024 16:00:32 +0200 Subject: [PATCH] test(functional): depend on exact versions --- tests/fixtures/example_project/pyproject.toml | 22 ++++++------ .../example_project/src/notebook.ipynb | 2 +- tests/fixtures/pep_621_project/pyproject.toml | 30 ++++++++-------- .../pep_621_project/src/notebook.ipynb | 2 +- .../project_using_namespace/pyproject.toml | 8 ++--- .../project_with_gitignore/pyproject.toml | 24 ++++++------- .../project_with_gitignore/src/notebook.ipynb | 2 +- .../pyproject.toml | 8 ++--- .../fixtures/project_with_pdm/pyproject.toml | 30 ++++++++-------- .../project_with_pdm/src/notebook.ipynb | 2 +- .../project_with_poetry/pyproject.toml | 28 +++++++-------- .../project_with_poetry/src/notebook.ipynb | 2 +- .../a_sub_directory/pyproject.toml | 26 ++++++-------- .../project_with_src_directory/notebook.ipynb | 2 +- .../requirements-dev.txt | 2 +- .../requirements.in | 8 ++--- .../requirements.txt | 10 +++--- .../src/notebook.ipynb | 2 +- .../requirements-2.txt | 2 +- .../requirements-dev.txt | 2 +- .../requirements-typing.txt | 2 +- .../requirements.txt | 10 +++--- .../src/notebook.ipynb | 2 +- .../pyproject.toml | 1 + .../project_with_src_directory/pyproject.toml | 24 ++++++------- .../project_with_src_directory/notebook.ipynb | 2 +- tests/fixtures/project_with_uv/pyproject.toml | 18 +++++----- tests/functional/cli/test_cli.py | 36 +++++++++---------- .../test_cli_multiple_source_directories.py | 4 +-- .../cli/test_cli_requirements_in.py | 10 ++++++ 30 files changed, 159 insertions(+), 164 deletions(-) diff --git a/tests/fixtures/example_project/pyproject.toml b/tests/fixtures/example_project/pyproject.toml index 2854585f0..e1852c73f 100644 --- a/tests/fixtures/example_project/pyproject.toml +++ b/tests/fixtures/example_project/pyproject.toml @@ -1,20 +1,20 @@ [tool.poetry] -name = "test" +name = "foo" version = "0.0.1" -description = "A test project" -authors = ["test "] +description = "" +authors = [] [tool.poetry.dependencies] -python = ">=3.7,<4.0" -toml = "^0.10.2" -urllib3 = "^1.26.12" -isort = "^5.10.1" -click = "^8.1.3" -requests = "^2.28.1" -pkginfo = "^1.8.3" +python = ">=3.9" +click = "8.1.7" +isort = "5.13.2" +pkginfo = "1.11.2" +requests = "2.32.3" +tomli = "2.0.2" +urllib3 = "2.2.3" [tool.poetry.dev-dependencies] -black = "^22.6.0" +black = "24.10.0" [tool.deptry.per_rule_ignores] DEP002 = ["pkginfo"] diff --git a/tests/fixtures/example_project/src/notebook.ipynb b/tests/fixtures/example_project/src/notebook.ipynb index 47ebeb1b6..326bff64f 100644 --- a/tests/fixtures/example_project/src/notebook.ipynb +++ b/tests/fixtures/example_project/src/notebook.ipynb @@ -12,7 +12,7 @@ "%%timeit\n", "import click\n", "from urllib3 import contrib\n", - "import toml\n", + "import tomli\n", "1 +\\\n", " 2" ] diff --git a/tests/fixtures/pep_621_project/pyproject.toml b/tests/fixtures/pep_621_project/pyproject.toml index faff47fc5..3f17b329e 100644 --- a/tests/fixtures/pep_621_project/pyproject.toml +++ b/tests/fixtures/pep_621_project/pyproject.toml @@ -1,31 +1,29 @@ [project] -# PEP 621 project metadata -# See https://www.python.org/dev/peps/pep-0621/ name = "foo" -version = "1.2.3" -requires-python = ">=3.7" +version = "0.0.1" +requires-python = ">=3.9" dependencies = [ - "toml", - "urllib3>=1.26.12", - "isort>=5.10.1", - "click>=8.1.3", - "requests>=2.28.1", - "pkginfo>=1.8.3", - "asyncio", + "asyncio==3.4.3", + "click==8.1.7", + "isort==5.13.2", + "pkginfo==1.11.2", + "requests==2.32.3", + "tomli==2.0.2", + "urllib3==2.2.3", ] [project.optional-dependencies] dev = [ - "black==22.10.0", - "mypy==0.982", + "black==24.10.0", + "mypy==1.13.0", ] -test = ["pytest==7.2.0"] -plot = ["matplotlib"] +test = ["pytest==8.3.3"] +plot = ["matplotlib==3.9.2"] [dependency-groups] doc = [ "mkdocs==1.6.1", - "mkdocs-material==9.5.40", + "mkdocs-material==9.5.42", ] all = [{include-group = "doc"}, "packaging==24.1"] diff --git a/tests/fixtures/pep_621_project/src/notebook.ipynb b/tests/fixtures/pep_621_project/src/notebook.ipynb index a51bdb9de..909a5bcd5 100644 --- a/tests/fixtures/pep_621_project/src/notebook.ipynb +++ b/tests/fixtures/pep_621_project/src/notebook.ipynb @@ -9,7 +9,7 @@ "source": [ "import click\n", "from urllib3 import contrib\n", - "import toml" + "import tomli" ] } ], diff --git a/tests/fixtures/project_using_namespace/pyproject.toml b/tests/fixtures/project_using_namespace/pyproject.toml index ffad3ba38..e549f3524 100644 --- a/tests/fixtures/project_using_namespace/pyproject.toml +++ b/tests/fixtures/project_using_namespace/pyproject.toml @@ -1,10 +1,8 @@ [project] -# PEP 621 project metadata -# See https://www.python.org/dev/peps/pep-0621/ name = "foo" -version = "1.2.3" -requires-python = ">=3.7" -dependencies = ["tomli==2.0.1"] +version = "0.0.1" +requires-python = ">=3.9" +dependencies = ["tomli==2.0.2"] [project.optional-dependencies] dev = ["flake8==7.1.1"] diff --git a/tests/fixtures/project_with_gitignore/pyproject.toml b/tests/fixtures/project_with_gitignore/pyproject.toml index 52de6916c..4018ab074 100644 --- a/tests/fixtures/project_with_gitignore/pyproject.toml +++ b/tests/fixtures/project_with_gitignore/pyproject.toml @@ -1,24 +1,22 @@ [project] -# PEP 621 project metadata -# See https://www.python.org/dev/peps/pep-0621/ name = "foo" -version = "1.2.3" -requires-python = ">=3.7" +version = "0.0.1" +requires-python = ">=3.9" dependencies = [ - "toml", - "urllib3>=1.26.12", - "isort>=5.10.1", - "click>=8.1.3", - "requests>=2.28.1", - "pkginfo>=1.8.3", + "click==8.1.7", + "isort==5.13.2", + "pkginfo==1.11.2", + "requests==2.32.3", + "tomli==2.0.2", + "urllib3==2.2.3", ] [project.optional-dependencies] dev = [ - "black==22.10.0", - "mypy==0.982", + "black==24.10.0", + "mypy==1.13.0", ] -test = ["pytest==7.2.0"] +test = ["pytest==8.3.3"] [build-system] requires = ["setuptools>=61.0.0"] diff --git a/tests/fixtures/project_with_gitignore/src/notebook.ipynb b/tests/fixtures/project_with_gitignore/src/notebook.ipynb index a51bdb9de..909a5bcd5 100644 --- a/tests/fixtures/project_with_gitignore/src/notebook.ipynb +++ b/tests/fixtures/project_with_gitignore/src/notebook.ipynb @@ -9,7 +9,7 @@ "source": [ "import click\n", "from urllib3 import contrib\n", - "import toml" + "import tomli" ] } ], diff --git a/tests/fixtures/project_with_multiple_source_directories/pyproject.toml b/tests/fixtures/project_with_multiple_source_directories/pyproject.toml index 1aaf75240..5d65f5d1d 100644 --- a/tests/fixtures/project_with_multiple_source_directories/pyproject.toml +++ b/tests/fixtures/project_with_multiple_source_directories/pyproject.toml @@ -1,10 +1,8 @@ [project] -# PEP 621 project metadata -# See https://www.python.org/dev/peps/pep-0621/ name = "foo" -version = "1.2.3" -requires-python = ">=3.7" -dependencies = ["toml"] +version = "0.0.1" +requires-python = ">=3.9" +dependencies = ["tomli==2.0.2"] [build-system] requires = ["setuptools>=61.0.0"] diff --git a/tests/fixtures/project_with_pdm/pyproject.toml b/tests/fixtures/project_with_pdm/pyproject.toml index c9a3805aa..b16ca3451 100644 --- a/tests/fixtures/project_with_pdm/pyproject.toml +++ b/tests/fixtures/project_with_pdm/pyproject.toml @@ -1,19 +1,19 @@ [project] -# PEP 621 project metadata -# See https://www.python.org/dev/peps/pep-0621/ -requires-python = ">=3.7" +name = "foo" +version = "0.0.1" +requires-python = ">=3.9" dependencies = [ - "toml", - "urllib3>=1.26.12", - "pkginfo>=1.8.3", + "pkginfo==1.11.2", + "tomli==2.0.2", + "urllib3==2.2.3", ] [project.optional-dependencies] -foo = [ - "isort>=5.10.1", - "click>=8.1.3", +baz = [ + "click==8.1.7", + "isort==5.13.2", ] -bar = ["requests>=2.28.1"] +bar = ["requests==2.32.3"] [tool.pdm] version = {source = "scm"} @@ -21,18 +21,18 @@ version = {source = "scm"} [dependency-groups] doc = [ "mkdocs==1.6.1", - "mkdocs-material==9.5.40", + "mkdocs-material==9.5.42", ] all = [{include-group = "doc"}, "packaging==24.1"] [tool.pdm.dev-dependencies] lint = [ - "black>=22.6.0", - "mypy>=1.3.0", + "black==24.10.0", + "mypy>=1.13.0", ] test = [ - "pytest>=7.3.0", - "pytest-cov>=4.0.0", + "pytest==8.3.3", + "pytest-cov==5.0.0", ] [tool.deptry] diff --git a/tests/fixtures/project_with_pdm/src/notebook.ipynb b/tests/fixtures/project_with_pdm/src/notebook.ipynb index a51bdb9de..909a5bcd5 100644 --- a/tests/fixtures/project_with_pdm/src/notebook.ipynb +++ b/tests/fixtures/project_with_pdm/src/notebook.ipynb @@ -9,7 +9,7 @@ "source": [ "import click\n", "from urllib3 import contrib\n", - "import toml" + "import tomli" ] } ], diff --git a/tests/fixtures/project_with_poetry/pyproject.toml b/tests/fixtures/project_with_poetry/pyproject.toml index 19d1dd893..0815342c5 100644 --- a/tests/fixtures/project_with_poetry/pyproject.toml +++ b/tests/fixtures/project_with_poetry/pyproject.toml @@ -1,18 +1,18 @@ [tool.poetry] -name = "test" +name = "foo" version = "0.0.1" -description = "A test project" -authors = ["test "] +description = "" +authors = [] [tool.poetry.dependencies] -python = ">=3.7" -pkginfo = ">=1.8.3" -toml = "*" -urllib3 = ">=1.26.12" +python = ">=3.9" +pkginfo = "1.11.2" +tomli = "2.0.2" +urllib3 = "2.2.3" -click = { version = ">=8.1.3", optional = true } -isort = { version = ">=5.10.1", optional = true } -requests = { version = ">=2.28.1", optional = true } +click = { version = "8.1.7", optional = true } +isort = { version = "5.13.2", optional = true } +requests = { version = "2.32.3", optional = true } [tool.poetry.extras] foo = [ @@ -22,12 +22,12 @@ foo = [ bar = ["requests"] [tool.poetry.group.lint.dependencies] -black = "^22.6.0" -mypy = "^1.3.0" +black = "24.10.0" +mypy = "^1.13.0" [tool.poetry.group.test.dependencies] -pytest = "^7.3.0" -pytest-cov = "^4.0.0" +pytest = "8.3.3" +pytest-cov = "5.0.0" [tool.deptry.per_rule_ignores] DEP002 = ["pkginfo"] diff --git a/tests/fixtures/project_with_poetry/src/notebook.ipynb b/tests/fixtures/project_with_poetry/src/notebook.ipynb index a51bdb9de..909a5bcd5 100644 --- a/tests/fixtures/project_with_poetry/src/notebook.ipynb +++ b/tests/fixtures/project_with_poetry/src/notebook.ipynb @@ -9,7 +9,7 @@ "source": [ "import click\n", "from urllib3 import contrib\n", - "import toml" + "import tomli" ] } ], diff --git a/tests/fixtures/project_with_pyproject_different_directory/a_sub_directory/pyproject.toml b/tests/fixtures/project_with_pyproject_different_directory/a_sub_directory/pyproject.toml index 31a66ac43..4018ab074 100644 --- a/tests/fixtures/project_with_pyproject_different_directory/a_sub_directory/pyproject.toml +++ b/tests/fixtures/project_with_pyproject_different_directory/a_sub_directory/pyproject.toml @@ -1,26 +1,22 @@ [project] -# PEP 621 project metadata -# See https://www.python.org/dev/peps/pep-0621/ name = "foo" -version = "1.2.3" -requires-python = ">=3.7" +version = "0.0.1" +requires-python = ">=3.9" dependencies = [ - "toml", - "urllib3>=1.26.12", - "isort>=5.10.1", - "click>=8.1.3", - "requests>=2.28.1", - "pkginfo>=1.8.3", + "click==8.1.7", + "isort==5.13.2", + "pkginfo==1.11.2", + "requests==2.32.3", + "tomli==2.0.2", + "urllib3==2.2.3", ] [project.optional-dependencies] dev = [ - "black==22.10.0", - "mypy==0.982", -] -test = [ - "pytest==7.2.0", + "black==24.10.0", + "mypy==1.13.0", ] +test = ["pytest==8.3.3"] [build-system] requires = ["setuptools>=61.0.0"] diff --git a/tests/fixtures/project_with_pyproject_different_directory/src/project_with_src_directory/notebook.ipynb b/tests/fixtures/project_with_pyproject_different_directory/src/project_with_src_directory/notebook.ipynb index a51bdb9de..909a5bcd5 100644 --- a/tests/fixtures/project_with_pyproject_different_directory/src/project_with_src_directory/notebook.ipynb +++ b/tests/fixtures/project_with_pyproject_different_directory/src/project_with_src_directory/notebook.ipynb @@ -9,7 +9,7 @@ "source": [ "import click\n", "from urllib3 import contrib\n", - "import toml" + "import tomli" ] } ], diff --git a/tests/fixtures/project_with_requirements_in/requirements-dev.txt b/tests/fixtures/project_with_requirements_in/requirements-dev.txt index b173f0123..ad2b44c02 100644 --- a/tests/fixtures/project_with_requirements_in/requirements-dev.txt +++ b/tests/fixtures/project_with_requirements_in/requirements-dev.txt @@ -1 +1 @@ -black==22.6.0 +black==24.10.0 diff --git a/tests/fixtures/project_with_requirements_in/requirements.in b/tests/fixtures/project_with_requirements_in/requirements.in index d4dfa73be..040fb4a86 100644 --- a/tests/fixtures/project_with_requirements_in/requirements.in +++ b/tests/fixtures/project_with_requirements_in/requirements.in @@ -1,4 +1,4 @@ -click==8.1.3 -isort==5.10.1 -urllib3==2.2.2 -uvicorn==0.30.5 +click==8.1.7 +isort==5.13.2 +urllib3==2.2.3 +uvicorn==0.32.0 diff --git a/tests/fixtures/project_with_requirements_in/requirements.txt b/tests/fixtures/project_with_requirements_in/requirements.txt index 319aa08e7..5f1a968d9 100644 --- a/tests/fixtures/project_with_requirements_in/requirements.txt +++ b/tests/fixtures/project_with_requirements_in/requirements.txt @@ -1,18 +1,18 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.13 # by the following command: # # pip-compile # -click==8.1.3 +click==8.1.7 # via # -r requirements.in # uvicorn h11==0.14.0 # via uvicorn -isort==5.10.1 +isort==5.13.2 # via -r requirements.in -urllib3==2.2.2 +urllib3==2.2.3 # via -r requirements.in -uvicorn==0.30.5 +uvicorn==0.32.0 # via -r requirements.in diff --git a/tests/fixtures/project_with_requirements_in/src/notebook.ipynb b/tests/fixtures/project_with_requirements_in/src/notebook.ipynb index a51bdb9de..909a5bcd5 100644 --- a/tests/fixtures/project_with_requirements_in/src/notebook.ipynb +++ b/tests/fixtures/project_with_requirements_in/src/notebook.ipynb @@ -9,7 +9,7 @@ "source": [ "import click\n", "from urllib3 import contrib\n", - "import toml" + "import tomli" ] } ], diff --git a/tests/fixtures/project_with_requirements_txt/requirements-2.txt b/tests/fixtures/project_with_requirements_txt/requirements-2.txt index 533248242..25ad25e77 100644 --- a/tests/fixtures/project_with_requirements_txt/requirements-2.txt +++ b/tests/fixtures/project_with_requirements_txt/requirements-2.txt @@ -1 +1 @@ -urllib3==1.26.12 +urllib3==2.2.3 diff --git a/tests/fixtures/project_with_requirements_txt/requirements-dev.txt b/tests/fixtures/project_with_requirements_txt/requirements-dev.txt index b173f0123..ad2b44c02 100644 --- a/tests/fixtures/project_with_requirements_txt/requirements-dev.txt +++ b/tests/fixtures/project_with_requirements_txt/requirements-dev.txt @@ -1 +1 @@ -black==22.6.0 +black==24.10.0 diff --git a/tests/fixtures/project_with_requirements_txt/requirements-typing.txt b/tests/fixtures/project_with_requirements_txt/requirements-typing.txt index 036dc1769..aadc6be02 100644 --- a/tests/fixtures/project_with_requirements_txt/requirements-typing.txt +++ b/tests/fixtures/project_with_requirements_txt/requirements-typing.txt @@ -1 +1 @@ -types-jsonschema==4.16.1 +types-jsonschema==4.23.0.20240813 diff --git a/tests/fixtures/project_with_requirements_txt/requirements.txt b/tests/fixtures/project_with_requirements_txt/requirements.txt index d5780b038..c9d5b1168 100644 --- a/tests/fixtures/project_with_requirements_txt/requirements.txt +++ b/tests/fixtures/project_with_requirements_txt/requirements.txt @@ -1,5 +1,5 @@ -click==8.1.3 -isort==5.10.1 -pkginfo==1.8.3 -requests==2.28.1 -toml==0.10.2 +click==8.1.7 +isort==5.13.2 +pkginfo==1.11.2 +requests==2.32.3 +tomli==2.0.2 diff --git a/tests/fixtures/project_with_requirements_txt/src/notebook.ipynb b/tests/fixtures/project_with_requirements_txt/src/notebook.ipynb index a51bdb9de..909a5bcd5 100644 --- a/tests/fixtures/project_with_requirements_txt/src/notebook.ipynb +++ b/tests/fixtures/project_with_requirements_txt/src/notebook.ipynb @@ -9,7 +9,7 @@ "source": [ "import click\n", "from urllib3 import contrib\n", - "import toml" + "import tomli" ] } ], diff --git a/tests/fixtures/project_with_setuptools_dynamic_dependencies/pyproject.toml b/tests/fixtures/project_with_setuptools_dynamic_dependencies/pyproject.toml index fcaf00399..5cdd3c7b1 100644 --- a/tests/fixtures/project_with_setuptools_dynamic_dependencies/pyproject.toml +++ b/tests/fixtures/project_with_setuptools_dynamic_dependencies/pyproject.toml @@ -5,6 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "foo" version = "0.0.1" +requires-python = ">=3.9" dynamic = ["dependencies", "optional-dependencies"] [tool.setuptools.dynamic] diff --git a/tests/fixtures/project_with_src_directory/pyproject.toml b/tests/fixtures/project_with_src_directory/pyproject.toml index 52de6916c..bfa016aa7 100644 --- a/tests/fixtures/project_with_src_directory/pyproject.toml +++ b/tests/fixtures/project_with_src_directory/pyproject.toml @@ -1,24 +1,22 @@ [project] -# PEP 621 project metadata -# See https://www.python.org/dev/peps/pep-0621/ name = "foo" -version = "1.2.3" -requires-python = ">=3.7" +version = "0.0.1" +requires-python = ">=3.9" dependencies = [ - "toml", - "urllib3>=1.26.12", - "isort>=5.10.1", - "click>=8.1.3", - "requests>=2.28.1", - "pkginfo>=1.8.3", + "click==8.1.7", + "isort>=5.13.2", + "pkginfo==1.11.2", + "requests==2.32.3", + "tomli==2.0.2", + "urllib3==2.2.3", ] [project.optional-dependencies] dev = [ - "black==22.10.0", - "mypy==0.982", + "black==24.10.0", + "mypy==1.13.0", ] -test = ["pytest==7.2.0"] +test = ["pytest==8.3.3"] [build-system] requires = ["setuptools>=61.0.0"] diff --git a/tests/fixtures/project_with_src_directory/src/project_with_src_directory/notebook.ipynb b/tests/fixtures/project_with_src_directory/src/project_with_src_directory/notebook.ipynb index a51bdb9de..909a5bcd5 100644 --- a/tests/fixtures/project_with_src_directory/src/project_with_src_directory/notebook.ipynb +++ b/tests/fixtures/project_with_src_directory/src/project_with_src_directory/notebook.ipynb @@ -9,7 +9,7 @@ "source": [ "import click\n", "from urllib3 import contrib\n", - "import toml" + "import tomli" ] } ], diff --git a/tests/fixtures/project_with_uv/pyproject.toml b/tests/fixtures/project_with_uv/pyproject.toml index a442ed368..3cd1bcd7d 100644 --- a/tests/fixtures/project_with_uv/pyproject.toml +++ b/tests/fixtures/project_with_uv/pyproject.toml @@ -1,13 +1,11 @@ [project] -# PEP 621 project metadata -# See https://www.python.org/dev/peps/pep-0621/ name = "foo" version = "0.0.1" -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ - "pkginfo==1.11.1", - "tomli==2.0.1", - "urllib3==2.2.2", + "pkginfo==1.11.2", + "tomli==2.0.2", + "urllib3==2.2.3", ] [project.optional-dependencies] @@ -20,15 +18,15 @@ bar = ["requests==2.32.3"] [dependency-groups] doc = [ "mkdocs==1.6.1", - "mkdocs-material==9.5.40", + "mkdocs-material==9.5.42", ] all = [{include-group = "doc"}, "packaging==24.1"] [tool.uv] dev-dependencies = [ - "black==24.8.0", - "mypy==1.11.1", - "pytest==8.2.0", + "black==24.10.0", + "mypy==1.13.0", + "pytest==8.3.3", "pytest-cov==5.0.0", ] diff --git a/tests/functional/cli/test_cli.py b/tests/functional/cli/test_cli.py index 55d679f41..60c6f663a 100644 --- a/tests/functional/cli/test_cli.py +++ b/tests/functional/cli/test_cli.py @@ -85,9 +85,9 @@ def test_cli_ignore_notebooks(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'toml' defined as a dependency but not used in the codebase", + "message": "'isort' defined as a dependency but not used in the codebase", }, - "module": "toml", + "module": "isort", "location": { "file": str(Path("pyproject.toml")), "line": None, @@ -97,9 +97,9 @@ def test_cli_ignore_notebooks(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'isort' defined as a dependency but not used in the codebase", + "message": "'requests' defined as a dependency but not used in the codebase", }, - "module": "isort", + "module": "requests", "location": { "file": str(Path("pyproject.toml")), "line": None, @@ -109,9 +109,9 @@ def test_cli_ignore_notebooks(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'requests' defined as a dependency but not used in the codebase", + "message": "'tomli' defined as a dependency but not used in the codebase", }, - "module": "requests", + "module": "tomli", "location": { "file": str(Path("pyproject.toml")), "line": None, @@ -172,9 +172,9 @@ def test_cli_exclude(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'toml' defined as a dependency but not used in the codebase", + "message": "'isort' defined as a dependency but not used in the codebase", }, - "module": "toml", + "module": "isort", "location": { "file": str(Path("pyproject.toml")), "line": None, @@ -184,9 +184,9 @@ def test_cli_exclude(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'isort' defined as a dependency but not used in the codebase", + "message": "'requests' defined as a dependency but not used in the codebase", }, - "module": "isort", + "module": "requests", "location": { "file": str(Path("pyproject.toml")), "line": None, @@ -196,9 +196,9 @@ def test_cli_exclude(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'requests' defined as a dependency but not used in the codebase", + "message": "'tomli' defined as a dependency but not used in the codebase", }, - "module": "requests", + "module": "tomli", "location": { "file": str(Path("pyproject.toml")), "line": None, @@ -243,9 +243,9 @@ def test_cli_extend_exclude(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'toml' defined as a dependency but not used in the codebase", + "message": "'isort' defined as a dependency but not used in the codebase", }, - "module": "toml", + "module": "isort", "location": { "file": str(Path("pyproject.toml")), "line": None, @@ -255,9 +255,9 @@ def test_cli_extend_exclude(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'isort' defined as a dependency but not used in the codebase", + "message": "'requests' defined as a dependency but not used in the codebase", }, - "module": "isort", + "module": "requests", "location": { "file": str(Path("pyproject.toml")), "line": None, @@ -267,9 +267,9 @@ def test_cli_extend_exclude(poetry_venv_factory: PoetryVenvFactory) -> None: { "error": { "code": "DEP002", - "message": "'requests' defined as a dependency but not used in the codebase", + "message": "'tomli' defined as a dependency but not used in the codebase", }, - "module": "requests", + "module": "tomli", "location": { "file": str(Path("pyproject.toml")), "line": None, diff --git a/tests/functional/cli/test_cli_multiple_source_directories.py b/tests/functional/cli/test_cli_multiple_source_directories.py index b4b6eaaa3..85c499425 100644 --- a/tests/functional/cli/test_cli_multiple_source_directories.py +++ b/tests/functional/cli/test_cli_multiple_source_directories.py @@ -22,8 +22,8 @@ def test_cli_with_multiple_source_directories(pip_venv_factory: PipVenvFactory) assert result.returncode == 1 assert get_issues_report(Path(issue_report)) == [ { - "error": {"code": "DEP002", "message": "'toml' defined as a dependency but not used in the codebase"}, - "module": "toml", + "error": {"code": "DEP002", "message": "'tomli' defined as a dependency but not used in the codebase"}, + "module": "tomli", "location": {"file": str(Path("pyproject.toml")), "line": None, "column": None}, }, { diff --git a/tests/functional/cli/test_cli_requirements_in.py b/tests/functional/cli/test_cli_requirements_in.py index 36efb2cec..eb7c79dab 100644 --- a/tests/functional/cli/test_cli_requirements_in.py +++ b/tests/functional/cli/test_cli_requirements_in.py @@ -56,6 +56,11 @@ def test_cli_single_requirements_files(pip_venv_factory: PipVenvFactory) -> None "module": "white", "location": {"file": str(Path("src/main.py")), "line": 7, "column": 8}, }, + { + "error": {"code": "DEP001", "message": "'tomli' imported but missing from the dependency definitions"}, + "module": "tomli", + "location": {"file": str(Path("src/notebook.ipynb")), "line": 3, "column": 8}, + }, ] @@ -98,4 +103,9 @@ def test_cli_multiple_requirements_files(pip_venv_factory: PipVenvFactory) -> No "module": "white", "location": {"file": str(Path("src/main.py")), "line": 7, "column": 8}, }, + { + "error": {"code": "DEP001", "message": "'tomli' imported but missing from the dependency definitions"}, + "module": "tomli", + "location": {"file": str(Path("src/notebook.ipynb")), "line": 3, "column": 8}, + }, ]