Skip to content

Commit

Permalink
docs: set up docs
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Oct 29, 2024
1 parent 09ff37d commit 8129254
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions nox/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from dependency_groups import resolve

if TYPE_CHECKING:
from typing import Any, TypeVar

T = TypeVar("T")
from typing import Any

if sys.version_info < (3, 11):
import tomli as tomllib
Expand Down Expand Up @@ -134,5 +132,17 @@ def python_versions(


def dependency_groups(pyproject: dict[str, Any], *groups: str) -> list[str]:
"""
Get a list of dependencies from a ``[dependency-groups]`` section(s).
Example:
.. code-block:: python
@nox.session
def test(session):
pyproject = nox.project.load_toml("pyproject.toml")
session.install(*nox.project.dependency_groups(pyproject, "dev"))
"""
dep_groups = pyproject["dependency-groups"]
return [item for g in groups for item in resolve(dep_groups, g)]

0 comments on commit 8129254

Please sign in to comment.