docs: import Command and Application from where they live - #539
Open
melbinjp wants to merge 2 commits into
Open
Conversation
`src/cleo/__init__.py` defines only `__version__`, so every documented example fails
on its first line:
>>> from cleo import Command
ImportError: cannot import name 'Command' from 'cleo'
Six occurrences across three documents, including the first code block in the
introduction - the one a new user copies before anything else.
Corrected to the paths the project's own tests use:
from cleo.commands.command import Command
from cleo.application import Application
Both verified to import against this tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
src/cleo/__init__.pydefines only__version__and exports nothing, so every documented example fails on its first line:That includes the first code block in the introduction, the one a new user copies before anything else works.
Six occurrences, three documents
docs/introduction.rstfrom cleo import Commanddocs/introduction.rstfrom cleo import Applicationdocs/single_command_tool.rstfrom cleo import Applicationdocs/usage.rstfrom cleo import ApplicationCorrected to the paths the project's own tests use
Both were executed against this tree before pushing: the old import raises, the new ones resolve.
Found with docproof, which checks documentation claims against the code. It flagged
cleo.Commandas not defined, imported, or re-exported anywhere incleo; the other five turned up when I went looking for the same shape.