GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — cli/install at main · FastLED/cli Expand file tree/ Copy pathinstallMore file actions executable file ·154 lines (136 loc) · 4.9 KB / Copy pathinstallFile metadata and controlsexecutable file ·154 lines (136 loc) · 4.9 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 #!/bin/bash set -e OS_NAME="$(uname -s 2>/dev/null || echo unknown)" # Check if UV is not found if ! command -v uv &> /dev/null; then # If Darwin (macOS), use brew to install UV if [[ "$OS_NAME" == "Darwin"* ]]; then brew install uv else # If it's Windows, use pip to install UV, else use pip3 case "$OS_NAME" in MINGW*|MSYS*|CYGWIN*) pip install uv ;; *) pip3 install uv ;; esac fi fi if [[ -d .venv ]]; then if [[ -f .venv/pyvenv.cfg ]]; then echo "Reusing existing virtual environment at .venv" else echo "Error: .venv exists but does not look like a Python virtual environment" >&2 echo "Remove or rename .venv, or create a valid virtual environment there first." >&2 exit 1 fi else uv venv --python "${UV_PYTHON:-3.11}" --seed fi uv pip install "build>=1" "setuptools>=69" "wheel>=0.43" uv pip install -r requirements.testing.txt # If activate exists, delete it if [[ -f activate || -L activate ]]; then rm -f activate fi # Create a top-level ./activate pointer for developer convenience. On # Windows, ln -s requires create-symlink privilege which CI runners (and # many dev machines) lack; current windows-2025 images fail here even for # git-bash. Fall back to plain copy, then to a no-op with a warning. Not # fatal: ./activate is only used interactively. case "$OS_NAME" in MINGW*|MSYS*|CYGWIN*) ACTIVATE_SRC=".venv/Scripts/activate" ;; *) ACTIVATE_SRC=".venv/bin/activate" ;; esac if [[ -f "$ACTIVATE_SRC" ]]; then ln -s "$ACTIVATE_SRC" ./activate 2>/dev/null \ || cp "$ACTIVATE_SRC" ./activate 2>/dev/null \ || echo "Warning: could not create ./activate (activate manually with: source $ACTIVATE_SRC)" else echo "Warning: $ACTIVATE_SRC not found; skipping ./activate symlink" fi CARGO_BIN="${CARGO_HOME:-$HOME/.cargo}/bin" UV_TOOL_BIN="${UV_TOOL_BIN_DIR:-$HOME/.local/bin}" export PATH="$UV_TOOL_BIN:$CARGO_BIN:$PATH" # soldr bootstrap # All Rust builds in this repo go through soldr so toolchain selection and # zccache usage stay consistent. if ! command -v soldr &> /dev/null; then echo "Installing soldr..." uv tool install soldr || { echo "Error: soldr install failed"; exit 1; } export PATH="$UV_TOOL_BIN:$CARGO_BIN:$PATH" fi # cargo-binstall: install pre-built Rust binaries # Install cargo-binstall if not present, then fetch the pre-built CLI binary # instead of compiling from source. if ! command -v cargo-binstall &> /dev/null; then echo "Installing cargo-binstall..." curl -L --proto '=https' --tlsv1.2 -sSf \ https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh \ | bash 2>/dev/null || echo " cargo-binstall install failed (non-fatal)" fi FASTLED_CLI_BINSTALLED=0 if command -v cargo-binstall &> /dev/null; then echo "Fetching pre-built binaries via cargo-binstall..." if cargo-binstall fastled-cli --no-confirm 2>/dev/null; then FASTLED_CLI_BINSTALLED=1 else echo " fastled-cli: no pre-built binary available (will compile from source)" fi fi # Ensure the Rust `fastled` CLI binary is materialised somewhere our Python # helpers (src/fastled/_rust_cli.py) can find it. If cargo-binstall didn't # supply a pre-built copy, build from source so unit # tests and the deploy workflow can subprocess the binary for the internal # auto-install plumbing flags (--internal-ensure-fastled-repo, etc.). if [[ "$FASTLED_CLI_BINSTALLED" -eq 0 ]]; then echo "Building fastled CLI from source..." if command -v soldr &> /dev/null; then soldr cargo build --release --bin fastled \ || { echo "Error: soldr cargo build --bin fastled failed"; exit 1; } else echo "Error: soldr is required for Rust builds. Install with: uv tool install soldr" >&2 exit 1 fi fi # Locate the just-built (or binstalled) Rust binary and stage it where # downstream tooling will find it. Editable installs do not copy package data # into the venv's Scripts/bin directory, so stage the package-local binary: # * `src/fastled/bin/fastled[.exe]` so the Python compatibility shim and a # subsequent `./build-wheel` both use the bundled native binary. case "$OS_NAME" in MINGW*|MSYS*|CYGWIN*) EXE_NAME="fastled.exe" ;; *) EXE_NAME="fastled" ;; esac BIN_SRC="" # Discover where the binary landed. cargo on Windows MSVC writes under # target/<triple>/release/; on other platforms (and when binstall provided it) # check the usual locations. for CANDIDATE in \ "target/x86_64-pc-windows-msvc/release/${EXE_NAME}" \ "target/aarch64-pc-windows-msvc/release/${EXE_NAME}" \ "target/release/${EXE_NAME}" \ "${CARGO_BIN}/${EXE_NAME}"; do if [[ -f "$CANDIDATE" ]]; then BIN_SRC="$CANDIDATE" break fi done if [[ -n "$BIN_SRC" ]]; then mkdir -p src/fastled/bin cp -f "$BIN_SRC" "src/fastled/bin/$EXE_NAME" echo "Staged $BIN_SRC -> src/fastled/bin/$EXE_NAME" else echo "Warning: Rust fastled binary not found; Python fastled shims will fail" >&2 fi uv pip install -e . |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |