FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Export `get_platform` from the public package surface · Issue #44 · pythonnative/pythonnative · GitHub

Export get_platform from the public package surface #44

Description

Problem

get_platform() (src/pythonnative/platform.py, line 135) is documented and unit-tested (tests/test_platform.py, lines 26-27), but it isn't re-exported from pythonnative/__init__.py, so pn.get_platform() raises AttributeError. Users have to reach into pythonnative.platform for it, unlike its sibling Platform.

Suggested fix

  • Import get_platform in src/pythonnative/__init__.py alongside the existing Platform import and add "get_platform" to __all__ (the list starts around line 212).
  • Every name in __all__ must be covered by the E2E suite or listed in INTENTIONAL_EXEMPTIONS in scripts/check-e2e-coverage.py (line 46). Since get_platform() is a thin functional alias of Platform.OS, add it there with a one-line justification, following the style of the existing entries.
  • Optionally add a row for it on the Platform page in docs/api/platform.md.

Verification

  • python scripts/check-e2e-coverage.py exits 0.
  • A quick unit test that pn.get_platform() == pn.Platform.OS (or extend tests/test_platform.py).
  • ./scripts/check.sh passes.

Suggested commit message

feat(package): export get_platform

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL