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

Add a `--version` flag to the `pn` CLI · Issue #20 · pythonnative/pythonnative · GitHub

Repository navigation

Add a --version flag to the pn CLI #20

Description

What

Running pn --version should print the installed PythonNative version. Today the flag doesn't exist, so the command exits with an argparse error, and there's no quick way to check which version you're running when filing a bug report.

Where to look

  • src/pythonnative/cli/pn.py: the parser is assembled in _build_parser() (around line 864). Argparse has built-in support via parser.add_argument("--version", action="version", version=...).
  • The version string is available as pythonnative.__version__ (defined in src/pythonnative/__init__.py and kept in sync with pyproject.toml by python-semantic-release). Note that importing the full pythonnative package pulls in platform code, so prefer reading the version lazily or via importlib.metadata.version("pythonnative").

Acceptance criteria

  • pn --version prints a version string (for example, pn 0.x.y) and exits 0.
  • A test is added to tests/test_cli.py.
  • ./scripts/check.sh passes.

Notes for contributors

See CONTRIBUTING.md for setup. Suggested PR title: feat(cli): add --version flag.

No activity

Activity on this issue will appear here.

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

    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