griffecli 2.0.2__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {griffecli-2.0.2 → griffecli-2.2.0}/CHANGELOG.md +35 -0
- {griffecli-2.0.2 → griffecli-2.2.0}/PKG-INFO +3 -3
- {griffecli-2.0.2 → griffecli-2.2.0}/README.md +2 -4
- griffecli-2.2.0/src/griffecli/__init__.py +43 -0
- griffecli-2.2.0/src/griffecli/__main__.py +29 -0
- griffecli-2.2.0/src/griffecli/_internal/__init__.py +17 -0
- {griffecli-2.0.2 → griffecli-2.2.0}/src/griffecli/_internal/cli.py +16 -0
- griffecli-2.2.0/tests/__init__.py +17 -0
- griffecli-2.2.0/tests/test_cli.py +73 -0
- griffecli-2.0.2/src/griffecli/__init__.py +0 -27
- griffecli-2.0.2/src/griffecli/__main__.py +0 -13
- griffecli-2.0.2/src/griffecli/_internal/__init__.py +0 -1
- {griffecli-2.0.2 → griffecli-2.2.0}/.gitignore +0 -0
- {griffecli-2.0.2 → griffecli-2.2.0}/LICENSE +0 -0
- {griffecli-2.0.2 → griffecli-2.2.0}/pyproject.toml +0 -0
- {griffecli-2.0.2 → griffecli-2.2.0}/src/griffecli/py.typed +0 -0
|
@@ -5,6 +5,41 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
7
|
<!-- insertion marker -->
|
|
8
|
+
## [2.2.0](https://github.com/mkdocstrings/griffe/releases/tag/2.2.0) - 2026-08-16
|
|
9
|
+
|
|
10
|
+
<small>[Compare with 2.1.0](https://github.com/mkdocstrings/griffe/compare/2.1.0...2.2.0)</small>
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- Support `await` expressions ([6b3caab](https://github.com/mkdocstrings/griffe/commit/6b3caab7ce4fdcb1c9386937dad17510d35a3321) by Vincent Gao). [PR-479](https://github.com/mkdocstrings/griffe/pull/479)
|
|
15
|
+
- Support unpacking in dict comprehensions ([2d39391](https://github.com/mkdocstrings/griffe/commit/2d39391cb135febadf339bdea91c1113b74da145) by mushitoriami). [PR-475](https://github.com/mkdocstrings/griffe/pull/475)
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
- Forward `warn_missing_types` to Sphinx return section reader ([a15e782](https://github.com/mkdocstrings/griffe/commit/a15e782ed0793e06d22105beb016c10cfe0ed4b0) by Timothée Mazzucotelli). [Issue-mkdocstrings-python-337](https://github.com/mkdocstrings/python/issues/337)
|
|
20
|
+
- Make stringified expressions valid and faithful Python ([eb85f0d](https://github.com/mkdocstrings/griffe/commit/eb85f0dd8bf49f4a2400bf03face646d8f533a7c) by Vincent Gao). [PR-478](https://github.com/mkdocstrings/griffe/pull/478)
|
|
21
|
+
- Empty tuples can never be implicit ([82e728d](https://github.com/mkdocstrings/griffe/commit/82e728dc758f9635d2e500c13caa795b48e36d8a) by Vincent Gao). [PR-474](https://github.com/mkdocstrings/griffe/pull/474), Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
|
|
22
|
+
- Render f-strings and t-strings with correct quote delimiters ([90e28d4](https://github.com/mkdocstrings/griffe/commit/90e28d45ffc998434895c0f73af608cb12f0d6dd) by Bartosz Sławecki). [Issue-444](https://github.com/mkdocstrings/griffe/issues/444), [PR-455](https://github.com/mkdocstrings/griffe/pull/455)
|
|
23
|
+
- Detect basic admonitions 'example', 'note' and 'warning' in Google/Numpy docstrings when inferring style ([f30306f](https://github.com/mkdocstrings/griffe/commit/f30306fa703741f976fc49576ddf95cf29ba998b) by Timothée Mazzucotelli).
|
|
24
|
+
- Render dict `**`-unpacking as `**value` instead of `None: value` ([74ddbbf](https://github.com/mkdocstrings/griffe/commit/74ddbbf22f49e1fb789ac754e3fff41a0ac2f152) by Vincent Gao). [PR-467](https://github.com/mkdocstrings/griffe/pull/467)
|
|
25
|
+
|
|
26
|
+
## [2.1.0](https://github.com/mkdocstrings/griffe/releases/tag/2.1.0) - 2026-06-19
|
|
27
|
+
|
|
28
|
+
<small>[Compare with 2.0.2](https://github.com/mkdocstrings/griffe/compare/2.0.2...2.1.0)</small>
|
|
29
|
+
|
|
30
|
+
### Build
|
|
31
|
+
|
|
32
|
+
- Add tests to source distributions for `griffecli` and `griffelib` packages. [Issue-452](https://github.com/mkdocstrings/griffe/issues/452)
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
- Add logging format for Azure Devops ([82526e4](https://github.com/mkdocstrings/griffe/commit/82526e487946f838c2521e531ef8716dd12d4eea) by Carsten Igel). [PR-457](https://github.com/mkdocstrings/griffe/pull/457), Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
- Rename tests module to avoid exclusion by packagers ([5b3e392](https://github.com/mkdocstrings/griffe/commit/5b3e392006da98d5f23ba0e808393038be6014d8) by Timothée Mazzucotelli). [Issue-461](https://github.com/mkdocstrings/griffe/issues/461)
|
|
41
|
+
- Don't try merging overload annotations into non-function objects ([1b6b053](https://github.com/mkdocstrings/griffe/commit/1b6b053dc4cfdc4381a9dc4b0676b7946e55951e) by Timothée Mazzucotelli). [Issue-451](https://github.com/mkdocstrings/griffe/discussions/451)
|
|
42
|
+
|
|
8
43
|
## [2.0.2](https://github.com/mkdocstrings/griffe/releases/tag/2.0.2) - 2026-03-27
|
|
9
44
|
|
|
10
45
|
<small>[Compare with 2.0.1](https://github.com/mkdocstrings/griffe/compare/2.0.1...2.0.2)</small>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: griffecli
|
|
3
|
-
Version: 2.0
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.
|
|
5
5
|
Author-email: Timothée Mazzucotelli <dev@pawamoy.fr>
|
|
6
6
|
License-Expression: ISC
|
|
@@ -22,4 +22,4 @@ Classifier: Topic :: Utilities
|
|
|
22
22
|
Classifier: Typing :: Typed
|
|
23
23
|
Requires-Python: >=3.10
|
|
24
24
|
Requires-Dist: colorama>=0.4
|
|
25
|
-
Requires-Dist: griffelib==2.0
|
|
25
|
+
Requires-Dist: griffelib==2.2.0
|
|
@@ -143,7 +143,7 @@ See the [Loading chapter](https://mkdocstrings.github.io/griffe/guide/users/load
|
|
|
143
143
|
<a href="https://github.com/BenHammersley"><img alt="BenHammersley" src="https://avatars.githubusercontent.com/u/99436?u=4499a7b507541045222ee28ae122dbe3c8d08ab5&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
144
144
|
<a href="https://github.com/trevorWieland"><img alt="trevorWieland" src="https://avatars.githubusercontent.com/u/28811461?u=74cc0e3756c1d4e3d66b5c396e1d131ea8a10472&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
145
145
|
<a href="https://github.com/MarcoGorelli"><img alt="MarcoGorelli" src="https://avatars.githubusercontent.com/u/33491632?u=7de3a749cac76a60baca9777baf71d043a4f884d&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
146
|
-
<a href="https://github.com/analog-cbarber"><img alt="analog-cbarber" src="https://avatars.githubusercontent.com/u/7408243?u=
|
|
146
|
+
<a href="https://github.com/analog-cbarber"><img alt="analog-cbarber" src="https://avatars.githubusercontent.com/u/7408243?u=fe0e7bf2882d1c9c901a341c2502e1518466527a&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
147
147
|
<a href="https://github.com/OdinManiac"><img alt="OdinManiac" src="https://avatars.githubusercontent.com/u/22727172?u=36ab20970f7f52ae8e7eb67b7fcf491fee01ac22&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
148
148
|
<a href="https://github.com/rstudio-sponsorship"><img alt="rstudio-sponsorship" src="https://avatars.githubusercontent.com/u/58949051?u=0c471515dd18111be30dfb7669ed5e778970959b&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
149
149
|
<a href="https://github.com/schlich"><img alt="schlich" src="https://avatars.githubusercontent.com/u/21191435?u=6f1240adb68f21614d809ae52d66509f46b1e877&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
@@ -155,17 +155,15 @@ See the [Loading chapter](https://mkdocstrings.github.io/griffe/guide/users/load
|
|
|
155
155
|
<a href="https://github.com/activeloopai"><img alt="activeloopai" src="https://avatars.githubusercontent.com/u/34816118?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
156
156
|
<a href="https://github.com/roboflow"><img alt="roboflow" src="https://avatars.githubusercontent.com/u/53104118?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
157
157
|
<a href="https://github.com/cmclaughlin"><img alt="cmclaughlin" src="https://avatars.githubusercontent.com/u/1061109?u=ddf6eec0edd2d11c980f8c3aa96e3d044d4e0468&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
158
|
-
<a href="https://github.com/blaisep"><img alt="blaisep" src="https://avatars.githubusercontent.com/u/254456?u=97d584b7c0a6faf583aa59975df4f993f671d121&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
159
158
|
<a href="https://github.com/RapidataAI"><img alt="RapidataAI" src="https://avatars.githubusercontent.com/u/104209891?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
160
159
|
<a href="https://github.com/rodolphebarbanneau"><img alt="rodolphebarbanneau" src="https://avatars.githubusercontent.com/u/46493454?u=6c405452a40c231cdf0b68e97544e07ee956a733&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
161
160
|
<a href="https://github.com/theSymbolSyndicate"><img alt="theSymbolSyndicate" src="https://avatars.githubusercontent.com/u/111542255?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
162
161
|
<a href="https://github.com/blakeNaccarato"><img alt="blakeNaccarato" src="https://avatars.githubusercontent.com/u/20692450?u=bb919218be30cfa994514f4cf39bb2f7cf952df4&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
163
162
|
<a href="https://github.com/ChargeStorm"><img alt="ChargeStorm" src="https://avatars.githubusercontent.com/u/26000165?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
164
|
-
<a href="https://github.com/Alphadelta14"><img alt="Alphadelta14" src="https://avatars.githubusercontent.com/u/480845?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
165
163
|
<a href="https://github.com/Cusp-AI"><img alt="Cusp-AI" src="https://avatars.githubusercontent.com/u/178170649?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
166
164
|
</p></div>
|
|
167
165
|
|
|
168
166
|
|
|
169
|
-
*And
|
|
167
|
+
*And 4 more private sponsor(s).*
|
|
170
168
|
|
|
171
169
|
<!-- sponsors-end -->
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2021, Timothée Mazzucotelli and contributors
|
|
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.
|
|
16
|
+
|
|
17
|
+
# This top-level module imports all public names from the CLI package,
|
|
18
|
+
# and exposes them as public objects.
|
|
19
|
+
|
|
20
|
+
"""Griffe CLI package.
|
|
21
|
+
|
|
22
|
+
The CLI (Command Line Interface) for the griffe library.
|
|
23
|
+
This package provides command-line tools for interacting with griffe.
|
|
24
|
+
|
|
25
|
+
## CLI entrypoints
|
|
26
|
+
|
|
27
|
+
- [`griffecli.main`][]: Run the main program.
|
|
28
|
+
- [`griffecli.check`][]: Check for API breaking changes in two versions of the same package.
|
|
29
|
+
- [`griffecli.dump`][]: Load packages data and dump it as JSON.
|
|
30
|
+
- [`griffecli.get_parser`][]: Get the argument parser for the CLI.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
from __future__ import annotations
|
|
34
|
+
|
|
35
|
+
from griffecli._internal.cli import DEFAULT_LOG_LEVEL, check, dump, get_parser, main
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"DEFAULT_LOG_LEVEL",
|
|
39
|
+
"check",
|
|
40
|
+
"dump",
|
|
41
|
+
"get_parser",
|
|
42
|
+
"main",
|
|
43
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2021, Timothée Mazzucotelli and contributors
|
|
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.
|
|
16
|
+
|
|
17
|
+
# Entry-point module, in case you use `python -m griffecli`.
|
|
18
|
+
#
|
|
19
|
+
# Why does this file exist, and why `__main__`? For more info, read:
|
|
20
|
+
#
|
|
21
|
+
# - https://www.python.org/dev/peps/pep-0338/
|
|
22
|
+
# - https://docs.python.org/3/using/cmdline.html#cmdoption-m
|
|
23
|
+
|
|
24
|
+
import sys
|
|
25
|
+
|
|
26
|
+
from griffecli._internal.cli import main
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
sys.exit(main(sys.argv[1:]))
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2021, Timothée Mazzucotelli and contributors
|
|
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.
|
|
16
|
+
|
|
17
|
+
# Internal modules for the griffecli package.
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2021, Timothée Mazzucotelli and contributors
|
|
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.
|
|
16
|
+
|
|
1
17
|
# This module contains all CLI-related things.
|
|
2
18
|
# Why does this file exist, and why not put this in `__main__`?
|
|
3
19
|
#
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2021, Timothée Mazzucotelli and contributors
|
|
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.
|
|
16
|
+
|
|
17
|
+
"""Tests suite for `griffecli`."""
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2021, Timothée Mazzucotelli and contributors
|
|
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.
|
|
16
|
+
|
|
17
|
+
"""Tests for the CLI."""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
import sys
|
|
22
|
+
|
|
23
|
+
import pytest
|
|
24
|
+
|
|
25
|
+
from griffe._internal import debug
|
|
26
|
+
from griffecli._internal import cli
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_main() -> None:
|
|
30
|
+
"""Basic CLI test."""
|
|
31
|
+
if sys.platform == "win32":
|
|
32
|
+
assert cli.main(["dump", "griffe", "-s", "src", "-oNUL"]) == 0
|
|
33
|
+
else:
|
|
34
|
+
assert cli.main(["dump", "griffe", "-s", "src", "-o/dev/null"]) == 0
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_show_help(capsys: pytest.CaptureFixture) -> None:
|
|
38
|
+
"""Show help.
|
|
39
|
+
|
|
40
|
+
Parameters:
|
|
41
|
+
capsys: Pytest fixture to capture output.
|
|
42
|
+
"""
|
|
43
|
+
with pytest.raises(SystemExit):
|
|
44
|
+
cli.main(["-h"])
|
|
45
|
+
captured = capsys.readouterr()
|
|
46
|
+
assert "griffe" in captured.out
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_show_version(capsys: pytest.CaptureFixture) -> None:
|
|
50
|
+
"""Show version.
|
|
51
|
+
|
|
52
|
+
Parameters:
|
|
53
|
+
capsys: Pytest fixture to capture output.
|
|
54
|
+
"""
|
|
55
|
+
with pytest.raises(SystemExit):
|
|
56
|
+
cli.main(["-V"])
|
|
57
|
+
captured = capsys.readouterr()
|
|
58
|
+
assert debug._get_version() in captured.out
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_show_debug_info(capsys: pytest.CaptureFixture) -> None:
|
|
62
|
+
"""Show debug information.
|
|
63
|
+
|
|
64
|
+
Parameters:
|
|
65
|
+
capsys: Pytest fixture to capture output.
|
|
66
|
+
"""
|
|
67
|
+
with pytest.raises(SystemExit):
|
|
68
|
+
cli.main(["--debug-info"])
|
|
69
|
+
captured = capsys.readouterr().out.lower()
|
|
70
|
+
assert "python" in captured
|
|
71
|
+
assert "system" in captured
|
|
72
|
+
assert "environment" in captured
|
|
73
|
+
assert "packages" in captured
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# This top-level module imports all public names from the CLI package,
|
|
2
|
-
# and exposes them as public objects.
|
|
3
|
-
|
|
4
|
-
"""Griffe CLI package.
|
|
5
|
-
|
|
6
|
-
The CLI (Command Line Interface) for the griffe library.
|
|
7
|
-
This package provides command-line tools for interacting with griffe.
|
|
8
|
-
|
|
9
|
-
## CLI entrypoints
|
|
10
|
-
|
|
11
|
-
- [`griffecli.main`][]: Run the main program.
|
|
12
|
-
- [`griffecli.check`][]: Check for API breaking changes in two versions of the same package.
|
|
13
|
-
- [`griffecli.dump`][]: Load packages data and dump it as JSON.
|
|
14
|
-
- [`griffecli.get_parser`][]: Get the argument parser for the CLI.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
from __future__ import annotations
|
|
18
|
-
|
|
19
|
-
from griffecli._internal.cli import DEFAULT_LOG_LEVEL, check, dump, get_parser, main
|
|
20
|
-
|
|
21
|
-
__all__ = [
|
|
22
|
-
"DEFAULT_LOG_LEVEL",
|
|
23
|
-
"check",
|
|
24
|
-
"dump",
|
|
25
|
-
"get_parser",
|
|
26
|
-
"main",
|
|
27
|
-
]
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Entry-point module, in case you use `python -m griffecli`.
|
|
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 griffecli._internal.cli import main
|
|
11
|
-
|
|
12
|
-
if __name__ == "__main__":
|
|
13
|
-
sys.exit(main(sys.argv[1:]))
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Internal modules for the griffecli package.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|