Skip to content

__version__ is exported from the Python package but is absent from the README's API list #9

Description

@dmccoystephenson

__version__ is exported from the package but is absent from the README's API list.

python/src/github_docs/__init__.py:30 defines __version__ = "0.1.0", and line 27 lists "__version__" in __all__, so from github_docs import __version__ is a supported import and from github_docs import * brings it in.

The API section of python/README.md:120-132 enumerates the public surface — GitHubDocsConfig, GitHubDocsClient and its methods, Document, DocumentSummary, SaveResult, GitHubDocsError, slugify_path — and that list is otherwise an exact match for __all__. __version__ is the one entry in __all__ that the list does not carry.

The gap is small, and the argument for leaving it alone is real: __version__ is a convention rather than API in the sense the rest of that list means. It is recorded because the two lists are otherwise symbol-for-symbol identical, which is a property worth either keeping or deliberately abandoning rather than losing by accident. The npm half's README has no equivalent entry to compare against, since the TypeScript package exposes no version constant.

Two ways this could be settled:

  • Add a line to the README's API list, keeping the two lists in exact correspondence.
  • Drop "__version__" from __all__, leaving the attribute importable by name but out of the starred import, and leave the README as it is.

Either resolves it; the first is the smaller change and the second is the more opinionated one.

This was noticed during a documentation-accuracy sweep run as part of a development cycle, and was deliberately kept out of the test-only PR that cycle produced (#8).


This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions