From 0e6cbbd55024a178f737e3ae3887610caad1030a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez-Garc=C3=ADa?= Date: Sun, 17 Nov 2024 23:39:16 +0000 Subject: [PATCH 1/5] Split extra dependencies and dependency groups --- pyproject.toml | 62 ++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 517ee94c..b261f463 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,38 +51,9 @@ dependencies = [ csv = [ "pandas", ] -dev = [ - "bump2version", - "coverage", - "mypy", - "parameterized", - "pre-commit-uv", - "Pillow", - "pytest", - "pytest-cov", - "pytest-sugar", - "tox-uv", - "types-Deprecated", -] -doc = [ - "einops", - "furo", - "matplotlib", - "sphinx", - "sphinx-autobuild", - "sphinx-copybutton", - "sphinx-gallery", - "sphinxext-opengraph", -] plot = [ "matplotlib", ] -all = [ - "torchio[doc]", - "torchio[plot]", - "torchio[csv]", - "torchio[dev]", -] [project.scripts] tiohd = "torchio.cli.print_info:app" @@ -96,6 +67,38 @@ Source = "https://github.com/fepegar/torchio" Documentation = "http://torchio.rtfd.io" "Release notes" = "https://github.com/fepegar/torchio/releases" +[dependency-groups] +dev = [ + { include-group = "doc" }, + { include-group = "maintain" }, + { include-group = "test" }, +] +doc = [ + "einops", + "furo", + "matplotlib", + "sphinx", + "sphinx-autobuild", + "sphinx-copybutton", + "sphinx-gallery", + "sphinxext-opengraph", +] +maintain = [ + "bump2version", + "pre-commit-uv", +] +test = [ + "coverage", + "mypy", + "parameterized", + "pillow", + "pytest", + "pytest-cov", + "pytest-sugar", + "tox-uv", + "types-deprecated", +] + [tool.mypy] pretty = true @@ -146,6 +149,5 @@ ignore = [ "N813", ] - [tool.ruff.lint.isort] force-single-line = true From 0a9be65e8dee6dd93b7a342ebb10228b55452c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez-Garc=C3=ADa?= Date: Mon, 18 Nov 2024 00:00:41 +0000 Subject: [PATCH 2/5] Update docs --- CONTRIBUTING.rst | 26 ++++++++++++-------------- pyproject.toml | 2 ++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 5747d435..6046f9c1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -9,10 +9,10 @@ helps, and credit will always be given. You can contribute in many ways: -Types of Contributions +Types of contributions ---------------------- -Report Bugs +Report bugs ~~~~~~~~~~~ Report bugs @@ -24,26 +24,26 @@ If you are reporting a bug, please include: * Any details about your local setup that might be helpful in troubleshooting. * Detailed steps to reproduce the bug. -Fix Bugs +Fix bugs ~~~~~~~~ Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it. -Implement Features +Implement features ~~~~~~~~~~~~~~~~~~ Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. -Write Documentation +Write documentation ~~~~~~~~~~~~~~~~~~~ TorchIO could always use more documentation, whether as part of the official TorchIO docs, in docstrings, or even on the web in blog posts, articles, and such. -Submit Feedback +Submit feedback ~~~~~~~~~~~~~~~ The best way to send feedback is to file an issue at https://github.com/fepegar/torchio/issues. @@ -55,8 +55,8 @@ If you are proposing a feature: * Remember that this is a volunteer-driven project, and that contributions are welcome :) -Get Started! ------------- +Getting started +--------------- Ready to contribute? Here's how to set up ``torchio`` for local development. @@ -80,11 +80,9 @@ already be implemented. 4) Install your local copy into a virtual environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you use ``conda``, this is how you can set up your fork for local development:: +``uv`` is recommended for development:: - conda create --name torchioenv python --yes - conda activate torchioenv - pip install --editable ".[all]" + uv sync --all-extras pre-commit install 5) Create a branch for local development using the issue number @@ -92,7 +90,7 @@ If you use ``conda``, this is how you can set up your fork for local development For example, if the issue number is 55:: - git checkout -b 55-name-of-your-bugfix-or-feature + git switch --create 55-name-of-your-bugfix-or-feature Now you can make your changes locally. @@ -113,7 +111,7 @@ messages `_, and `here's some more `_):: git add . - git commit -m "Fix nasty bug" + git commit --mesage "Fix nasty bug" git push origin 55-name-of-your-bugfix-or-feature 8) Check documentation diff --git a/pyproject.toml b/pyproject.toml index b261f463..a194eb1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,6 +72,8 @@ dev = [ { include-group = "doc" }, { include-group = "maintain" }, { include-group = "test" }, + "ipykernel", + "ruff", ] doc = [ "einops", From f9e9d71124ab76e99152abea4c190e7e013b9808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez-Garc=C3=ADa?= Date: Thu, 28 Nov 2024 23:29:25 +0000 Subject: [PATCH 3/5] Discard changes to CONTRIBUTING.rst --- CONTRIBUTING.rst | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 6046f9c1..5747d435 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -9,10 +9,10 @@ helps, and credit will always be given. You can contribute in many ways: -Types of contributions +Types of Contributions ---------------------- -Report bugs +Report Bugs ~~~~~~~~~~~ Report bugs @@ -24,26 +24,26 @@ If you are reporting a bug, please include: * Any details about your local setup that might be helpful in troubleshooting. * Detailed steps to reproduce the bug. -Fix bugs +Fix Bugs ~~~~~~~~ Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it. -Implement features +Implement Features ~~~~~~~~~~~~~~~~~~ Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. -Write documentation +Write Documentation ~~~~~~~~~~~~~~~~~~~ TorchIO could always use more documentation, whether as part of the official TorchIO docs, in docstrings, or even on the web in blog posts, articles, and such. -Submit feedback +Submit Feedback ~~~~~~~~~~~~~~~ The best way to send feedback is to file an issue at https://github.com/fepegar/torchio/issues. @@ -55,8 +55,8 @@ If you are proposing a feature: * Remember that this is a volunteer-driven project, and that contributions are welcome :) -Getting started ---------------- +Get Started! +------------ Ready to contribute? Here's how to set up ``torchio`` for local development. @@ -80,9 +80,11 @@ already be implemented. 4) Install your local copy into a virtual environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -``uv`` is recommended for development:: +If you use ``conda``, this is how you can set up your fork for local development:: - uv sync --all-extras + conda create --name torchioenv python --yes + conda activate torchioenv + pip install --editable ".[all]" pre-commit install 5) Create a branch for local development using the issue number @@ -90,7 +92,7 @@ already be implemented. For example, if the issue number is 55:: - git switch --create 55-name-of-your-bugfix-or-feature + git checkout -b 55-name-of-your-bugfix-or-feature Now you can make your changes locally. @@ -111,7 +113,7 @@ messages `_, and `here's some more `_):: git add . - git commit --mesage "Fix nasty bug" + git commit -m "Fix nasty bug" git push origin 55-name-of-your-bugfix-or-feature 8) Check documentation From baf34008319a42c5e43d0489f5208728d8cc0979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez-Garc=C3=ADa?= Date: Thu, 28 Nov 2024 23:38:56 +0000 Subject: [PATCH 4/5] Use new syntax for dependency groups --- .readthedocs.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index dc688110..4b2e56d4 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -19,10 +19,5 @@ build: os: ubuntu-22.04 tools: python: "3.12" - -python: - install: - - method: pip - path: . - extra_requirements: - - doc + commands: + - pip install . --dependency-groups=doc From cebbb8a07aa6b4a1f0322ed1febe1f2b049ea6d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez-Garc=C3=ADa?= Date: Mon, 2 Dec 2024 23:56:20 +0000 Subject: [PATCH 5/5] Apply suggestion --- .readthedocs.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 4b2e56d4..c3596b06 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -19,5 +19,8 @@ build: os: ubuntu-22.04 tools: python: "3.12" - commands: - - pip install . --dependency-groups=doc + jobs: + install: + - pip install . + - pip install dependency-groups + - pip-install-dependency-groups doc