From 53a9711f06ab957d1882970b0667b929799b0fc7 Mon Sep 17 00:00:00 2001 From: ducdetronquito Date: Mon, 7 Oct 2024 17:31:38 +0200 Subject: [PATCH 1/2] fix!(distrib): Do not expose `bun` CLI to the end user We silently expose a CLI to the bun executable on the user's PATH which could mess with its own existing bun setup. Instead, pybun now only exposes a CLI to the bun executable via `pybun`, `python -m pybun`, or a programmatic access. --- Fix #2 --- README.md | 12 ++++++++---- assets/entry_points.txt | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 68ba743..3d60b70 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,25 @@ [Bun](https://bun.sh/) is an all-in-one toolkit for JavaScript and TypeScript apps. -The [pybun](https://pypi.org/project/pybun/) Python package redistributes the Bun CLI executable so that it can be used as a dependency in your Python projects. +The [pybun](https://pypi.org/project/pybun/) Python package redistributes the Bun executable so that it can be used as a dependency in your Python projects. Usage ----- -To run the Bun CLI from the command line, you can use: +### Command line ```shell pybun --version -bun --version +``` + +### Run library module as a script + +```shell python -m pybun --version ``` -To run the Bun CLI from a Python program, use `sys.executable` to locate the Python binary to invoke. For example: +### From python ```python import sys, subprocess diff --git a/assets/entry_points.txt b/assets/entry_points.txt index 9d7bd59..627e5ea 100644 --- a/assets/entry_points.txt +++ b/assets/entry_points.txt @@ -1,3 +1,2 @@ [console_scripts] -bun = pybun.__main__:main pybun = pybun.__main__:main From fe75d57a40ea6d9e15dc1ecf7f9afa2b50db9480 Mon Sep 17 00:00:00 2001 From: ducdetronquito Date: Mon, 7 Oct 2024 18:00:48 +0200 Subject: [PATCH 2/2] doc: Ease intro readability --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d60b70..66ac1dc 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [Bun](https://bun.sh/) is an all-in-one toolkit for JavaScript and TypeScript apps. + The [pybun](https://pypi.org/project/pybun/) Python package redistributes the Bun executable so that it can be used as a dependency in your Python projects.