Skip to content
Merged
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
16 changes: 8 additions & 8 deletions config/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ ignore = [
"TRY003", # Avoid specifying long messages outside the exception class
]

logger-objects = ["griffelib.logger"]
logger-objects = ["griffe.logger", "griffelib.logger"]

[lint.per-file-ignores]
"packages/griffe/src/griffe/__main__.py" = [
"packages/griffecli/src/griffecli/__main__.py" = [
"D100", # Missing module docstring
]
"packages/griffe/src/griffe/_internal/cli.py" = [
"packages/griffecli/src/griffecli/_internal/cli.py" = [
"T201", # Print statement
]
"packages/griffe/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
]
"packages/griffe/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`
]
"packages/griffe/src/griffe/_internal/debug.py" = [
"packages/griffelib/src/griffelib/_internal/debug.py" = [
"T201", # Print statement
]
"packages/griffe/src/griffe/_internal/**.py" = [
"packages/griffelib/src/griffelib/_internal/**.py" = [
"D100", # Missing docstring in public module
]
"scripts/*.py" = [
Expand Down Expand Up @@ -84,7 +84,7 @@ docstring-quotes = "double"
ban-relative-imports = "all"

[lint.isort]
known-first-party = ["griffe"]
known-first-party = ["griffe", "griffelib", "griffecli"]

[lint.pydocstyle]
convention = "google"
Expand Down
9 changes: 9 additions & 0 deletions packages/griffecli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ classifiers = [
"Typing :: Typed",
]

[project.scripts]
griffecli = "griffecli:main"

[tool.hatch.metadata.hooks.uv-dynamic-versioning]
# Dependencies are dynamically versioned; {{version}} is substituted at build time.
dependencies = ["griffelib=={{version}}", "colorama>=0.4"]

[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
# No optional dependencies for the CLI package

[tool.hatch.build.targets.sdist]

[tool.hatch.build.targets.wheel]
sources = ["src/"]
28 changes: 27 additions & 1 deletion packages/griffecli/src/griffecli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
# TODO: Cut proper imports from griffelib `__init__.py` module
# This top-level module imports all public names from the CLI package,
# and exposes them as public objects.

"""Griffe CLI package.

The CLI (Command Line Interface) for the griffe library.
This package provides command-line tools for interacting with griffe.

## CLI entrypoints

- [`griffecli.main`][]: Run the main program.
- [`griffecli.check`][]: Check for API breaking changes in two versions of the same package.
- [`griffecli.dump`][]: Load packages data and dump it as JSON.
- [`griffecli.get_parser`][]: Get the argument parser for the CLI.
"""

from __future__ import annotations

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

__all__ = [
"DEFAULT_LOG_LEVEL",
"check",
"dump",
"get_parser",
"main",
]
2 changes: 1 addition & 1 deletion packages/griffecli/src/griffecli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Entry-point module, in case you use `python -m griffelib`.
# Entry-point module, in case you use `python -m griffecli`.
#
# Why does this file exist, and why `__main__`? For more info, read:
#
Expand Down
1 change: 1 addition & 0 deletions packages/griffecli/src/griffecli/_internal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Internal modules for the griffecli package.
6 changes: 3 additions & 3 deletions packages/griffecli/src/griffecli/_internal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# We might be tempted to import things from `__main__` later,
# but that will cause problems; the code will get executed twice:
#
# - When we run `python -m griffelib`, Python will execute
# - When we run `python -m griffecli`, Python will execute
# `__main__.py` as a script. That means there won't be any
# `griffelib.__main__` in `sys.modules`.
# `griffecli.__main__` in `sys.modules`.
# - When you import `__main__` it will get executed again (as a module) because
# there's no `griffelib.__main__` in `sys.modules`.
# there's no `griffecli.__main__` in `sys.modules`.

from __future__ import annotations

Expand Down
7 changes: 7 additions & 0 deletions packages/griffelib/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ classifiers = [
]

[tool.hatch.metadata.hooks.uv-dynamic-versioning]
# No base dependencies needed for griffelib

[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
# The 'pypi' extra provides dependencies needed for the load_pypi functionality
# to download and inspect packages from PyPI.
pypi = ["pip>=24.0", "platformdirs>=4.2", "wheel>=0.42"]

[tool.hatch.build.targets.sdist]

[tool.hatch.build.targets.wheel]
sources = ["src/"]
Loading