From fb39a851b4ad35d5675e54c2b3a6a6e67a415f22 Mon Sep 17 00:00:00 2001 From: Anis Date: Mon, 29 Jan 2024 08:17:50 +0000 Subject: [PATCH 1/3] define dev dependencies in the requirement file only we can mix pyproject.toml and dependency files, as the first one will be used while installing the package but the last one only serve in the CI. Keeping the dev requirement in one place will simplify the requirement management --- pyproject.toml | 8 -------- requirements/dev.in | 3 +++ requirements/dev.txt | 4 +++- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fc92aa2..578d0da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,14 +45,6 @@ dependencies = [ "pytest>=4.6", ] -[project.optional-dependencies] -test = [ - "pytest", - "pytest-cov", - # For linting purposes, only pylint>3 is supported - "pylint>=3", -] - [project.urls] Changelog = "https://github.com/pylint-dev/pylint-pytest/blob/master/CHANGELOG.md" Documentation = "https://github.com/pylint-dev/pylint-pytest#readme" diff --git a/requirements/dev.in b/requirements/dev.in index 2926cab..8348690 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -1,3 +1,6 @@ +# For linting purposes, only pylint>3 is supported +pylint>=3 + # to handle dependencies pip-tools wheel diff --git a/requirements/dev.txt b/requirements/dev.txt index f8bc247..ef01a5b 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -135,7 +135,9 @@ pre-commit==3.5.0 \ pylint==3.0.2 \ --hash=sha256:0d4c286ef6d2f66c8bfb527a7f8a629009e42c99707dec821a03e1b51a4c1496 \ --hash=sha256:60ed5f3a9ff8b61839ff0348b3624ceeb9e6c2a92c514d81c9cc273da3b6bcda - # via pylint-pytest (pyproject.toml) + # via + # -r requirements/dev.in + # pylint-pytest (pyproject.toml) pyproject-hooks==1.0.0 \ --hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \ --hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5 From 000a314e50e18c6d34993d485262d3509976b67d Mon Sep 17 00:00:00 2001 From: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:21:09 +0200 Subject: [PATCH 2/3] Leave a deprecation note for the future readers Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com> --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 578d0da..11c86aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,8 @@ dependencies = [ "pytest>=4.6", ] +# [project.optional-dependencies] moved to requirements/dev.in + [project.urls] Changelog = "https://github.com/pylint-dev/pylint-pytest/blob/master/CHANGELOG.md" Documentation = "https://github.com/pylint-dev/pylint-pytest#readme" From a902b181cb81ef809997abdac07203d80bff3c16 Mon Sep 17 00:00:00 2001 From: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:24:16 +0200 Subject: [PATCH 3/3] Remove `pyproject.toml` references from the development extra dependencies Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com> --- Makefile | 6 +++--- requirements/dev.txt | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9209c6e..ee70603 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,12 @@ export PYTHONPATH=. pip install --quiet --upgrade 'pip==23.3.1' 'pip-tools==7.3' # generates a lock file with pinned version of all dependencies to be used by the CI and local devs -requirements/dev.txt: .venv requirements/dev.in pyproject.toml +requirements/dev.txt: .venv requirements/dev.in pip-compile \ --quiet --generate-hashes --max-rounds=20 --strip-extras \ --resolver=backtracking \ --output-file requirements/dev.txt \ - requirements/dev.in pyproject.toml + requirements/dev.in # upgrades the dependencies to their latest/matching version .PHONY: upgrade @@ -26,7 +26,7 @@ upgrade: .venv --upgrade \ --resolver=backtracking \ --output-file requirements/dev.txt \ - requirements/dev.in pyproject.toml + requirements/dev.in # creates the venv if not present then install the dependencies, the package and pre-commit diff --git a/requirements/dev.txt b/requirements/dev.txt index ef01a5b..207c5e2 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --generate-hashes --max-rounds=20 --output-file=requirements/dev.txt --strip-extras pyproject.toml requirements/dev.in +# pip-compile --generate-hashes --max-rounds=20 --output-file=requirements/dev.txt --strip-extras requirements/dev.in # astroid==3.0.1 \ --hash=sha256:7d5895c9825e18079c5aeac0572bc2e4c83205c95d416e0b4fee8bc361d2d9ca \ @@ -135,9 +135,7 @@ pre-commit==3.5.0 \ pylint==3.0.2 \ --hash=sha256:0d4c286ef6d2f66c8bfb527a7f8a629009e42c99707dec821a03e1b51a4c1496 \ --hash=sha256:60ed5f3a9ff8b61839ff0348b3624ceeb9e6c2a92c514d81c9cc273da3b6bcda - # via - # -r requirements/dev.in - # pylint-pytest (pyproject.toml) + # via -r requirements/dev.in pyproject-hooks==1.0.0 \ --hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \ --hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5 @@ -147,7 +145,6 @@ pytest==7.4.3 \ --hash=sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5 # via # -r requirements/dev.in - # pylint-pytest (pyproject.toml) # pytest-cov pytest-cov==4.1.0 \ --hash=sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6 \