diff --git a/locales/es/LC_MESSAGES/package-structure-code.po b/locales/es/LC_MESSAGES/package-structure-code.po index f21465fc..f6cb7704 100644 --- a/locales/es/LC_MESSAGES/package-structure-code.po +++ b/locales/es/LC_MESSAGES/package-structure-code.po @@ -1147,11 +1147,11 @@ msgstr "Dependencias recursivas" #: ../../package-structure-code/declare-dependencies.md:32 msgid "" -"Specifying dependencies in the [project.dependency] array of your " +"Specifying dependencies in the `project.dependencies` array of your " "`pyproject.toml` file ensures that libraries needed to run your package " "are correctly installed into a user's environment. For instance, if your " "package requires Pandas to run properly, and you add Pandas to the " -"`project.dependency` array, Pandas will be installed into the users' " +"`project.dependencies` array, Pandas will be installed into the users' " "environment when they install your package using uv, pip, or conda." msgstr "" @@ -1161,7 +1161,7 @@ msgid "" "package. You can set up instructions for running specific workflows, such" " as tests, linting, and even typing, that automatically install groups of" " development dependencies. These dependencies can be stored in arrays " -"(lists of dependencies) within a `[development-group]` table." +"(lists of dependencies) within a `[dependency-groups]` table." msgstr "" #: ../../package-structure-code/declare-dependencies.md:55 @@ -1179,7 +1179,7 @@ msgstr "" msgid "" "**Required dependencies:** These are dependencies that need to be " "installed for your package to work correctly in a user's environment. You" -" add these dependencies to the `[project.dependencies]` table in your " +" add these dependencies to the `project.dependencies` table in your " "pyproject.toml file." msgstr "" @@ -1187,7 +1187,7 @@ msgstr "" msgid "" "**Feature Dependencies:** These are dependencies that are required if a " "user wants to access additional functionality (that is not core) to your " -"package. Store these in the `[project.optional.dependencies]` table or " +"package. Store these in the `[project.optional-dependencies]` table of " "your pyproject.toml file." msgstr "" @@ -1196,7 +1196,7 @@ msgid "" "**Development Dependencies:** These dependencies are required if someone " "wants to develop or work on your package. These include instance linters," " testing tools like pytest and mypy are examples of development " -"dependencies. Store these in the `[project.dependency.groups]` table or " +"dependencies. Store these in the `[dependency-groups]` table of " "your pyproject.toml file." msgstr "" @@ -1257,7 +1257,7 @@ msgid "**Add a required dependency:**" msgstr "" #: ../../package-structure-code/declare-dependencies.md:110 -msgid "Will add numpy as a dependency to your `project.dependency` array:" +msgid "Will add numpy as a dependency to your `project.dependencies` array:" msgstr "" #: ../../package-structure-code/declare-dependencies.md:121 @@ -1298,7 +1298,7 @@ msgid "" "users as needed. Optional dependencies add specific features to your " "package that not all users need. For example, if your package has an " "optional interactive plotting feature that uses Bokeh, you would list " -"Bokeh as an `[optional.dependency]`. Users who want interactive plotting " +"Bokeh under `[project.optional-dependencies]`. Users who want interactive plotting " "will install it. Users who don't need plotting don't have to install it." msgstr "" @@ -1318,7 +1318,7 @@ msgstr "" #: ../../package-structure-code/declare-dependencies.md #, fuzzy -msgid "How to Add optional.dependencies using UV" +msgid "How to add optional dependencies using UV" msgstr "Dependencias opcionales" #: ../../package-structure-code/declare-dependencies.md:164 @@ -1374,7 +1374,7 @@ msgstr "Crear grupos de dependencias opcionales" #: ../../package-structure-code/declare-dependencies.md:199 msgid "" -"`[development-groups]` is a newer specification introduced by PEP 735. " +"`[dependency-groups]` is a newer specification introduced by PEP 735. " "They are intended to organize development dependencies and are " "intentionally separate from `[project.optional-dependencies]`, which can" " be installed into a user's environment." @@ -1389,7 +1389,7 @@ msgstr "¿Cómo declarar dependencias?" #, fuzzy msgid "" "You declare development dependencies in your **pyproject.toml** file " -"within a `[development-groups]` table." +"within a `[dependency-groups]` table." msgstr "Para declarar dependencias opcionales en su archivo **pyproject.toml**:" #: ../../package-structure-code/declare-dependencies.md:209 @@ -1399,11 +1399,11 @@ msgid "" msgstr "" #: ../../package-structure-code/declare-dependencies.md -msgid "How to Add [development.group] using UV" +msgid "How to Add [dependency-groups] using UV" msgstr "" #: ../../package-structure-code/declare-dependencies.md:225 -msgid "**Add a development group dependency:**" +msgid "**Add a development dependency group:**" msgstr "" #: ../../package-structure-code/declare-dependencies.md:232 @@ -1561,7 +1561,7 @@ msgstr "" #: ../../package-structure-code/declare-dependencies.md:299 #, fuzzy -msgid "**Install development groups:**" +msgid "**Install dependency groups:**" msgstr "Instalar grupos de dependencias" #: ../../package-structure-code/declare-dependencies.md @@ -7501,7 +7501,7 @@ msgstr "" #~ "the `project` table of your " #~ "`pyproject.toml` file. If they are " #~ "optional, they will be listed in " -#~ "the `[optional.dependencies]` table of your" +#~ "the `[project.optional-dependencies]` table of your" #~ " `pyproject.toml`." #~ msgstr "" #~ "Puede pensar en las dependencias como" @@ -7510,7 +7510,7 @@ msgstr "" #~ "`dependency` en la tabla `project` de" #~ " su archivo `pyproject.toml`. Si son " #~ "opcionales, se listarán en la tabla " -#~ "`[optional.dependencies]` de su `pyproject.toml`." +#~ "`[project.optional-dependencies]` de su `pyproject.toml`." #~ msgid "You will learn about both below." #~ msgstr "Aprenderá sobre ambos tipos a continuación." @@ -7819,7 +7819,7 @@ msgstr "" #~ "instalar y usar su paquete. Las " #~ "dependencias de funcionalidades se consideran" #~ " opcionales y también deben colocarse " -#~ "en la tabla `[optional.dependencies]`." +#~ "en la tabla `[project.optional-dependencies]`." #~ msgid "" #~ "Optional dependencies can be stored in" diff --git a/locales/ja/LC_MESSAGES/package-structure-code.po b/locales/ja/LC_MESSAGES/package-structure-code.po index 36b720c9..79f923f2 100644 --- a/locales/ja/LC_MESSAGES/package-structure-code.po +++ b/locales/ja/LC_MESSAGES/package-structure-code.po @@ -975,11 +975,11 @@ msgstr "再帰的依存関係" #: ../../package-structure-code/declare-dependencies.md:32 msgid "" -"Specifying dependencies in the [project.dependency] array of your " +"Specifying dependencies in the `project.dependencies` array of your " "`pyproject.toml` file ensures that libraries needed to run your package " "are correctly installed into a user's environment. For instance, if your " "package requires Pandas to run properly, and you add Pandas to the " -"`project.dependency` array, Pandas will be installed into the users' " +"`project.dependencies` array, Pandas will be installed into the users' " "environment when they install your package using uv, pip, or conda." msgstr "" @@ -989,7 +989,7 @@ msgid "" "package. You can set up instructions for running specific workflows, such" " as tests, linting, and even typing, that automatically install groups of" " development dependencies. These dependencies can be stored in arrays " -"(lists of dependencies) within a `[development-group]` table." +"(lists of dependencies) within a `[dependency-groups]` table." msgstr "" #: ../../package-structure-code/declare-dependencies.md:55 @@ -1007,7 +1007,7 @@ msgstr "" msgid "" "**Required dependencies:** These are dependencies that need to be " "installed for your package to work correctly in a user's environment. You" -" add these dependencies to the `[project.dependencies]` table in your " +" add these dependencies to the `project.dependencies` table in your " "pyproject.toml file." msgstr "" @@ -1015,7 +1015,7 @@ msgstr "" msgid "" "**Feature Dependencies:** These are dependencies that are required if a " "user wants to access additional functionality (that is not core) to your " -"package. Store these in the `[project.optional.dependencies]` table or " +"package. Store these in the `[project.optional-dependencies]` table of " "your pyproject.toml file." msgstr "" @@ -1024,7 +1024,7 @@ msgid "" "**Development Dependencies:** These dependencies are required if someone " "wants to develop or work on your package. These include instance linters," " testing tools like pytest and mypy are examples of development " -"dependencies. Store these in the `[project.dependency.groups]` table or " +"dependencies. Store these in the `[dependency-groups]` table of " "your pyproject.toml file." msgstr "" @@ -1080,7 +1080,7 @@ msgid "**Add a required dependency:**" msgstr "" #: ../../package-structure-code/declare-dependencies.md:110 -msgid "Will add numpy as a dependency to your `project.dependency` array:" +msgid "Will add numpy as a dependency to your `project.dependencies` array:" msgstr "" #: ../../package-structure-code/declare-dependencies.md:121 @@ -1117,7 +1117,7 @@ msgid "" "users as needed. Optional dependencies add specific features to your " "package that not all users need. For example, if your package has an " "optional interactive plotting feature that uses Bokeh, you would list " -"Bokeh as an `[optional.dependency]`. Users who want interactive plotting " +"Bokeh under `[project.optional-dependencies]`. Users who want interactive plotting " "will install it. Users who don't need plotting don't have to install it." msgstr "" @@ -1135,7 +1135,7 @@ msgstr "" #: ../../package-structure-code/declare-dependencies.md #, fuzzy -msgid "How to Add optional.dependencies using UV" +msgid "How to add optional dependencies using UV" msgstr "オプションの依存関係" #: ../../package-structure-code/declare-dependencies.md:164 @@ -1191,7 +1191,7 @@ msgstr "オプションの依存グループを作成する" #: ../../package-structure-code/declare-dependencies.md:199 msgid "" -"`[development-groups]` is a newer specification introduced by PEP 735. " +"`[dependency-groups]` is a newer specification introduced by PEP 735. " "They are intended to organize development dependencies and are " "intentionally separate from `[project.optional-dependencies]`, which can" " be installed into a user's environment." @@ -1206,7 +1206,7 @@ msgstr "依存関係はどのように宣言するのか?" #, fuzzy msgid "" "You declare development dependencies in your **pyproject.toml** file " -"within a `[development-groups]` table." +"within a `[dependency-groups]` table." msgstr "**pyproject.toml** ファイルでオプションの依存関係を宣言します:" #: ../../package-structure-code/declare-dependencies.md:209 @@ -1216,11 +1216,11 @@ msgid "" msgstr "" #: ../../package-structure-code/declare-dependencies.md -msgid "How to Add [development.group] using UV" +msgid "How to Add [dependency-groups] using UV" msgstr "" #: ../../package-structure-code/declare-dependencies.md:225 -msgid "**Add a development group dependency:**" +msgid "**Add a development dependency group:**" msgstr "" #: ../../package-structure-code/declare-dependencies.md:232 @@ -1371,7 +1371,7 @@ msgstr "" #: ../../package-structure-code/declare-dependencies.md:299 #, fuzzy -msgid "**Install development groups:**" +msgid "**Install dependency groups:**" msgstr "依存グループをインストールする" #: ../../package-structure-code/declare-dependencies.md @@ -6451,12 +6451,12 @@ msgstr "" #~ "the `project` table of your " #~ "`pyproject.toml` file. If they are " #~ "optional, they will be listed in " -#~ "the `[optional.dependencies]` table of your" +#~ "the `[project.optional-dependencies]` table of your" #~ " `pyproject.toml`." #~ msgstr "" #~ "依存関係はオプションか必須であると考えることができます。 必須であれば、 `pyproject` " #~ "テーブルの `dependencies` キーにリストされます。 オプションの場合は、 " -#~ "`pyproject.toml` の `[optional.dependencies]` " +#~ "`pyproject.toml` の `[project.optional-dependencies]` " #~ "テーブルにリストされます。" #~ msgid "You will learn about both below." diff --git a/locales/pt/LC_MESSAGES/package-structure-code.po b/locales/pt/LC_MESSAGES/package-structure-code.po index 8cc8579c..b293a976 100644 --- a/locales/pt/LC_MESSAGES/package-structure-code.po +++ b/locales/pt/LC_MESSAGES/package-structure-code.po @@ -1118,18 +1118,18 @@ msgstr "Por que especificar dependências" #: ../../package-structure-code/declare-dependencies.md:32 msgid "" -"Specifying dependencies in the [project.dependency] array of your " +"Specifying dependencies in the `project.dependencies` array of your " "`pyproject.toml` file ensures that libraries needed to run your package " "are correctly installed into a user's environment. For instance, if your " "package requires Pandas to run properly, and you add Pandas to the " -"`project.dependency` array, Pandas will be installed into the users' " +"`project.dependencies` array, Pandas will be installed into the users' " "environment when they install your package using uv, pip, or conda." msgstr "" -"Especificar dependências no array [project.dependency] do seu arquivo " +"Especificar dependências no array `project.dependencies` do seu arquivo " "`pyproject.toml` garante que as bibliotecas necessárias para executar seu " "pacote sejam instaladas corretamente no ambiente do usuário. Por exemplo, " "se o seu pacote precisa do Pandas para funcionar corretamente, e você " -"adicionar o Pandas ao array `project.dependency`, o Pandas será instalado " +"adicionar o Pandas ao array `project.dependencies`, o Pandas será instalado " "no ambiente dos usuários quando eles instalarem seu pacote usando uv, " "pip ou conda." @@ -1139,14 +1139,14 @@ msgid "" "package. You can set up instructions for running specific workflows, such" " as tests, linting, and even typing, that automatically install groups of" " development dependencies. These dependencies can be stored in arrays " -"(lists of dependencies) within a `[development-group]` table." +"(lists of dependencies) within a `[dependency-groups]` table." msgstr "" "Dependências de desenvolvimento facilitam o trabalho dos contribuidores " "no seu pacote. Você pode configurar instruções para executar workflows " "específicos, como testes, linting e até tipagem, que instalam " "automaticamente grupos de dependências de desenvolvimento. Essas " "dependências podem ser armazenadas em arrays (listas de dependências) " -"dentro de uma tabela `[development-group]`." +"dentro de uma tabela `[dependency-groups]`." #: ../../package-structure-code/declare-dependencies.md:55 msgid "Types of dependencies" @@ -1164,39 +1164,39 @@ msgstr "" msgid "" "**Required dependencies:** These are dependencies that need to be " "installed for your package to work correctly in a user's environment. You" -" add these dependencies to the `[project.dependencies]` table in your " +" add these dependencies to the `project.dependencies` table in your " "pyproject.toml file." msgstr "" "**Dependências obrigatórias:** São dependências que precisam ser " "instaladas para que seu pacote funcione corretamente no ambiente do " "usuário. Você adiciona essas dependências na tabela " -"`[project.dependencies]` do seu arquivo pyproject.toml." +"`project.dependencies` do seu arquivo pyproject.toml." #: ../../package-structure-code/declare-dependencies.md:60 msgid "" "**Feature Dependencies:** These are dependencies that are required if a " "user wants to access additional functionality (that is not core) to your " -"package. Store these in the `[project.optional.dependencies]` table or " +"package. Store these in the `[project.optional-dependencies]` table of " "your pyproject.toml file." msgstr "" "**Dependências de funcionalidades:** São dependências necessárias caso o " "usuário queira acessar funcionalidades adicionais (que não fazem parte do " "núcleo) do seu pacote. Armazene essas dependências na tabela " -"`[project.optional.dependencies]` do seu arquivo pyproject.toml." +"`[project.optional-dependencies]` do seu arquivo pyproject.toml." #: ../../package-structure-code/declare-dependencies.md:61 msgid "" "**Development Dependencies:** These dependencies are required if someone " "wants to develop or work on your package. These include instance linters," " testing tools like pytest and mypy are examples of development " -"dependencies. Store these in the `[project.dependency.groups]` table or " +"dependencies. Store these in the `[dependency-groups]` table of " "your pyproject.toml file." msgstr "" "**Dependências de desenvolvimento:** Essas dependências são necessárias " "caso alguém queira desenvolver ou trabalhar no seu pacote. Isso inclui, " "por exemplo, linters e ferramentas de teste como pytest e mypy. " "Armazene essas dependências na tabela " -"`[project.dependency.groups]` do seu arquivo pyproject.toml." +"`[dependency-groups]` do seu arquivo pyproject.toml." #: ../../package-structure-code/declare-dependencies.md:64 msgid "" @@ -1259,9 +1259,9 @@ msgid "**Add a required dependency:**" msgstr "**Adicionar uma dependência obrigatória:**" #: ../../package-structure-code/declare-dependencies.md:110 -msgid "Will add numpy as a dependency to your `project.dependency` array:" +msgid "Will add numpy as a dependency to your `project.dependencies` array:" msgstr "Irá adicionar numpy como dependência ao seu array " -"`project.dependency`:" +"`project.dependencies`:" #: ../../package-structure-code/declare-dependencies.md:121 msgid "Requiring packages from GitHub / Gitlab" @@ -1298,7 +1298,7 @@ msgid "" "users as needed. Optional dependencies add specific features to your " "package that not all users need. For example, if your package has an " "optional interactive plotting feature that uses Bokeh, you would list " -"Bokeh as an `[optional.dependency]`. Users who want interactive plotting " +"Bokeh under `[project.optional-dependencies]`. Users who want interactive plotting " "will install it. Users who don't need plotting don't have to install it." msgstr "" "Dependências opcionais (também chamadas de dependências de feature) podem " @@ -1306,7 +1306,7 @@ msgstr "" "adicionam funcionalidades específicas ao seu pacote que nem todos os " "usuários precisam. Por exemplo, se seu pacote tiver uma funcionalidade " "opcional de gráficos interativos usando Bokeh, você listaria o Bokeh como " -"um `[optional.dependency]`. Usuários que quiserem gráficos interativos " +"um `[project.optional-dependencies]`. Usuários que quiserem gráficos interativos " "irão instalá-lo. Usuários que não precisarem de gráficos não precisam " "instalá-lo." @@ -1326,8 +1326,8 @@ msgstr "" "opcionais só são instaladas se o usuário solicitá-las explicitamente." #: ../../package-structure-code/declare-dependencies.md -msgid "How to Add optional.dependencies using UV" -msgstr "Como adicionar optional.dependencies usando UV" +msgid "How to add optional dependencies using UV" +msgstr "Como adicionar dependências opcionais usando UV" #: ../../package-structure-code/declare-dependencies.md:164 msgid "**Add an optional dependency:**" @@ -1382,12 +1382,12 @@ msgstr "Novo: grupos de dependências de desenvolvimento PEP 735" #: ../../package-structure-code/declare-dependencies.md:199 msgid "" -"`[development-groups]` is a newer specification introduced by PEP 735. " +"`[dependency-groups]` is a newer specification introduced by PEP 735. " "They are intended to organize development dependencies and are " "intentionally separate from `[project.optional-dependencies]`, which can" " be installed into a user's environment." msgstr "" -"`[development-groups]` é uma especificação mais nova introduzida pela " +"`[dependency-groups]` é uma especificação mais nova introduzida pela " "PEP 735. Ela foi criada para organizar dependências de desenvolvimento e " "é intencionalmente separada de `[project.optional-dependencies]`, que " "podem ser instaladas no ambiente do usuário." @@ -1399,10 +1399,10 @@ msgstr "Como declarar grupos de dependências" #: ../../package-structure-code/declare-dependencies.md:206 msgid "" "You declare development dependencies in your **pyproject.toml** file " -"within a `[development-groups]` table." +"within a `[dependency-groups]` table." msgstr "" "Você declara dependências de desenvolvimento no seu arquivo " -"**pyproject.toml** dentro de uma tabela `[development-groups]`." +"**pyproject.toml** dentro de uma tabela `[dependency-groups]`." #: ../../package-structure-code/declare-dependencies.md:209 msgid "" @@ -1414,11 +1414,11 @@ msgstr "" "`group-name = [\"dep1\", \"dep2\"]`" #: ../../package-structure-code/declare-dependencies.md -msgid "How to Add [development.group] using UV" -msgstr "Como adicionar [development.group] usando UV" +msgid "How to Add [dependency-groups] using UV" +msgstr "Como adicionar [dependency-groups] usando UV" #: ../../package-structure-code/declare-dependencies.md:225 -msgid "**Add a development group dependency:**" +msgid "**Add a development dependency group:**" msgstr "**Adicionar uma dependência de grupo de desenvolvimento:**" #: ../../package-structure-code/declare-dependencies.md:232 @@ -1600,7 +1600,7 @@ msgstr "" "opcionais de feature com UV??" #: ../../package-structure-code/declare-dependencies.md:299 -msgid "**Install development groups:**" +msgid "**Install dependency groups:**" msgstr "**Instalar grupos de desenvolvimento:**" #: ../../package-structure-code/declare-dependencies.md diff --git a/package-structure-code/declare-dependencies.md b/package-structure-code/declare-dependencies.md index 56519a44..218c4f61 100644 --- a/package-structure-code/declare-dependencies.md +++ b/package-structure-code/declare-dependencies.md @@ -29,8 +29,8 @@ While `pyproject.toml` is now the standard, you may sometimes encounter older ap ### Why specify dependencies -Specifying dependencies in the [project.dependency] array of your `pyproject.toml` file ensures that libraries needed to run your package are correctly installed into a user's environment. -For instance, if your package requires Pandas to run properly, and you add Pandas to the `project.dependency` array, Pandas will be installed into the users' environment when they install your package using uv, pip, or conda. +Specifying dependencies in the `project.dependencies` array of your `pyproject.toml` file ensures that libraries needed to run your package are correctly installed into a user's environment. +For instance, if your package requires Pandas to run properly, and you add Pandas to the `project.dependencies` array, Pandas will be installed into the users' environment when they install your package using uv, pip, or conda. ```toml [project] @@ -42,10 +42,10 @@ dependencies = [ ] ``` -Development dependencies make it easier for contributors to work on your package. You can set up instructions for running specific workflows, such as tests, linting, and even typing, that automatically install groups of development dependencies. These dependencies can be stored in arrays (lists of dependencies) within a `[development-group]` table. +Development dependencies make it easier for contributors to work on your package. You can set up instructions for running specific workflows, such as tests, linting, and even typing, that automatically install groups of development dependencies. These dependencies can be stored in arrays (lists of dependencies) within a `[dependency-groups]` table. ```toml -[development-group] +[dependency-groups] tests = [ "pytest", "pytest-cov" @@ -56,9 +56,9 @@ tests = [ There are three different types of dependencies that you will learn about on this page: -1. **Required dependencies:** These are dependencies that need to be installed for your package to work correctly in a user's environment. You add these dependencies to the `[project.dependencies]` table in your pyproject.toml file. -2. **Feature Dependencies:** These are dependencies that are required if a user wants to access additional functionality (that is not core) to your package. Store these in the `[project.optional.dependencies]` table or your pyproject.toml file. -3. **Development Dependencies:** These dependencies are required if someone wants to develop or work on your package. These include instance linters, testing tools like pytest and mypy are examples of development dependencies. Store these in the `[project.dependency.groups]` table or your pyproject.toml file. +1. **Required dependencies:** These are dependencies that need to be installed for your package to work correctly in a user's environment. You add these dependencies to the `project.dependencies` table in your pyproject.toml file. +2. **Feature Dependencies:** These are dependencies that are required if a user wants to access additional functionality (that is not core) to your package. Store these in the `[project.optional-dependencies]` table or your pyproject.toml file. +3. **Development Dependencies:** These dependencies are required if someone wants to develop or work on your package. These include instance linters, testing tools like pytest and mypy are examples of development dependencies. Store these in the `[dependency-groups]` table of your pyproject.toml file. :::{tip} A dependency is not part of your project's codebase. It is a package or software called @@ -106,7 +106,7 @@ You can use uv to add dependencies to your pyproject.toml file: uv add numpy ``` -Will add numpy as a dependency to your `project.dependency` array: +Will add numpy as a dependency to your `project.dependencies` array: ```toml [project] @@ -139,7 +139,7 @@ are more reliable as they can't be changed (optional-dependencies)= ## 2. Optional dependencies -Optional (also referred to as feature) dependencies can be installed by users as needed. Optional dependencies add specific features to your package that not all users need. For example, if your package has an optional interactive plotting feature that uses Bokeh, you would list Bokeh as an `[optional.dependency]`. Users who want interactive plotting will install it. Users who don't need plotting don't have to install it. +Optional (also referred to as feature) dependencies can be installed by users as needed. Optional dependencies add specific features to your package that not all users need. For example, if your package has an optional interactive plotting feature that uses Bokeh, you would list Bokeh under `[project.optional-dependencies]`. Users who want interactive plotting will install it. Users who don't need plotting don't have to install it. Place these dependencies in the `[project.optional-dependencies]` table. @@ -148,13 +148,13 @@ Place these dependencies in the `[project.optional-dependencies]` table. ... ... ... -[optional.dependencies] +[project.optional-dependencies] plot = ["bokeh"] ``` When a user installs your package, uv, pip, or conda automatically installs all required dependencies. Optional dependencies are only installed if the user explicitly requests them. -:::{dropdown} How to Add optional.dependencies using UV +:::{dropdown} How to Add optional dependencies using UV :icon: eye :color: primary @@ -169,7 +169,7 @@ uv add --optional feature pandas Will add this to your pyproject.toml file: ```toml -[optional.dependencies] +[project.optional-dependencies] feature = [ "pandas>=2.3.3", ] @@ -193,35 +193,34 @@ to install and use your package. However, they will make it easier for contributors to your project to setup development environments locally. -:::{admonition} New: PEP 735 development dependency groups +:::{admonition} New: PEP 735 dependency groups :class: note -`[development-groups]` is a newer specification introduced by PEP 735. -They are intended to organize development dependencies and are intentionally separate from `[project.optional-dependencies]`, which can be installed into a user's -environment. +`[dependency-groups]` is a newer specification introduced by PEP 735. +They are intended to organize development dependencies and are intentionally separate from `[project.optional-dependencies]`, which can be installed into a user's environment. ::: ### How to declare dependency groups You declare development dependencies in your **pyproject.toml** file -within a `[development-groups]` table. +within a `[dependency-groups]` table. Similar to optional-dependencies, you can create separate subgroups or arrays with names using the syntax: `group-name = ["dep1", "dep2"]` ```toml -[development-groups] +[dependency-groups] tests = ["pytest", "pytest-cov"] docs = ["sphinx", "pydata-sphinx-theme"] lint = ["ruff", "black"] ``` -:::{dropdown} How to Add [development.group] using UV +:::{dropdown} How to Add [dependency-groups] using UV :icon: eye :color: primary You can use uv to add dependencies to your pyproject.toml file: -**Add a development group dependency:** +**Add a development dependency group:** ```bash uv add --group tests pytest @@ -296,7 +295,7 @@ You can also use pip and install dependencies into the environment of your choic We shouldn't show UV pip install, so how do you add optional feature deps with UV?? ::: -**Install development groups:** +**Install dependency groups:** :::::{tab-set} @@ -306,7 +305,7 @@ You can use uv sync to sync dependency groups in your uv-managed venv ```console uv sync --group docs # Single group uv sync --group docs --group test # Multiple groups -uv sync --all-groups # All development groups +uv sync --all-groups # All dependency groups ``` **Install optional dependencies:**