Skip to content

Commit 87ce03f

Browse files
johnslavikpawamoy
andauthored
Apply suggestions from code review
Thanks! Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
1 parent ce2c62e commit 87ce03f

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/guide/contributors/architecture.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ The test suite is based on [pytest](https://docs.pytest.org/en/8.2.x/). Test mod
112112
Griffe is split into two pieces: the library and the CLI.
113113

114114
Each of them has an internal API contained within an `_internal` folder:
115+
115116
- `packages/griffelib/src/griffe/_internal` for the library,
116117
- `packages/griffecli/src/griffecli/_internal` for the CLI.
117118

docs/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Griffe is a Python package, so you can install it with your favorite Python pack
6161

6262
## Install as a library only
6363

64-
If you only need the library for API introspection and analysis without the CLI tool, you can install just `griffelib`:
64+
If you only need the library for API introspection and analysis without the CLI tool, you can install `griffelib`:
6565

6666
=== ":simple-python: pip"
6767
```bash
@@ -118,7 +118,7 @@ If you only need the library for API introspection and analysis without the CLI
118118

119119
</div>
120120

121-
This installs the `griffe` package as usual, but without the CLI program, nor its API, nor its dependencies.
121+
This installs the `griffe` package as usual, but without the CLI program and its dependencies.
122122

123123
## Install as a tool only
124124

packages/griffelib/src/griffe/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
Extract the structure, the frame, the skeleton of your project,
99
to generate API documentation or find breaking changes in your API.
1010
11-
The entirety of the library API is exposed here, in the top-level `griffelib` module.
12-
For backward compatibility, you can also import from `griffe` which re-exports everything.
11+
The entirety of the library API is exposed here, in the top-level `griffe` module.
1312
1413
All messages written to standard output or error are logged using the `logging` module.
1514
Our logger's name is set to `"griffe"` and is public (you can rely on it).
@@ -613,5 +612,5 @@ def __getattr__(attr: str) -> object:
613612
raise AttributeError(attr)
614613
else:
615614
__all__ += __cli_all__ # noqa: PLE0605
616-
# Ignore any reexpected API in internal API tests.
615+
# Ignore any re-exported API in internal API tests.
617616
_REEXPORTED_EXTERNAL_API = set(__cli_all__)

packages/griffelib/src/griffe/_internal/finder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def _handle_pth_file(path: Path) -> list[_SP]:
470470
def _handle_editable_module(path: Path) -> list[_SP]:
471471
if _match_pattern(path.name, (*_editable_editables_patterns, *_editable_scikit_build_core_patterns)):
472472
# Support for how 'editables' write these files:
473-
# example line: `F.map_module('griffe', '/media/data/dev/griffelib/packages/griffe/src/griffe/__init__.py')`.
473+
# example line: `F.map_module('pkg', '/data/dev/pkg/src/pkg/__init__.py')`.
474474
# And how 'scikit-build-core' writes these files:
475475
# example line: `install({'griffe': '/media/data/dev/griffelib/packages/griffe/src/griffe/__init__.py'}, {'cmake_example': ...}, None, False, True)`.
476476
try:
@@ -483,7 +483,7 @@ def _handle_editable_module(path: Path) -> list[_SP]:
483483
return [_SP(new_path)]
484484
if _match_pattern(path.name, _editable_setuptools_patterns):
485485
# Support for how 'setuptools' writes these files:
486-
# example line: `MAPPING = {'griffe': '/media/data/dev/griffe/packages/griffelib/src/griffe', 'briffe': '/media/data/dev/griffe/src/briffe'}`.
486+
# example line: `MAPPING = {'pkg': '/data/dev/pkg/src/pkg', 'pkg2': '/data/dev/pkg/src/pkg2'}`.
487487
# with annotation: `MAPPING: dict[str, str] = {...}`.
488488
parsed_module = ast.parse(path.read_text(encoding="utf8"))
489489
for node in parsed_module.body:
@@ -508,7 +508,7 @@ def _handle_editable_module(path: Path) -> list[_SP]:
508508
and node.value.func.id == "install"
509509
and isinstance(node.value.args[1], ast.Constant)
510510
):
511-
build_path = Path(node.value.args[1].value, "packages/griffelib/src") # type: ignore[arg-type]
511+
build_path = Path(node.value.args[1].value, "src") # type: ignore[arg-type]
512512
# NOTE: What if there are multiple packages?
513513
pkg_name = next(build_path.iterdir()).name
514514
return [_SP(build_path, always_scan_for=pkg_name)]

0 commit comments

Comments
 (0)