← ClaudeAtlas

bioresearcher-python-setup-uvlisted

Sets up a project-local Python environment with the uv package manager: downloads uv binary from astral.sh, creates .venv, configures dependencies (pandas or scientific plotting: pymol-open-source, matplotlib, pymupdf, biopython), verifies install, and appends usage rules to AGENTS.md. Auto-races PyPI and CN mirrors. Use when uv/Python is missing, for plotting/analysis, or on requests like install uv, set up Python, prepare plotting packages, use a China mirror, or prepare .scripts/py/.
yeyuan98/bioresearcher-skills · ★ 1 · AI & Automation · score 73
Install: claude install-skill yeyuan98/bioresearcher-skills
# Python Environment Setup with uv This skill sets up a Python environment using the uv package manager. ## Prerequisites - Internet connection for downloading uv - Python 3.8+ should be available on PATH (or uv will prompt to install it) ## Steps Follow the sequence below in order. Perform environment verification before proceeding. ### Step 1: Auto-Select the Fastest Package Index (mirror race) Do NOT ask the user which mirror to use — probe and adopt the fastest index automatically (honor an explicit user-specified mirror if one was requested). Direct PyPI access can be extremely slow or unreachable from some networks (e.g. mainland China); regional mirrors fix this. Race PyPI, Aliyun, Tsinghua, and USTC with a timed probe and export the winner for the WHOLE session (uv reads `UV_INDEX_URL` automatically on every later `./uv pip` / `./uv venv` call): **For Unix-like shells:** ```bash export UV_INDEX_URL="$( for idx in "https://pypi.org/simple" \ "https://mirrors.aliyun.com/pypi/simple" \ "https://pypi.tuna.tsinghua.edu.cn/simple" \ "https://mirrors.ustc.edu.cn/pypi/simple"; do if t=$(curl -o /dev/null -sS -m 6 -w '%{time_total}' "$idx/pip/" 2>/dev/null); then echo "$t $idx" fi done | sort -n | head -1 | cut -d' ' -f2- )" case "$UV_INDEX_URL" in http*) echo "Using index: $UV_INDEX_URL" ;; *) unset UV_INDEX_URL; echo "No index reachable; proceeding with defaults" ;; esac ``` Only curl exit status 0 counts as a