Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/coverage.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
branch = true
parallel = true
source =
src/griffe
packages/*
tests/

[coverage:paths]
Expand Down
12 changes: 6 additions & 6 deletions config/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@ ignore = [
logger-objects = ["griffe.logger"]

[lint.per-file-ignores]
"src/griffe/__main__.py" = [
"packages/griffelib/src/griffelib/__main__.py" = [
"D100", # Missing module docstring
]
"src/griffe/_internal/cli.py" = [
"packages/griffe-cli/src/griffe_cli/_internal/cli.py" = [
"T201", # Print statement
]
"src/griffe/_internal/git.py" = [
"packages/griffelib/src/griffelib/_internal/git.py" = [
"S603", # `subprocess` call: check for execution of untrusted input
"S607", # Starting a process with a partial executable path
]
"src/griffe/_internal/agents/nodes/*.py" = [
"packages/griffelib/src/griffelib/_internal/agents/nodes/*.py" = [
"ARG001", # Unused function argument
"N812", # Lowercase `keyword` imported as non-lowercase `NodeKeyword`
]
"src/griffe/_internal/debug.py" = [
"packages/griffelib/src/griffelib/_internal/debug.py" = [
"T201", # Print statement
]
"src/griffe/_internal/**.py" = [
"packages/griffelib/src/griffelib/_internal/**.py" = [
"D100", # Missing docstring in public module
]
"scripts/*.py" = [
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/contributors/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ descriptions = {
"site": "Documentation site, built with `make run mkdocs build` (git-ignored).",
"src": "The source of our Python package(s). See [Sources](#sources) and [Program structure](#program-structure).",
"src/griffe": "Our public API, exposed to users. See [Program structure](#program-structure).",
"src/griffe/_internal": "Our internal API, hidden from users. See [Program structure](#program-structure).",
"packages/griffelib/src/griffelib/_internal": "Our internal API, hidden from users. See [Program structure](#program-structure).",
"tests": "Our test suite. See [Tests](#tests).",
".copier-answers.yml": "The answers file generated by [Copier](https://copier.readthedocs.io/en/stable/). See [Boilerplate](#boilerplate).",
"devdeps.txt": "Our development dependencies specification. See [`make setup`][command-setup] command.",
Expand Down Expand Up @@ -108,7 +108,7 @@ The test suite is based on [pytest](https://docs.pytest.org/en/8.2.x/). Test mod

## Program structure

The internal API is contained within the `src/griffe/_internal` folder. The top-level `griffe/__init__.py` module exposes all the public API, by importing the internal objects from various submodules of `griffe._internal`.
The internal API is contained within the `packages/griffe/src/griffe/_internal` folder. The top-level `griffe/__init__.py` module exposes all the public API, by importing the internal objects from various submodules of `griffe._internal`.

Users then import `griffe` directly, or import objects from it.

Expand All @@ -122,7 +122,7 @@ if os.getenv("DEPLOY") == "true":
from pydeps.target import Target

cli.verbose = cli._not_verbose
options = cli.parse_args(["src/griffe", "--noshow", "--reverse"])
options = cli.parse_args(["packages/griffe/src/griffe", "--noshow", "--reverse"])
colors.START_COLOR = 128
target = Target(options["fname"])
with target.chdir_work():
Expand Down
10 changes: 5 additions & 5 deletions docs/guide/users/checking.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,11 @@ When running `griffe check` in CI, you can enable GitHub's annotations thanks to

```console
% python -m griffe check -fgithub -ssrc griffe
::warning file=src/griffe/finder.py,line=58,title=Package.name::Attribute value was changed: `name` -> unset
::warning file=src/griffe/finder.py,line=60,title=Package.path::Attribute value was changed: `path` -> unset
::warning file=src/griffe/finder.py,line=62,title=Package.stubs::Attribute value was changed: `stubs` -> `None`
::warning file=src/griffe/finder.py,line=75,title=NamespacePackage.name::Attribute value was changed: `name` -> unset
::warning file=src/griffe/finder.py,line=77,title=NamespacePackage.path::Attribute value was changed: `path` -> unset
::warning file=packages/griffe/src/griffe/finder.py,line=58,title=Package.name::Attribute value was changed: `name` -> unset
::warning file=packages/griffe/src/griffe/finder.py,line=60,title=Package.path::Attribute value was changed: `path` -> unset
::warning file=packages/griffe/src/griffe/finder.py,line=62,title=Package.stubs::Attribute value was changed: `stubs` -> `None`
::warning file=packages/griffe/src/griffe/finder.py,line=75,title=NamespacePackage.name::Attribute value was changed: `name` -> unset
::warning file=packages/griffe/src/griffe/finder.py,line=77,title=NamespacePackage.path::Attribute value was changed: `path` -> unset
```

## Next steps
Expand Down
15 changes: 15 additions & 0 deletions packages/griffe-cli/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2021, Timothée Mazzucotelli

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
69 changes: 69 additions & 0 deletions packages/griffe-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[build-system]
# pdm-backend is left here as a dependency of the version discovery script currently in use.
# It may be removed in the future. See mkdocstrings/griffe#430
requires = ["hatchling", "pdm-backend", "uv-dynamic-versioning>=0.7.0"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "code"
path = "../../scripts/get_version.py"
expression = "get_version()"

[project]
name = "griffe-cli"
description = "CLI for the Griffe tool. Install `griffe` instead."
authors = [{name = "Timothée Mazzucotelli", email = "dev@pawamoy.fr"}]
license = "ISC"
license-files = ["LICENSE"]
requires-python = ">=3.10"
dynamic = ["version", "dependencies", "optional-dependencies"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
# YORE: EOL 3.10: Remove line.
"Programming Language :: Python :: 3.10",
# YORE: EOL 3.11: Remove line.
"Programming Language :: Python :: 3.11",
# YORE: EOL 3.12: Remove line.
"Programming Language :: Python :: 3.12",
# YORE: EOL 3.13: Remove line.
"Programming Language :: Python :: 3.13",
# YORE: EOL 3.14: Remove line.
"Programming Language :: Python :: 3.14",
"Topic :: Documentation",
"Topic :: Software Development",
"Topic :: Software Development :: Documentation",
"Topic :: Utilities",
"Typing :: Typed",
]

[tool.hatch.metadata.hooks.uv-dynamic-versioning]
dependencies = [
"colorama>=0.4",
"griffelib=={{ version }}",
]

[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
pypi = [
"pip>=24.0",
"platformdirs>=4.2",
"wheel>=0.42",
]

[tool.hatch.build.targets.sdist]
include = [
"src",
"share",
"*.md",
"LICENSE",
]

[tool.hatch.build.targets.wheel]
# Manual pages can be included in the wheel.
# Depending on the installation tool, they will be accessible to users.
# pipx supports it, uv does not yet, see https://github.com/astral-sh/uv/issues/4731.
sources = ["src/"]
artifacts = ["share/**/*"]
11 changes: 11 additions & 0 deletions packages/griffe-cli/src/griffe_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Griffe CLI-only package."""

from griffe_cli._internal.cli import DEFAULT_LOG_LEVEL, check, dump, get_parser, main

__all__ = [
"DEFAULT_LOG_LEVEL",
"check",
"dump",
"get_parser",
"main",
]
13 changes: 13 additions & 0 deletions packages/griffe-cli/src/griffe_cli/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Entry-point module, in case you use `python -m griffe`.
#
# Why does this file exist, and why `__main__`? For more info, read:
#
# - https://www.python.org/dev/peps/pep-0338/
# - https://docs.python.org/3/using/cmdline.html#cmdoption-m

import sys

from griffe_cli._internal.cli import main

if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@

import colorama

from griffe._internal import debug
from griffe._internal.diff import find_breaking_changes
from griffe._internal.encoders import JSONEncoder
from griffe._internal.enumerations import ExplanationStyle, Parser
from griffe._internal.exceptions import ExtensionError, GitError
from griffe._internal.extensions.base import load_extensions
from griffe._internal.git import _get_latest_tag, _get_repo_root
from griffe._internal.loader import GriffeLoader, load, load_git, load_pypi
from griffe._internal.logger import logger
from griffelib._internal import debug
from griffelib._internal.diff import find_breaking_changes
from griffelib._internal.encoders import JSONEncoder
from griffelib._internal.enumerations import ExplanationStyle, Parser
from griffelib._internal.exceptions import ExtensionError, GitError
from griffelib._internal.extensions.base import load_extensions
from griffelib._internal.git import _get_latest_tag, _get_repo_root
from griffelib._internal.loader import GriffeLoader, load, load_git, load_pypi
from griffelib._internal.logger import logger

if TYPE_CHECKING:
from collections.abc import Sequence

from griffe._internal.docstrings.parsers import DocstringOptions, DocstringStyle
from griffe._internal.extensions.base import Extension, Extensions
from griffelib._internal.docstrings.parsers import DocstringOptions, DocstringStyle
from griffelib._internal.extensions.base import Extension, Extensions


DEFAULT_LOG_LEVEL = os.getenv("GRIFFE_LOG_LEVEL", "INFO").upper()
Expand Down
Empty file.
15 changes: 15 additions & 0 deletions packages/griffelib/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2021, Timothée Mazzucotelli

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
44 changes: 44 additions & 0 deletions packages/griffelib/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[build-system]
# pdm-backend is left here as a dependency of the version discovery script currently in use.
# It may be removed in the future. See mkdocstrings/griffe#430
requires = ["hatchling", "pdm-backend", "uv-dynamic-versioning>=0.7.0"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "code"
path = "../../scripts/get_version.py"
expression = "get_version()"

[project]
name = "griffelib"
description = "Library for the Griffe tool. Install `griffe` instead."
authors = [{ name = "Timothée Mazzucotelli", email = "dev@pawamoy.fr" }]
license = "ISC"
license-files = ["LICENSE"]
requires-python = ">=3.10"
dynamic = ["version", "dependencies"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
# YORE: EOL 3.10: Remove line.
"Programming Language :: Python :: 3.10",
# YORE: EOL 3.11: Remove line.
"Programming Language :: Python :: 3.11",
# YORE: EOL 3.12: Remove line.
"Programming Language :: Python :: 3.12",
# YORE: EOL 3.13: Remove line.
"Programming Language :: Python :: 3.13",
# YORE: EOL 3.14: Remove line.
"Programming Language :: Python :: 3.14",
"Topic :: Documentation",
"Topic :: Software Development",
"Topic :: Software Development :: Documentation",
"Topic :: Utilities",
"Typing :: Typed",
]

[tool.hatch.metadata.hooks.uv-dynamic-versioning]
dependencies = []
Loading
Loading