9df5e1bd8f
Testing / remote-protocol-compat (0.9.5) (push) Successful in 40s
Testing / remote-protocol-compat (0.9.3) (push) Successful in 42s
Package Extension / package-extension (push) Successful in 32s
Build & Publish Package / publish (push) Successful in 25s
Testing / test (push) Successful in 31s
- Rename the PyPI distribution from browser-cli to real-browser-cli after PyPI rejected the original name as too similar to an existing project. - Keep the installed console command as browser-cli so user-facing CLI usage remains unchanged. - Add README-based package metadata, author information, and project URLs so PyPI renders a proper project description. - Centralize the PyPI distribution name for importlib.metadata version lookups used by the CLI, doctor command, and remote user agent. - Document uv tool install, optional fast extra installation, and upgrade commands. - Bump package and extension metadata to 0.14.3 for the republished release.
18 lines
499 B
Python
18 lines
499 B
Python
from importlib.metadata import version as _pkg_version
|
|
|
|
from browser_cli.constants import MAX_MSG_BYTES, PROTOCOL_MIN_CLIENT, PYPI_PACKAGE_NAME
|
|
|
|
def parse_version(v: str) -> tuple[int, ...]:
|
|
try:
|
|
return tuple(int(x) for x in v.lstrip("v").split("."))
|
|
except ValueError:
|
|
return (0,)
|
|
|
|
def get_installed_version() -> str:
|
|
try:
|
|
return _pkg_version(PYPI_PACKAGE_NAME)
|
|
except Exception:
|
|
return "0.0.0"
|
|
|
|
USER_AGENT = f"browser-cli/{get_installed_version()}"
|