From 860857354c29b107db8863cdc01a19ca374d9942 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 31 May 2025 22:04:19 +0300 Subject: [PATCH 1/9] chore: remove requirements.txt files --- .github/workflows/main.yml | 4 +--- .gitpod.yml | 4 ++-- docs/requirements.txt | 3 --- noxfile.py | 11 +++-------- pyproject.toml | 12 ++++++++++++ requirements-dev.txt | 5 ----- 6 files changed, 18 insertions(+), 21 deletions(-) delete mode 100644 docs/requirements.txt delete mode 100644 requirements-dev.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6333198a..e4a33d50 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.x' - - run: pip install -r requirements-dev.txt - name: Run pre-commit run: | @@ -63,7 +62,7 @@ jobs: python-version: ${{ matrix.py }} - run: | pip install --upgrade pip - pip install -r requirements-dev.txt + pip install .[dev] - name: Download wheel artifact uses: actions/download-artifact@v4 @@ -85,7 +84,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.10" - - run: pip install -r requirements-dev.txt - name: Build docs run: nox -s docs diff --git a/.gitpod.yml b/.gitpod.yml index 8123636f..4f2f4757 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -3,6 +3,6 @@ # and commit this file to your remote git repository to share the goodness with others. tasks: - - before: pip install --upgrade pip && pip install -r requirements-dev.txt + - before: pip install --upgrade pip init: pre-commit install - command: pip install -e . + command: pip install -e .[dev] diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index af718d9f..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ - -. -sphinx-immaterial diff --git a/noxfile.py b/noxfile.py index 079df8af..f400f890 100644 --- a/noxfile.py +++ b/noxfile.py @@ -4,11 +4,6 @@ nox.options.reuse_existing_virtualenvs = True nox.options.sessions = ["lint"] -REQUIREMENTS = { - "dev": "requirements-dev.txt", - "docs": "docs/requirements.txt", -} - # ----------------------------------------------------------------------------- # Development Commands # ----------------------------------------------------------------------------- @@ -55,7 +50,7 @@ def commit_check(session): @nox.session() def coverage(session): session.install(".") - session.install("-r", REQUIREMENTS["dev"]) + session.install("-r", '.[dev]') session.run("coverage", "run", "--source", "commit_check", "-m", "pytest") session.run("coverage", "report") session.run("coverage", "xml") @@ -64,12 +59,12 @@ def coverage(session): @nox.session() def docs(session): session.install(".") - session.install("-r", REQUIREMENTS["docs"]) + session.install("-r", '.[docs]') session.run("sphinx-build", "-E", "-W", "-b", "html", "docs", "_build/html") @nox.session(name="docs-live") def docs_live(session): session.install(".") - session.install("-r", REQUIREMENTS["docs"], "sphinx-autobuild") + session.install("-r", '.[docs]', "sphinx-autobuild") session.run("sphinx-autobuild", "-b", "html", "docs", "_build/html") diff --git a/pyproject.toml b/pyproject.toml index c84d1818..4280d49e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,18 @@ tracker = "https://github.com/commit-check/commit-check/issues" # ... other project metadata fields as specified in: # https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ +[dependency-groups] +dev = [ + 'coverage', + 'nox', + 'pytest', + 'pytest-mock', +] +docs = [ + ".", + "sphinx-immaterial", +] + [tool.setuptools] zip-safe = false packages = ["commit_check"] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 120645f0..00000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -coverage -git+https://github.com/wntrblm/nox.git@main -pre-commit -pytest -pytest-mock From e247fd3784b72dcdeede6e11c00759c79d092770 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 31 May 2025 22:51:50 +0300 Subject: [PATCH 2/9] install nox --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e4a33d50..28cbc80b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,11 @@ jobs: with: python-version: '3.x' + - name: Install nox + run: | + python -m pip install --upgrade pip + python -m pip install nox + - name: Run pre-commit run: | nox -s lint From fdaa1911c9818ab8e91a2e46d1e5a697e875f2de Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 31 May 2025 22:55:09 +0300 Subject: [PATCH 3/9] install nox --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28cbc80b..e470c14b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -90,6 +90,11 @@ jobs: with: python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade pip + python -m pip install nox + - name: Build docs run: nox -s docs From 91a8f93be7cb8d39e5ab1f9d9408aaea12e069d4 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 31 May 2025 22:56:46 +0300 Subject: [PATCH 4/9] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index f400f890..b169df99 100644 --- a/noxfile.py +++ b/noxfile.py @@ -50,7 +50,7 @@ def commit_check(session): @nox.session() def coverage(session): session.install(".") - session.install("-r", '.[dev]') + session.install('.[dev]') session.run("coverage", "run", "--source", "commit_check", "-m", "pytest") session.run("coverage", "report") session.run("coverage", "xml") From fc9f2f7d65604bd252cda2c69a308281238c7b97 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 31 May 2025 22:57:06 +0300 Subject: [PATCH 5/9] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index b169df99..d7f6658c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -66,5 +66,5 @@ def docs(session): @nox.session(name="docs-live") def docs_live(session): session.install(".") - session.install("-r", '.[docs]', "sphinx-autobuild") + session.install('.[docs]', "sphinx-autobuild") session.run("sphinx-autobuild", "-b", "html", "docs", "_build/html") From 32633b64349014c29fcecb170618a8f0de06741c Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 31 May 2025 23:03:15 +0300 Subject: [PATCH 6/9] update noxfile.py --- noxfile.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index d7f6658c..91327887 100644 --- a/noxfile.py +++ b/noxfile.py @@ -49,7 +49,6 @@ def commit_check(session): @nox.session() def coverage(session): - session.install(".") session.install('.[dev]') session.run("coverage", "run", "--source", "commit_check", "-m", "pytest") session.run("coverage", "report") @@ -58,13 +57,11 @@ def coverage(session): @nox.session() def docs(session): - session.install(".") - session.install("-r", '.[docs]') + session.install('.[docs]') session.run("sphinx-build", "-E", "-W", "-b", "html", "docs", "_build/html") @nox.session(name="docs-live") def docs_live(session): - session.install(".") session.install('.[docs]', "sphinx-autobuild") session.run("sphinx-autobuild", "-b", "html", "docs", "_build/html") From 46e0c78515eb36452ba31b3fc2ea995b683b51be Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 31 May 2025 23:09:18 +0300 Subject: [PATCH 7/9] update noxfile.py and pyproject.tom --- noxfile.py | 2 +- pyproject.toml | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/noxfile.py b/noxfile.py index 91327887..5711f6a9 100644 --- a/noxfile.py +++ b/noxfile.py @@ -49,7 +49,7 @@ def commit_check(session): @nox.session() def coverage(session): - session.install('.[dev]') + session.install('.[test]') session.run("coverage", "run", "--source", "commit_check", "-m", "pytest") session.run("coverage", "report") session.run("coverage", "xml") diff --git a/pyproject.toml b/pyproject.toml index 4280d49e..93ff1f73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,16 +41,9 @@ tracker = "https://github.com/commit-check/commit-check/issues" # https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ [dependency-groups] -dev = [ - 'coverage', - 'nox', - 'pytest', - 'pytest-mock', -] -docs = [ - ".", - "sphinx-immaterial", -] +dev = ['nox'] +test = ['coverage', 'pytest', 'pytest-mock'] +docs = ['sphinx-immaterial'] [tool.setuptools] zip-safe = false From d2c3302a7dbc66fad167143e3a6f7600cb15068c Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 1 Jun 2025 19:18:16 +0300 Subject: [PATCH 8/9] fix pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 93ff1f73..cca2794f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ tracker = "https://github.com/commit-check/commit-check/issues" # ... other project metadata fields as specified in: # https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ -[dependency-groups] +[project.optional-dependencies] dev = ['nox'] test = ['coverage', 'pytest', 'pytest-mock'] docs = ['sphinx-immaterial'] From 2cb7753d98673d57ae2f1286c4a34570d7a32219 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 1 Jun 2025 19:26:32 +0300 Subject: [PATCH 9/9] move sphinx-autobuild into pyproject.toml --- noxfile.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 5711f6a9..50599af3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -63,5 +63,5 @@ def docs(session): @nox.session(name="docs-live") def docs_live(session): - session.install('.[docs]', "sphinx-autobuild") + session.install('.[docs]') session.run("sphinx-autobuild", "-b", "html", "docs", "_build/html") diff --git a/pyproject.toml b/pyproject.toml index cca2794f..3f0759e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ tracker = "https://github.com/commit-check/commit-check/issues" [project.optional-dependencies] dev = ['nox'] test = ['coverage', 'pytest', 'pytest-mock'] -docs = ['sphinx-immaterial'] +docs = ['sphinx-immaterial', 'sphinx-autobuild'] [tool.setuptools] zip-safe = false