Metadata-Version: 2.1
Name: graalbase-cli
Version: 0.2.71
Summary: Python installer and launcher for the Graalbase CLI
Requires-Python: >=3.9
License: LicenseRef-Proprietary
License-File: LICENSE
Author: Oracle
Description-Content-Type: text/markdown
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development

# Graalbase CLI (Python installer)

`graalbase-cli` is a universal Python wheel. It installs a launcher that downloads the matching native executable on
first invocation, verifies its SHA-256 checksum, caches it, and runs it. CI tests the installer and builds the wheel on
main and pull-request runs. The Artifactory PyPI publisher and GDS uploads to stage and production run only from main.

The common wheel defaults to GDS production (`https://gds.oracle.com/api/20220101`, product
`A5A4994649484732BA6231CB8E032753`). Python package-index selection is independent of native source selection:

| Environment                                                         | Native source                                                         |
| ------------------------------------------------------------------- | --------------------------------------------------------------------- |
| No overrides                                                        | GDS production defaults embedded in wheel metadata                    |
| `GRAALBASE_CLI_BASE_URL`                                            | HTTPS mirror, such as the internal Artifactory generic CLI repository |
| Both `GRAALBASE_CLI_GDS_API_URL` and `GRAALBASE_CLI_GDS_PRODUCT_ID` | Explicit GDS environment, including stage                             |

Blank, partial, insecure, or conflicting overrides fail before network access. `GRAALBASE_CLI_VERSION` selects a
different native version; normally it matches the wheel version. GDS downloads are public.
Download failures do not switch sources. TLS, proxy support, and checksum checks
remain enabled. A cached executable is reused only when its stored verification hash matches the bytes on disk.

The installer supports Python `>=3.9` and native targets macOS ARM64, Linux AMD64, and Linux ARM64. Package-index and
Docker credentials are independent. Credentials do not belong in project configuration.

## Build and test

Build the common universal wheel after staging the common native outputs:

```bash
ORG_GRADLE_PROJECT_version=YYY \
  python3 -m build --wheel --outdir tools/cli/pypi/build/dist tools/cli/pypi
```

The backend converts development versions to Python's `.dev0` form with the Git hash in a local version label.
The embedded native artifact version remains identical to `ORG_GRADLE_PROJECT_version`.

Run launcher and packaging tests:

```bash
python3 -m unittest discover -s tools/cli/pypi/tests -v
```

Artifactory and both GDS targets consume the same retained wheel from `tools/cli/pypi/build/dist`. Upload coordinates,
GDS product/license identifiers, and publisher credentials are supplied by the destination-specific publisher and
are not written to the wheel.

## Installation output

The npm installer and Python's first `graalbase` invocation emit the same Graalbase messages to stderr:

```text
Downloading Graalbase CLI YYY for linux-amd64...
Download URL: https://gds.oracle.com/api/20220101/artifacts/YYY/content
Downloading Graalbase CLI YYY for linux-amd64: 124.0/124.0 MiB (100%)
Installed Graalbase CLI YYY at /YYY/graalbase
```

The output uses the resolved download URL and absolute executable path. npm reports its package's `bin/graalbase`;
Python reports its executable cache path. Use npm's `--foreground-scripts` to display installation messages. Terminal
progress updates in place; captured output prints a final summary. Unknown-size downloads show transferred MiB without
percentages. Verified Python cache reuse stays silent. Failures exit nonzero with a repair action and show the original
download URL when available, excluding credentials and signed redirect URLs.
