Skip to content

Commit 1bce188

Browse files
committed
WIP: It installs!
1 parent 09b0682 commit 1bce188

91 files changed

Lines changed: 1401 additions & 1229 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/coverage.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
branch = true
33
parallel = true
44
source =
5-
src/griffe
5+
packages/*
66
tests/
77

88
[coverage:paths]

config/ruff.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@ ignore = [
3838
logger-objects = ["griffe.logger"]
3939

4040
[lint.per-file-ignores]
41-
"src/griffe/__main__.py" = [
41+
"packages/griffe/src/griffe/__main__.py" = [
4242
"D100", # Missing module docstring
4343
]
44-
"src/griffe/_internal/cli.py" = [
44+
"packages/griffe/src/griffe/_internal/cli.py" = [
4545
"T201", # Print statement
4646
]
47-
"src/griffe/_internal/git.py" = [
47+
"packages/griffe/src/griffe/_internal/git.py" = [
4848
"S603", # `subprocess` call: check for execution of untrusted input
4949
"S607", # Starting a process with a partial executable path
5050
]
51-
"src/griffe/_internal/agents/nodes/*.py" = [
51+
"packages/griffe/src/griffe/_internal/agents/nodes/*.py" = [
5252
"ARG001", # Unused function argument
5353
"N812", # Lowercase `keyword` imported as non-lowercase `NodeKeyword`
5454
]
55-
"src/griffe/_internal/debug.py" = [
55+
"packages/griffe/src/griffe/_internal/debug.py" = [
5656
"T201", # Print statement
5757
]
58-
"src/griffe/_internal/**.py" = [
58+
"packages/griffe/src/griffe/_internal/**.py" = [
5959
"D100", # Missing docstring in public module
6060
]
6161
"scripts/*.py" = [

docs/guide/contributors/architecture.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ descriptions = {
2222
"scripts": "Our different scripts. See [Scripts, configuration](#scripts-configuration).",
2323
"site": "Documentation site, built with `make run mkdocs build` (git-ignored).",
2424
"src": "The source of our Python package(s). See [Sources](#sources) and [Program structure](#program-structure).",
25-
"src/griffe": "Our public API, exposed to users. See [Program structure](#program-structure).",
26-
"src/griffe/_internal": "Our internal API, hidden from users. See [Program structure](#program-structure).",
25+
"packages/griffe/src/griffe": "Our public API, exposed to users. See [Program structure](#program-structure).",
26+
"packages/griffe/src/griffe/_internal": "Our internal API, hidden from users. See [Program structure](#program-structure).",
2727
"tests": "Our test suite. See [Tests](#tests).",
2828
".copier-answers.yml": "The answers file generated by [Copier](https://copier.readthedocs.io/en/stable/). See [Boilerplate](#boilerplate).",
2929
"devdeps.txt": "Our development dependencies specification. See [`make setup`][command-setup] command.",
@@ -108,7 +108,7 @@ The test suite is based on [pytest](https://docs.pytest.org/en/8.2.x/). Test mod
108108

109109
## Program structure
110110

111-
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`.
111+
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`.
112112

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

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

124124
cli.verbose = cli._not_verbose
125-
options = cli.parse_args(["src/griffe", "--noshow", "--reverse"])
125+
options = cli.parse_args(["packages/griffe/src/griffe", "--noshow", "--reverse"])
126126
colors.START_COLOR = 128
127127
target = Target(options["fname"])
128128
with target.chdir_work():

docs/guide/users/checking.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,11 @@ When running `griffe check` in CI, you can enable GitHub's annotations thanks to
713713

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

723723
## Next steps

packages/griffe-cli/LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ISC License
2+
3+
Copyright (c) 2021, Timothée Mazzucotelli
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

packages/griffe-cli/pyproject.toml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[build-system]
2+
# pdm-backend is left here as a dependency of the version discovery script currently in use.
3+
# It may be removed in the future. See mkdocstrings/griffe#430
4+
requires = ["hatchling", "pdm-backend", "uv-dynamic-versioning>=0.7.0"]
5+
build-backend = "hatchling.build"
6+
7+
[tool.hatch.version]
8+
source = "code"
9+
path = "../../scripts/get_version.py"
10+
expression = "get_version()"
11+
12+
[project]
13+
name = "griffe-cli"
14+
description = "CLI for the Griffe tool. Install `griffe` instead."
15+
authors = [{name = "Timothée Mazzucotelli", email = "dev@pawamoy.fr"}]
16+
license = "ISC"
17+
license-files = ["LICENSE"]
18+
requires-python = ">=3.10"
19+
dynamic = ["version", "dependencies", "optional-dependencies"]
20+
classifiers = [
21+
"Development Status :: 5 - Production/Stable",
22+
"Intended Audience :: Developers",
23+
"Programming Language :: Python",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3 :: Only",
26+
# YORE: EOL 3.10: Remove line.
27+
"Programming Language :: Python :: 3.10",
28+
# YORE: EOL 3.11: Remove line.
29+
"Programming Language :: Python :: 3.11",
30+
# YORE: EOL 3.12: Remove line.
31+
"Programming Language :: Python :: 3.12",
32+
# YORE: EOL 3.13: Remove line.
33+
"Programming Language :: Python :: 3.13",
34+
# YORE: EOL 3.14: Remove line.
35+
"Programming Language :: Python :: 3.14",
36+
"Topic :: Documentation",
37+
"Topic :: Software Development",
38+
"Topic :: Software Development :: Documentation",
39+
"Topic :: Utilities",
40+
"Typing :: Typed",
41+
]
42+
43+
[tool.hatch.metadata.hooks.uv-dynamic-versioning]
44+
dependencies = [
45+
"colorama>=0.4",
46+
"griffelib=={{ version }}",
47+
]
48+
49+
[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
50+
pypi = [
51+
"pip>=24.0",
52+
"platformdirs>=4.2",
53+
"wheel>=0.42",
54+
]
55+
56+
[tool.hatch.build.targets.sdist]
57+
include = [
58+
"src",
59+
"share",
60+
"*.md",
61+
"LICENSE",
62+
]
63+
64+
[tool.hatch.build.targets.wheel]
65+
# Manual pages can be included in the wheel.
66+
# Depending on the installation tool, they will be accessible to users.
67+
# pipx supports it, uv does not yet, see https://github.com/astral-sh/uv/issues/4731.
68+
sources = ["src/"]
69+
artifacts = ["share/**/*"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Griffe CLI-only package."""
2+
3+
from griffe_cli._internal.cli import DEFAULT_LOG_LEVEL, check, dump, get_parser, main
4+
5+
__all__ = [
6+
"DEFAULT_LOG_LEVEL",
7+
"check",
8+
"dump",
9+
"get_parser",
10+
"main",
11+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Entry-point module, in case you use `python -m griffe`.
2+
#
3+
# Why does this file exist, and why `__main__`? For more info, read:
4+
#
5+
# - https://www.python.org/dev/peps/pep-0338/
6+
# - https://docs.python.org/3/using/cmdline.html#cmdoption-m
7+
8+
import sys
9+
10+
from griffe_cli._internal.cli import main
11+
12+
if __name__ == "__main__":
13+
sys.exit(main(sys.argv[1:]))

src/griffe/_internal/cli.py renamed to packages/griffe-cli/src/griffe_cli/_internal/cli.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424

2525
import colorama
2626

27-
from griffe._internal import debug
28-
from griffe._internal.diff import find_breaking_changes
29-
from griffe._internal.encoders import JSONEncoder
30-
from griffe._internal.enumerations import ExplanationStyle, Parser
31-
from griffe._internal.exceptions import ExtensionError, GitError
32-
from griffe._internal.extensions.base import load_extensions
33-
from griffe._internal.git import _get_latest_tag, _get_repo_root
34-
from griffe._internal.loader import GriffeLoader, load, load_git, load_pypi
35-
from griffe._internal.logger import logger
27+
from griffelib._internal import debug
28+
from griffelib._internal.diff import find_breaking_changes
29+
from griffelib._internal.encoders import JSONEncoder
30+
from griffelib._internal.enumerations import ExplanationStyle, Parser
31+
from griffelib._internal.exceptions import ExtensionError, GitError
32+
from griffelib._internal.extensions.base import load_extensions
33+
from griffelib._internal.git import _get_latest_tag, _get_repo_root
34+
from griffelib._internal.loader import GriffeLoader, load, load_git, load_pypi
35+
from griffelib._internal.logger import logger
3636

3737
if TYPE_CHECKING:
3838
from collections.abc import Sequence
3939

40-
from griffe._internal.docstrings.parsers import DocstringOptions, DocstringStyle
41-
from griffe._internal.extensions.base import Extension, Extensions
40+
from griffelib._internal.docstrings.parsers import DocstringOptions, DocstringStyle
41+
from griffelib._internal.extensions.base import Extension, Extensions
4242

4343

4444
DEFAULT_LOG_LEVEL = os.getenv("GRIFFE_LOG_LEVEL", "INFO").upper()

src/griffe/_internal/py.typed renamed to packages/griffe-cli/src/griffe_cli/_internal/py.typed

File renamed without changes.

0 commit comments

Comments
 (0)