From a9b7cb5f2322d1a482ad327cbe30094df6d44cec Mon Sep 17 00:00:00 2001 From: Takeru O'oyama Date: Sat, 26 Oct 2024 07:40:58 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB:=20?= =?UTF-8?q?=E3=83=9E=E3=83=BC=E3=82=B8=E3=81=AB=E3=82=88=E3=82=8B=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E7=B5=B1=E5=90=88=E3=81=A8=E3=83=90=E3=82=B0=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=AE=E5=8F=8D=E6=98=A0=20(#7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactor setup script timeout to 20 minutes for both Ubuntu and macOS * Refactor setup script to enable Gatekeeper * Refactor setup script to remove Gatekeeper enablement * Refactor setup script to handle caching and downloading HackGenNerd Font * Refactor setup script to handle caching and downloading HackGenNerd Font in Linux environment * Refactor setup script to handle caching and downloading HackGenNerd Font in Linux environment * Refactor setup script to fix wget command in Linux environment * Refactor setup script to handle caching and downloading HackGenNerd Font in Linux environment * Refactor setup script to remove unnecessary --cask flag when installing aws-vault in Linux environment * Refactor setup script to handle unsupported OS when installing Google Chrome * Refactor setup script to fix cache key for HackGenNerd Font in Linux environment * Refactor setup script to cache and download HackGenNerd Font in Linux environment * Refactor setup script to enable Gatekeeper on macOS * Refactor setup script to add debug mode * Refactor setup script to fix file deletion bug in Linux environment * Refactor setup script to download and install HackGen_NF and HackGen fonts * Refactor setup script to cache and download HackGenNerd Font in Linux environment * Refactor setup script to cache and download HackGenNerd Font in Linux environment * Refactor setup script to cache and download HackGenNerd Font in Linux environment * Refactor setup script to cache and download HackGenNerd Font in Linux environment * Refactor setup script to conditionally download and install HackGenNerd Font in Linux environment * Refactor setup script to use direnv hook based on the user's shell * Refactor cache path and key for Hyper.js download * Refactor cache path and key for Hyper.js download * Refactor environment variable setup and cache path for Hyper.js and HackGenNerd Font * Refactor cache path for Hyper.js download * Refactor cache path and key for HackGenNerd Font download * Refactor cache path and key for HackGenNerd Font and Hyper.js downloads * Refactor cache path and key for HackGenNerd Font and Hyper.js downloads * Refactor cache path and key for HackGenNerd Font and Hyper.js downloads * Refactor setup script action to add execution permission and run the script * Add Python version 3.12.1 to .python-version file * Refactor generate PR description workflow * Refactor generate PR workflow to trigger only on pull requests opened or edited in the main branch * Refactor generate PR workflow to trigger only on pull requests opened or edited in the main branch * Refactor generate PR workflow to install uv dependency with pip * Refactor .editorconfig to set indent size for Python files * Refactor generate PR workflow to update PR description generation script location * Refactor generate PR workflow to update PR description generation script location, install uv dependency with pip, and trigger only on pull requests opened or edited in the main branch. Also, add requirements.txt file with openai==1.52.1 dependency. * Refactor generate PR workflow to update PR description generation script location, install uv dependency with pip, and trigger only on pull requests opened or edited in the main branch. Also, add requirements.txt file with openai==1.52.1 dependency. * Refactor generate PR workflow to enable caching of uv packages * Refactor generate PR workflow to remove uv package caching * Refactor setup.sh to install necessary packages for pyenv 3.12.1 on Linux and macOS * Refactor setup.sh to install necessary packages for pyenv 3.12.1 on Linux and macOS, and add installation of local utility packages * Refactor setup.sh to conditionally clone anyenv if it doesn't exist * Refactor setup.sh to clone anyenv if it doesn't exist * Refactor setup.sh to conditionally clone anyenv if it doesn't exist and force initialization * Refactor setup.sh to add .config/git/ignore to dotfiles * Refactor setup.sh to install necessary packages for pyenv 3.12.1 on Linux and macOS, and add installation of local utility packages * Refactor setup.sh to remove unnecessary GUI application installation check and add CI environment check * Refactor setup.sh to fix CI environment check and variable assignment * Refactor default setup script name in GitHub Actions workflow * Refactor setup.sh to add .config/git/ignore to dotfiles * Refactor setup.sh to remove unnecessary GUI application installation check and add CI environment check * Refactor setup.sh to remove unnecessary GUI application installation check and add CI environment check * Refactor setup.sh to fix HackGenNerd Font installation check and add installation attempt * Refactor setup.sh to update package manager and install libcrypt-dev * Add pyproject.toml with project metadata and dependencies * Update pyproject.toml with openai dependency * Update workflow to install dependencies with uv * Update workflow to install dependencies with uv * Update workflow to install dependencies with uv * Update workflow to grant write permissions for pull requests * Update setup script to remove unnecessary dotfile * Refactor setup script to handle CI environment * Refactor setup script to handle CI environment and remove unnecessary dotfile * Refactor setup script to update file paths for dotfiles * Refactor setup script to update file paths for dotfiles * Refactor setup script to handle CI environment and update file paths for dotfiles * Refactor setup script to update file paths for dotfiles * Refactor setup script to update file paths for dotfiles and handle CI environment * Refactor setup script to update file paths for dotfiles * Refactor setup script to update file paths for dotfiles and switch to main branch before pulling changes * Refactor setup script to update file paths for dotfiles and handle CI environment * Refactor setup script to update file paths for dotfiles and remove unnecessary branch switch * Refactor setup script to remove unnecessary branch switch and update file paths for dotfiles * Refactor setup script to update file paths for dotfiles and handle application installations * Refactor setup script to update file paths for dotfiles and handle CI environment * Refactor setup script to update OpenAI API key retrieval method * Refactor setup script to update file paths for dotfiles and remove unnecessary branch switch * Refactor setup script to import the 'os' module for environment variable retrieval * Refactor setup script to use OpenAI Python package and update API key retrieval method * Refactor setup script to use OpenAI Python package and update API key retrieval method * Refactor setup script to fetch latest changes from origin and get diff between origin/main and current branch * Refactor setup script to update OpenAI Python package model and API key retrieval method * Refactor setup script to update OpenAI Python package model and API key retrieval method * Refactor setup script to update OpenAI Python package model and API key retrieval method * Refactor setup script to update OpenAI Python package model and API key retrieval method * Refactor setup script to import subprocess module for command execution * Refactor setup script to import subprocess module for command execution and update OpenAI Python package model and API key retrieval method * Refactor setup script to update OpenAI Python package model and API key retrieval method * Refactor setup script to update OpenAI Python package model and API key retrieval method * Refactor setup script to update OpenAI Python package model and API key retrieval method * Refactor setup script to update OpenAI Python package model and API key retrieval method * Refactor generate_pr_description.py to update response parsing method * Refactor generate_pr_description.py to limit the number of commit logs retrieved * Refactor generate_pr_description.py to update response parsing method * Refactor generate_pr_description.py to limit the number of commit logs retrieved * Refactor generate_pr_description.py to increase max_tokens for prompt generation * Refactor generate_pr_description.py to increase max_tokens for prompt generation * Refactor generate_pr_description.py to fetch remote changes before retrieving commit logs --- .bashrc | 2 +- .config/git/ignore | 81 +++++ .editorconfig | 3 + .github/actions/setup-script/action.yml | 3 +- .github/workflows/generate-pr.yml | 50 ++++ .../scripts/generate_pr_description.py | 74 +++++ .github/workflows/test-setup.yml | 92 +++++- .python-version | 1 + pyproject.toml | 9 + requirements.txt | 1 + setup.sh => setup | 277 +++++++++++------- uv.lock | 243 +++++++++++++++ 12 files changed, 728 insertions(+), 108 deletions(-) create mode 100644 .config/git/ignore create mode 100644 .github/workflows/generate-pr.yml create mode 100644 .github/workflows/scripts/generate_pr_description.py create mode 100644 .python-version create mode 100644 pyproject.toml create mode 100644 requirements.txt rename setup.sh => setup (72%) create mode 100644 uv.lock diff --git a/.bashrc b/.bashrc index cf47bd4f..e4754110 100644 --- a/.bashrc +++ b/.bashrc @@ -193,7 +193,7 @@ export PATH="$HOME/.anyenv/bin:$PATH" eval "$(anyenv init -)" # direnv -eval "$(direnv hook zsh)" +eval "$(direnv hook bash)" # pbcopy/pbpaste if command -v xsel &> /dev/null; then diff --git a/.config/git/ignore b/.config/git/ignore new file mode 100644 index 00000000..e8078ff6 --- /dev/null +++ b/.config/git/ignore @@ -0,0 +1,81 @@ +# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux +# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux + +# customize +tmp/ diff --git a/.editorconfig b/.editorconfig index 071958fb..0c2be446 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,3 +14,6 @@ trim_trailing_whitespace = true [*.sh] indent_size = 4 + +[*.py] +indent_size = 4 diff --git a/.github/actions/setup-script/action.yml b/.github/actions/setup-script/action.yml index 15b60690..a866ee5b 100644 --- a/.github/actions/setup-script/action.yml +++ b/.github/actions/setup-script/action.yml @@ -6,7 +6,7 @@ description: Runs the setup script and performs checks inputs: script: description: 'The setup script to run' - default: 'setup.sh' + default: 'setup' required: true runs: @@ -15,6 +15,7 @@ runs: - name: 実行権限を設定 run: chmod +x ${{ inputs.script }} shell: bash + - name: セットアップスクリプトを実行 run: ./${{ inputs.script }} shell: bash diff --git a/.github/workflows/generate-pr.yml b/.github/workflows/generate-pr.yml new file mode 100644 index 00000000..aa84e09e --- /dev/null +++ b/.github/workflows/generate-pr.yml @@ -0,0 +1,50 @@ +--- +name: Generate PR Description + +on: + pull_request: + branches: + - main + +jobs: + generate-pr-description: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + pull-requests: write + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + + - name: pip upgrade + run: | + python -m pip install --upgrade pip + + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + version: "0.4.26" + enable-cache: true + cache-dependency-glob: "requirements**.txt" + + - name: Install dependencies with uv + run: | + uv pip install -r requirements.txt --system + + - name: Generate PR Title and Description + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + run: | + python .github/workflows/scripts/generate_pr_description.py > pr_output.txt + cat pr_output.txt + + - name: Update PR Title and Description + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER=${{ github.event.pull_request.number }} + PR_TITLE=$(head -n 1 pr_output.txt) + PR_BODY=$(tail -n +2 pr_output.txt) + gh pr edit $PR_NUMBER --title "$PR_TITLE" --body "$PR_BODY" diff --git a/.github/workflows/scripts/generate_pr_description.py b/.github/workflows/scripts/generate_pr_description.py new file mode 100644 index 00000000..46400a39 --- /dev/null +++ b/.github/workflows/scripts/generate_pr_description.py @@ -0,0 +1,74 @@ +from openai import OpenAI +import os +import subprocess + +# OpenAI API キーを設定 +api_key = os.getenv("OPENAI_API_KEY") +if not api_key: + raise ValueError("API key is not set.") + +client = OpenAI( + # This is the default and can be omitted + api_key = os.getenv("OPENAI_API_KEY") +) + +# プロンプトの準備 +def create_prompt(commit_logs): + return f""" + 以下のコミットログとファイルの差分を読んで、わかりやすいプルリクエストのタイトルと詳細な説明を日本語で作成してください。 + + コミットログとファイルの差分: + {commit_logs} + + 出力形式: + タイトル: プルリクエストのタイトル + 説明: + - 変更点の概要 + - 技術的な詳細や注意点 + """ + +# OpenAI API でのリクエスト +def generate_pr_description(commit_logs): + prompt = create_prompt(commit_logs) + + response = client.chat.completions.create( + model="gpt-4o", # GPT-3.5の場合は "gpt-3.5-turbo" に変更 + messages=[ + {"role": "system", "content": "あなたは優秀なソフトウェアエンジニアです。"}, + {"role": "user", "content": prompt}, + ], + max_tokens=1000, + temperature=0.1, + ) + + return response.choices[0].message.content.strip() + +# Git コミットログとファイルの差分の取得 +def get_commit_logs_and_diffs(): + # リモートの変更を取得 + subprocess.run(['git', 'fetch', 'origin'], check=True) + + result = subprocess.run(['git', 'log', '--pretty=format:%H %s', 'origin/main..HEAD', '-n', '70'], capture_output=True, text=True) # コミットログの数を制限 + commit_logs = result.stdout.strip().split('\n') + + if not commit_logs or commit_logs == ['']: + return "" + + logs_and_diffs = [] + for commit in commit_logs: + commit_hash = commit.split()[0] + if commit_hash: + diff_result = subprocess.run(['git', 'diff', commit_hash + '^!', '--'], capture_output=True, text=True) + logs_and_diffs.append(f"Commit: {commit}\nDiff:\n{diff_result.stdout}") + + return "\n\n".join(logs_and_diffs) + +# メインロジック +if __name__ == "__main__": + commit_logs_and_diffs = get_commit_logs_and_diffs() + + if commit_logs_and_diffs: + pr_description = generate_pr_description(commit_logs_and_diffs) + print(pr_description) + else: + print("No new commits detected.") diff --git a/.github/workflows/test-setup.yml b/.github/workflows/test-setup.yml index 6fc15ee6..c595d313 100644 --- a/.github/workflows/test-setup.yml +++ b/.github/workflows/test-setup.yml @@ -4,14 +4,15 @@ on: push: branches: - main - pull_request: - branches: - - main + # pull_request: + # branches: + # - main workflow_dispatch: env: - HACKGEN_VERSION: "2.9.0" DL_PATH: "$HOME/Downloads" + HACKGEN_VERSION: "2.9.0" + HYPER_VERSION: "3.4.1" jobs: test-ubuntu: @@ -19,30 +20,55 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Set up environment variables + run: | + echo "DL_PATH=$HOME/Downloads" >> $GITHUB_ENV + echo "HACKGEN_VERSION=2.9.0" >> $GITHUB_ENV + echo "HYPER_VERSION=3.4.1" >> $GITHUB_ENV + - name: Cache HackGenNerd Font id: cache-hackgen-nf uses: actions/cache@v4 with: path: ${{ env.DL_PATH }}/HackGen_NF_v${{ env.HACKGEN_VERSION }}.zip - key: ${{ runner.os }}-hackgen-nf-${{ env.HACKGEN_VERSION }} + key: ${{ runner.os }}-hackgen-nf-${{ env.HACKGEN_VERSION }}- restore-keys: | - ${{ runner.os }}-hackgen-nf-${{ env.HACKGEN_VERSION }} + ${{ runner.os }}-hackgen-nf-${{ env.HACKGEN_VERSION }}- + - name: Download HackGenNerd Font if: steps.cache-hackgen-nf.outputs.cache-hit != 'true' run: | wget -P "${{ env.DL_PATH }}" "https://github.com/yuru7/HackGen/releases/download/v${{ env.HACKGEN_VERSION }}/HackGen_NF_v${{ env.HACKGEN_VERSION }}.zip" + - name: Cache HackGen id: cache-hackgen uses: actions/cache@v4 with: path: ${{ env.DL_PATH }}/HackGen_v${{ env.HACKGEN_VERSION }}.zip - key: ${{ runner.os }}-hackgen-${{ env.HACKGEN_VERSION }} + key: ${{ runner.os }}-hackgen-${{ env.HACKGEN_VERSION }}- restore-keys: | - ${{ runner.os }}-hackgen-${{ env.HACKGEN_VERSION }} + ${{ runner.os }}-hackgen-${{ env.HACKGEN_VERSION }}- + - name: Download HackGen if: steps.cache-hackgen.outputs.cache-hit != 'true' run: | wget -P "${{ env.DL_PATH }}" "https://github.com/yuru7/HackGen/releases/download/v${{ env.HACKGEN_VERSION }}/HackGen_v${{ env.HACKGEN_VERSION }}.zip" + + - name: Cache Hyper.js + id: cache-hyper + uses: actions/cache@v4 + with: + path: ${{ env.DL_PATH }}/deb + key: ${{ runner.os }}-hyper-js-${{ env.HYPER_VERSION }}- + restore-keys: | + ${{ runner.os }}-hyper-js-${{ env.HYPER_VERSION }}- + + - name: Download Hyper.js + if: steps.cache-hyper.outputs.cache-hit != 'true' + run: | + wget -P "${{ env.DL_PATH }}" "https://releases.hyper.is/download/deb" + - uses: ./.github/actions/setup-script test-macos: @@ -50,6 +76,56 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 + + - name: Set up environment variables + run: | + echo "DL_PATH=$HOME/Downloads" >> $GITHUB_ENV + echo "HACKGEN_VERSION=2.9.0" >> $GITHUB_ENV + echo "HYPER_VERSION=3.4.1" >> $GITHUB_ENV + + - name: Cache HackGenNerd Font + id: cache-hackgen-nf + uses: actions/cache@v4 + with: + path: ${{ env.DL_PATH }}/HackGen_NF_v${{ env.HACKGEN_VERSION }}.zip + key: ${{ runner.os }}-hackgen-nf-${{ env.HACKGEN_VERSION }}- + restore-keys: | + ${{ runner.os }}-hackgen-nf-${{ env.HACKGEN_VERSION }}- + + - name: Download HackGenNerd Font + if: steps.cache-hackgen-nf.outputs.cache-hit != 'true' + run: | + wget -P "${{ env.DL_PATH }}" "https://github.com/yuru7/HackGen/releases/download/v${{ env.HACKGEN_VERSION }}/HackGen_NF_v${{ env.HACKGEN_VERSION }}.zip" + + - name: Cache HackGen + id: cache-hackgen + uses: actions/cache@v4 + with: + path: ${{ env.DL_PATH }}/HackGen_v${{ env.HACKGEN_VERSION }}.zip + key: ${{ runner.os }}-hackgen-${{ env.HACKGEN_VERSION }}- + restore-keys: | + ${{ runner.os }}-hackgen-${{ env.HACKGEN_VERSION }}- + + - name: Download HackGen + if: steps.cache-hackgen.outputs.cache-hit != 'true' + run: | + wget -P "${{ env.DL_PATH }}" "https://github.com/yuru7/HackGen/releases/download/v${{ env.HACKGEN_VERSION }}/HackGen_v${{ env.HACKGEN_VERSION }}.zip" + + - name: Cache Hyper.js + id: cache-hyper + uses: actions/cache@v4 + with: + path: ${{ env.DL_PATH }}/deb + key: ${{ runner.os }}-hyper-js-${{ env.HYPER_VERSION }}- + restore-keys: | + ${{ runner.os }}-hyper-js-${{ env.HYPER_VERSION }}- + + - name: Download Hyper.js + if: steps.cache-hyper.outputs.cache-hit != 'true' + run: | + wget -P "${{ env.DL_PATH }}" "https://releases.hyper.is/download/deb" + - name: Enable Gatekeeper run: sudo spctl --master-enable + - uses: ./.github/actions/setup-script diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..171a6a93 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12.1 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..0dcc62ab --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,9 @@ +[project] +name = "local-workspace-provisioning" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.12" +dependencies = [ + "openai==1.52.1", +] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..28fb9411 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +openai==1.52.1 diff --git a/setup.sh b/setup similarity index 72% rename from setup.sh rename to setup index b7eefe49..6cab4328 100755 --- a/setup.sh +++ b/setup @@ -1,20 +1,19 @@ #!/bin/bash +set -ex + # 作業ディレクトリの設定 OWNER="tqer39" # あなたのGitHubのユーザー名に変更してください WORKSPACE="$HOME/workspace" REPO_NAME="local-workspace-provisioning" -DOTFILES_DIR="${WORKSPACE}/${REPO_NAME}" REPO_URL="https://github.com/${OWNER}/${REPO_NAME}.git" # CI環境で実行されているか確認 if [ -n "$CI" ]; then echo "CI環境で実行されています。" - - # GUIアプリケーションのインストールをスキップ - INSTALL_GUI_APPS=false else - INSTALL_GUI_APPS=true + echo "CI環境で実行されていません。" + CI="false" fi # OSタイプの取得 @@ -167,39 +166,47 @@ fi # リポジトリをクローンまたは既存のリポジトリを使用 if [ "$CI" == "true" ]; then echo "CI環境で実行されています。既存のリポジトリを使用します。" - DOTFILES_DIR="$GITHUB_WORKSPACE" + if [ -n "$GITHUB_WORKSPACE" ]; then + WORKSPACE="$GITHUB_WORKSPACE" + fi else - if [ ! -d "$DOTFILES_DIR" ]; then - echo "dotfiles を $DOTFILES_DIR にクローンします..." - git clone "$REPO_URL" "$DOTFILES_DIR" + if [ ! -d "$WORKSPACE" ]; then + echo "${REPO_NAME} を ${WORKSPACE} にクローンします..." + git clone "$REPO_URL" "$WORKSPACE" if [ $? -ne 0 ]; then echo "❌ リポジトリのクローンに失敗しました。" exit 1 fi else echo "dotfiles は既に存在します。最新の変更を取得します..." - git -C "$DOTFILES_DIR" pull + git -C "$WORKSPACE/$REPO_NAME" pull fi fi # dotfiles のシンボリックリンクを作成 echo "シンボリックリンクを作成します..." +mkdir -p "$HOME/.config" +mkdir -p "$HOME/.config/git" + # リンクしたい dotfile を個別に指定 DOTFILES=( + ".config/git/ignore" ".config/starship.toml" ".bash_profile" ".bashrc" ".gitconfig" ".hyper.js" ".zshrc" - # 他の dotfile を追加 ) for file in "${DOTFILES[@]}"; do - source_file="$DOTFILES_DIR/$file" + if [ $CI == "true" ]; then + source_file="$WORKSPACE/$file" + else + source_file="$WORKSPACE/$REPO_NAME/$file" + fi target_file="$HOME/$file" - if [ -e "$source_file" ]; then ln -sf "$source_file" "$target_file" if [ $? -eq 0 ]; then @@ -302,7 +309,12 @@ install_if_missing "gh" "brew install gh" # direnv install_if_missing "direnv" "brew install direnv" -eval "$(direnv hook zsh)" +# bash を使っているなら direnv hook bash にする。zsh を使っているなら direnv hook zsh にする。 +if [ "$SHELL" == "/bin/bash" ]; then + eval "$(direnv hook bash)" +elif [ "$SHELL" == "/bin/zsh" ]; then + eval "$(direnv hook zsh)" +fi # direnv の初期化(dotfiles で管理されている前提) # eval "$(direnv hook zsh)" は .zshrc に含まれている前提 @@ -312,8 +324,10 @@ install_if_missing "starship" "brew install starship" # anyenv install_if_missing "anyenv" "brew install anyenv" -git clone https://github.com/anyenv/anyenv ~/.anyenv -anyenv install --force-init +if [ ! -d "$HOME/.anyenv" ]; then + git clone https://github.com/anyenv/anyenv "$HOME/.anyenv" + anyenv install --force-init +fi anyenv install -l export PATH="$HOME/.anyenv/bin:$PATH" eval "$(anyenv init -)" @@ -376,10 +390,16 @@ if ! command -v hyper &> /dev/null; then $SUDO $PACKAGE_MANAGER update $SUDO $PACKAGE_MANAGER install -y libnotify4 # Hyper.js のインストール - DL_PATH="$HOME/Downloads" - wget -P $DL_PATH https://releases.hyper.is/download/deb + if [ -z "$DL_PATH" ]; then + DL_PATH="$HOME/Downloads" + fi + if [ $CI != "true" ]; then + wget -P $DL_PATH https://releases.hyper.is/download/deb + fi $SUDO dpkg -i "${DL_PATH}/deb" - rm -rf "${DL_PATH}/deb" + if [ $CI != "true" ]; then + rm -rf "${DL_PATH}/deb" + fi else $SUDO snap install hyper --classic fi @@ -465,40 +485,50 @@ fi # Brave echo "Brave ブラウザをインストールします..." -if [[ "$OS_TYPE" == "Linux" ]]; then - if [[ "$PACKAGE_MANAGER" == "apt" || "$PACKAGE_MANAGER" == "apt-get" ]]; then - # Brave の GPG キーを追加 - $SUDO curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ - https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg - - # Brave のリポジトリを追加 - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] \ - https://brave-browser-apt-release.s3.brave.com/ stable main" | $SUDO tee /etc/apt/sources.list.d/brave-browser-release.list - - # パッケージリストを更新 - $SUDO $PACKAGE_MANAGER update - - # Brave ブラウザをインストール - $SUDO $PACKAGE_MANAGER install -y brave-browser - elif [[ "$PACKAGE_MANAGER" == "yum" ]]; then - $SUDO dnf install dnf-plugins-core - $SUDO dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/x86_64/ - $SUDO rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc - $SUDO dnf install -y brave-browser - else - echo "❌ Brave のインストール方法が不明です。手動でインストールしてください。" - fi - - if ! command -v brave-browser &> /dev/null; then - echo "❌ Brave ブラウザのインストールに失敗しました。手動でインストールしてください。" - exit 1 - else - echo "✅ Brave ブラウザのインストールが完了しました。" - fi -elif [[ "$OS_TYPE" == "Darwin" ]]; then - brew install --cask brave-browser -else - echo "❌ サポートされていないOSです。Brave のインストールをスキップします。" +if ! command -v brave-browser &> /dev/null; then + echo "Brave ブラウザがインストールされていません。インストールを試みます。" + if [[ "$OS_TYPE" == "Linux" ]]; then + if [[ "$PACKAGE_MANAGER" == "apt" || "$PACKAGE_MANAGER" == "apt-get" ]]; then + # Brave の GPG キーを追加 + $SUDO curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ + https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + + # Brave のリポジトリを追加 + echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] \ + https://brave-browser-apt-release.s3.brave.com/ stable main" | $SUDO tee /etc/apt/sources.list.d/brave-browser-release.list + + # パッケージリストを更新 + $SUDO $PACKAGE_MANAGER update + + # Brave ブラウザをインストール + $SUDO $PACKAGE_MANAGER install -y brave-browser + elif [[ "$PACKAGE_MANAGER" == "yum" ]]; then + $SUDO dnf install dnf-plugins-core + $SUDO dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/x86_64/ + $SUDO rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc + $SUDO dnf install -y brave-browser + else + echo "❌ Brave のインストール方法が不明です。手動でインストールしてください。" + fi + + if ! command -v brave-browser &> /dev/null; then + echo "❌ Brave ブラウザのインストールに失敗しました。手動でインストールしてください。" + exit 1 + else + echo "✅ Brave ブラウザのインストールが完了しました。" + fi + elif [[ "$OS_TYPE" == "Darwin" ]]; then + brew install --cask brave-browser + + if [ ! -d "/Applications/Brave Browser.app" ] &> /dev/null; then + echo "❌ Brave ブラウザのインストールに失敗しました。手動でインストールしてください。" + exit 1 + else + echo "✅ Brave ブラウザのインストールが完了しました。" + fi + else + echo "❌ サポートされていないOSです。Brave のインストールをスキップします。" + fi fi echo "brave-browser version: $(brave-browser --version)" @@ -538,58 +568,72 @@ echo "1password version: $(1password --version)" # HackGenNerd Font echo "HackGenNerd Font をインストールします..." if [[ "$OS_TYPE" == "Linux" ]]; then - if [[ "$PACKAGE_MANAGER" == "apt" || "$PACKAGE_MANAGER" == "apt-get" ]]; then - # バージョン指定 - HACKGEN_VERSION="2.9.0" - DL_PATH="$HOME/Downloads" + if fc-list | grep -i "HackGen"; then + echo "✅ HackGenNerd Font は既にインストールされています。" + else + echo "HackGenNerd Font がインストールされていません。インストールを試みます。" + if [[ "$PACKAGE_MANAGER" == "apt" || "$PACKAGE_MANAGER" == "apt-get" ]]; then + # バージョン指定 + if [ -z "$HACKGEN_VERSION" ]; then + HACKGEN_VERSION="2.9.0" + fi + if [ -z "$DL_PATH" ]; then + DL_PATH="$HOME/Downloads" + fi - # CI のときは事前にダウンロードしてキャッシュしてるのでスキップ - if [ "$CI" == "true" ]; then - echo "CI環境で実行されているため、ダウンロードをスキップします。" - else - # HackGen_NF のダウンロードとインストール - wget -P "$DL_PATH" "https://github.com/yuru7/HackGen/releases/download/v${HACKGEN_VERSION}/HackGen_NF_v${HACKGEN_VERSION}.zip" - fi - unzip -o "${DL_PATH}/HackGen_NF_v${HACKGEN_VERSION}.zip" -d "$DL_PATH" - # ユーザーにインストール - mkdir -p "$HOME/.local/share/fonts" - cp -r "${DL_PATH}/HackGen_NF_v${HACKGEN_VERSION}/"* "$HOME/.local/share/fonts/" - - if [ "$CI" != "true" ]; then - # インストーラとディレクトリを削除 - rm -rf "${DL_PATH}/HackGen_NF_v${HACKGEN_VERSION}" - rm -rf "${DL_PATH}/HackGen_v${HACKGEN_VERSION}.zip" + # CI のときは事前にダウンロードしてキャッシュしてるのでスキップ + if [ "$CI" == "true" ]; then + echo "CI環境で実行されているため、ダウンロードをスキップします。" + else + # HackGen_NF + wget -P "$DL_PATH" "https://github.com/yuru7/HackGen/releases/download/v${HACKGEN_VERSION}/HackGen_NF_v${HACKGEN_VERSION}.zip" + # HackGen + wget -P "$DL_PATH" "https://github.com/yuru7/HackGen/releases/download/v${HACKGEN_VERSION}/HackGen_v${HACKGEN_VERSION}.zip" + fi + + unzip -o "${DL_PATH}/HackGen_NF_v${HACKGEN_VERSION}.zip" -d "$DL_PATH" + unzip -o "${DL_PATH}/HackGen_v${HACKGEN_VERSION}.zip" -d "$DL_PATH" + + # ユーザーにインストール + mkdir -p "$HOME/.local/share/fonts" + cp -r "${DL_PATH}/HackGen_NF_v${HACKGEN_VERSION}/"* "$HOME/.local/share/fonts/" + cp -r "${DL_PATH}/HackGen_v${HACKGEN_VERSION}/"* "$HOME/.local/share/fonts/" + + if [ "$CI" != "true" ]; then + # インストーラとディレクトリを削除 + rm -rf "${DL_PATH}/HackGen_NF_v${HACKGEN_VERSION}" + rm -rf "${DL_PATH}/HackGen_NF_v${HACKGEN_VERSION}.zip" + rm -rf "${DL_PATH}/HackGen_v${HACKGEN_VERSION}" + rm -rf "${DL_PATH}/HackGen_v${HACKGEN_VERSION}.zip" + fi + + # フォントのキャッシュを更新 + fc-cache -vf + + # フォントのインストール確認 + if fc-list | grep -i "HackGen"; then + echo "✅ HackGenNerd Font が正常にインストールされました。" + else + echo "❌ HackGenNerd Font のインストールに失敗しました。" + exit 1 + fi + elif [[ "$PACKAGE_MANAGER" == "yum" ]]; then + $SUDO yum install -y fi + fi +elif [[ "$OS_TYPE" == "Darwin" ]]; then + if brew list --cask | grep -i "font-hackgen-nerd"; then + echo "✅ HackGenNerd Font は既にインストールされています。" + else + echo "HackGenNerd Font がインストールされていません。インストールを試みます。" + brew install --cask font-hackgen-nerd - # HackGen のダウンロードとインストール - wget -P "$DL_PATH" "https://github.com/yuru7/HackGen/releases/download/v${HACKGEN_VERSION}/HackGen_v${HACKGEN_VERSION}.zip" - unzip -o "${DL_PATH}/HackGen_v${HACKGEN_VERSION}.zip" -d "$DL_PATH" - # ユーザーにインストール - cp -r "${DL_PATH}/HackGen_v${HACKGEN_VERSION}/"* "$HOME/.local/share/fonts/" - # インストーラとディレクトリを削除 - rm -rf "${DL_PATH}/HackGen_v${HACKGEN_VERSION}" - rm -rf "${DL_PATH}/HackGen_v${HACKGEN_VERSION}.zip" - - # フォントのキャッシュを更新 - fc-cache -vf - # フォントのインストール確認 - if fc-list | grep -i "HackGen"; then + if [ "$?" -eq 0 ]; then echo "✅ HackGenNerd Font が正常にインストールされました。" else echo "❌ HackGenNerd Font のインストールに失敗しました。" exit 1 fi - elif [[ "$PACKAGE_MANAGER" == "yum" ]]; then - $SUDO yum install -y - fi -elif [[ "$OS_TYPE" == "Darwin" ]]; then - brew install --cask font-hackgen-nerd - - if [ "$?" -eq 0 ]; then - echo "✅ HackGenNerd Font が正常にインストールされました。" - else - echo "❌ HackGenNerd Font のインストールに失敗しました。" - exit 1 fi fi echo "HackGenNerd Font のインストールが完了しました。" @@ -601,7 +645,7 @@ if [[ "$OS_TYPE" == "Darwin" ]]; then fi # アプリの存在有無でインストールされたかどうかをチェック - if [ ! -e /Applications/DeskPad.app ]; then + if [ ! -d "/Applications/DeskPad.app" ]; then echo "❌ deskpad のインストールに失敗しました。手動でインストールしてください。" exit 1 else @@ -609,6 +653,43 @@ if [[ "$OS_TYPE" == "Darwin" ]]; then fi fi +# ローカル専用の utility のインストール +if [ $CI != "true" ]; then + echo "ローカル専用の utility をインストールします..." + if [[ "$OS_TYPE" == "Linux" ]]; then + if [[ "$PACKAGE_MANAGER" == "apt" || "$PACKAGE_MANAGER" == "apt-get" ]]; then + # pyenv install 3.12.1 で必要なパッケージ + echo "pyenv install 3.12.1 で必要なパッケージをインストールします..." + $SUDO $PACKAGE_MANAGER update + $SUDO $PACKAGE_MANAGER install -y libcrypt-dev + brew install tcl-tk + # uv + echo "uv をインストールします..." + if ! command -v uv &> /dev/null; then + curl -LsSf https://astral.sh/uv/install.sh | sh + fi + # pyenv + echo "pyenv install -s を実行します..." + # 一度 unlink しないとエラーになる see https://mainmokeybusiness.com/post/pyenv_install_error/ + brew unlink pkg-config + pyenv install -s + brew link pkg-config + fi + elif [[ "$OS_TYPE" == "Darwin" ]]; then + # pyenv install 3.12.1 で必要なパッケージ + echo "pyenv install 3.12.1 で必要なパッケージをインストールします..." + brew install tcl-tk + # uv + echo "uv をインストールします..." + if ! command -v uv &> /dev/null; then + curl -LsSf https://astral.sh/uv/install.sh | sh + fi + # pyenv + echo "pyenv install -s を実行します..." + pyenv install -s + fi +fi + echo "セットアップが完了しました!" if [ "$CI" == "true" ]; then diff --git a/uv.lock b/uv.lock new file mode 100644 index 00000000..7b600164 --- /dev/null +++ b/uv.lock @@ -0,0 +1,243 @@ +version = 1 +requires-python = ">=3.12" +resolution-markers = [ + "python_full_version < '3.13'", + "python_full_version >= '3.13'", +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643 }, +] + +[[package]] +name = "anyio" +version = "4.6.2.post1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "sniffio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9f/09/45b9b7a6d4e45c6bcb5bf61d19e3ab87df68e0601fa8c5293de3542546cc/anyio-4.6.2.post1.tar.gz", hash = "sha256:4c8bc31ccdb51c7f7bd251f51c609e038d63e34219b44aa86e47576389880b4c", size = 173422 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e4/f5/f2b75d2fc6f1a260f340f0e7c6a060f4dd2961cc16884ed851b0d18da06a/anyio-4.6.2.post1-py3-none-any.whl", hash = "sha256:6d170c36fba3bdd840c73d3868c1e777e33676a69c3a72cf0a0d5d6d8009b61d", size = 90377 }, +] + +[[package]] +name = "certifi" +version = "2024.8.30" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/ee/9b19140fe824b367c04c5e1b369942dd754c4c5462d5674002f75c4dedc1/certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9", size = 168507 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/90/3c9ff0512038035f59d279fddeb79f5f1eccd8859f06d6163c58798b9487/certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8", size = 167321 }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "distro" +version = "1.9.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed", size = 60722 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277 }, +] + +[[package]] +name = "h11" +version = "0.14.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f5/38/3af3d3633a34a3316095b39c8e8fb4853a28a536e55d347bd8d8e9a14b03/h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", size = 100418 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761", size = 58259 }, +] + +[[package]] +name = "httpcore" +version = "1.0.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b6/44/ed0fa6a17845fb033bd885c03e842f08c1b9406c86a2e60ac1ae1b9206a6/httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f", size = 85180 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/06/89/b161908e2f51be56568184aeb4a880fd287178d176fd1c860d2217f41106/httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f", size = 78011 }, +] + +[[package]] +name = "httpx" +version = "0.27.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, + { name = "sniffio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/78/82/08f8c936781f67d9e6b9eeb8a0c8b4e406136ea4c3d1f89a5db71d42e0e6/httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2", size = 144189 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/56/95/9377bcb415797e44274b51d46e3249eba641711cf3348050f76ee7b15ffc/httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0", size = 76395 }, +] + +[[package]] +name = "idna" +version = "3.10" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442 }, +] + +[[package]] +name = "jiter" +version = "0.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/26/ef/64458dfad180debd70d9dd1ca4f607e52bb6de748e5284d748556a0d5173/jiter-0.6.1.tar.gz", hash = "sha256:e19cd21221fc139fb032e4112986656cb2739e9fe6d84c13956ab30ccc7d4449", size = 161306 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2e/d5/fcdfbcea637f8b9b833597797d6b77fd7e22649b4794fc571674477c8520/jiter-0.6.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:1fad93654d5a7dcce0809aff66e883c98e2618b86656aeb2129db2cd6f26f867", size = 289279 }, + { url = "https://files.pythonhosted.org/packages/9a/47/8e4a7704a267b8d1d3287b4353fc07f1f4a3541b27988ea3e49ccbf3164a/jiter-0.6.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4e6e340e8cd92edab7f6a3a904dbbc8137e7f4b347c49a27da9814015cc0420c", size = 300931 }, + { url = "https://files.pythonhosted.org/packages/ea/4f/fbb1e11fcc3881d108359d3db8456715c9d30ddfce84dc5f9e0856e08e11/jiter-0.6.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:691352e5653af84ed71763c3c427cff05e4d658c508172e01e9c956dfe004aba", size = 336534 }, + { url = "https://files.pythonhosted.org/packages/29/8a/4c1e1229f89127187df166de760438b2a20e5a311391ba10d2b69db0da6f/jiter-0.6.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:defee3949313c1f5b55e18be45089970cdb936eb2a0063f5020c4185db1b63c9", size = 354266 }, + { url = "https://files.pythonhosted.org/packages/19/15/3f27f4b9d40bc7709a30fda99876cbe9e9f75a0ea2ef7d55f3dd4d04f927/jiter-0.6.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:26d2bdd5da097e624081c6b5d416d3ee73e5b13f1703bcdadbb1881f0caa1933", size = 370492 }, + { url = "https://files.pythonhosted.org/packages/1f/9d/9ec03c07325bc3a3c5b5082840b8ecb7e7ad38f3071c149b7c6fb9e78706/jiter-0.6.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:18aa9d1626b61c0734b973ed7088f8a3d690d0b7f5384a5270cd04f4d9f26c86", size = 390330 }, + { url = "https://files.pythonhosted.org/packages/bd/3b/612ea6daa52d64bc0cc46f2bd2e138952c58f1edbe86b17fd89e07c33d86/jiter-0.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a3567c8228afa5ddcce950631c6b17397ed178003dc9ee7e567c4c4dcae9fa0", size = 324245 }, + { url = "https://files.pythonhosted.org/packages/21/0f/f3a1ffd9f203d4014b4e5045c0ea2c67ee71a7eee8bf3408dbf11007cf07/jiter-0.6.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e5c0507131c922defe3f04c527d6838932fcdfd69facebafd7d3574fa3395314", size = 368232 }, + { url = "https://files.pythonhosted.org/packages/62/12/5d75729e0a57804852de0affc6f03b3df8518259e47ed4cd89aeeb671a71/jiter-0.6.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:540fcb224d7dc1bcf82f90f2ffb652df96f2851c031adca3c8741cb91877143b", size = 513820 }, + { url = "https://files.pythonhosted.org/packages/5f/e8/e47734280e19cd465832e610e1c69367ee72947de738785c4b6fc4031e25/jiter-0.6.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e7b75436d4fa2032b2530ad989e4cb0ca74c655975e3ff49f91a1a3d7f4e1df2", size = 496023 }, + { url = "https://files.pythonhosted.org/packages/52/01/5f65dd1387d39aa3fd4a98a5be1d8470e929a0cb0dd6cbfebaccd9a20ac5/jiter-0.6.1-cp312-none-win32.whl", hash = "sha256:883d2ced7c21bf06874fdeecab15014c1c6d82216765ca6deef08e335fa719e0", size = 197425 }, + { url = "https://files.pythonhosted.org/packages/43/b2/bd6665030f7d7cd5d9182c62a869c3d5ceadd7bff9f1b305de9192e7dbf8/jiter-0.6.1-cp312-none-win_amd64.whl", hash = "sha256:91e63273563401aadc6c52cca64a7921c50b29372441adc104127b910e98a5b6", size = 198966 }, + { url = "https://files.pythonhosted.org/packages/23/38/7b48e0149778ff4b893567c9fd997ecfcc013e290375aa7823e1f681b3d3/jiter-0.6.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:852508a54fe3228432e56019da8b69208ea622a3069458252f725d634e955b31", size = 288674 }, + { url = "https://files.pythonhosted.org/packages/85/3b/96d15b483d82a637279da53a1d299dd5da6e029b9905bcd1a4e1f89b8e4f/jiter-0.6.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f491cc69ff44e5a1e8bc6bf2b94c1f98d179e1aaf4a554493c171a5b2316b701", size = 301531 }, + { url = "https://files.pythonhosted.org/packages/cf/54/9681f112cbec4e197259e9db679bd4bc314f4bd24f74b9aa5e93073990b5/jiter-0.6.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc56c8f0b2a28ad4d8047f3ae62d25d0e9ae01b99940ec0283263a04724de1f3", size = 335954 }, + { url = "https://files.pythonhosted.org/packages/4a/4d/f9c0ba82b154c66278e28348086086264ccf50622ae468ec215e4bbc2873/jiter-0.6.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:51b58f7a0d9e084a43b28b23da2b09fc5e8df6aa2b6a27de43f991293cab85fd", size = 353996 }, + { url = "https://files.pythonhosted.org/packages/ee/be/7f26b258ef190f6d582e21c76c7dd1097753a2203bad3e1643f45392720a/jiter-0.6.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5f79ce15099154c90ef900d69c6b4c686b64dfe23b0114e0971f2fecd306ec6c", size = 369733 }, + { url = "https://files.pythonhosted.org/packages/5f/85/037ed5261fa622312471ef5520b2135c26b29256c83adc16c8cc55dc4108/jiter-0.6.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:03a025b52009f47e53ea619175d17e4ded7c035c6fbd44935cb3ada11e1fd592", size = 389920 }, + { url = "https://files.pythonhosted.org/packages/a8/f3/2e01294712faa476be9e6ceb49e424c3919e03415ded76d103378a06bb80/jiter-0.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c74a8d93718137c021d9295248a87c2f9fdc0dcafead12d2930bc459ad40f885", size = 324138 }, + { url = "https://files.pythonhosted.org/packages/00/45/50377814f21b6412c7785be27f2dace225af52e0af20be7af899a7e3f264/jiter-0.6.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:40b03b75f903975f68199fc4ec73d546150919cb7e534f3b51e727c4d6ccca5a", size = 367610 }, + { url = "https://files.pythonhosted.org/packages/af/fc/51ba30875125381bfe21a1572c176de1a7dd64a386a7498355fc100decc4/jiter-0.6.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:825651a3f04cf92a661d22cad61fc913400e33aa89b3e3ad9a6aa9dc8a1f5a71", size = 512945 }, + { url = "https://files.pythonhosted.org/packages/69/60/af26168bd4916f9199ed433161e9f8a4eeda581a4e5982560d0f22dd146c/jiter-0.6.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:928bf25eb69ddb292ab8177fe69d3fbf76c7feab5fce1c09265a7dccf25d3991", size = 494963 }, + { url = "https://files.pythonhosted.org/packages/f3/2f/4f3cc5c9067a6fd1020d3c4365546535a69ed77da7fba2bec24368f3662c/jiter-0.6.1-cp313-none-win32.whl", hash = "sha256:352cd24121e80d3d053fab1cc9806258cad27c53cad99b7a3cac57cf934b12e4", size = 196869 }, + { url = "https://files.pythonhosted.org/packages/7a/fc/8709ee90837e94790d8b50db51c7b8a70e86e41b2c81e824c20b0ecfeba7/jiter-0.6.1-cp313-none-win_amd64.whl", hash = "sha256:be7503dd6f4bf02c2a9bacb5cc9335bc59132e7eee9d3e931b13d76fd80d7fda", size = 198919 }, +] + +[[package]] +name = "local-workspace-provisioning" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "openai" }, +] + +[package.metadata] +requires-dist = [{ name = "openai", specifier = "==1.52.1" }] + +[[package]] +name = "openai" +version = "1.52.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "distro" }, + { name = "httpx" }, + { name = "jiter" }, + { name = "pydantic" }, + { name = "sniffio" }, + { name = "tqdm" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/80/ac/54c76352d493866637756b7c0ecec44f0b5bafb8fe753d98472cf6cfe4ce/openai-1.52.1.tar.gz", hash = "sha256:383b96c7e937cbec23cad5bf5718085381e4313ca33c5c5896b54f8e1b19d144", size = 310069 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/31/28a83e124e9f9dd04c83b5aeb6f8b1770f45addde4dd3d34d9a9091590ad/openai-1.52.1-py3-none-any.whl", hash = "sha256:f23e83df5ba04ee0e82c8562571e8cb596cd88f9a84ab783e6c6259e5ffbfb4a", size = 386945 }, +] + +[[package]] +name = "pydantic" +version = "2.9.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a9/b7/d9e3f12af310e1120c21603644a1cd86f59060e040ec5c3a80b8f05fae30/pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f", size = 769917 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/e4/ba44652d562cbf0bf320e0f3810206149c8a4e99cdbf66da82e97ab53a15/pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12", size = 434928 }, +] + +[[package]] +name = "pydantic-core" +version = "2.23.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e2/aa/6b6a9b9f8537b872f552ddd46dd3da230367754b6f707b8e1e963f515ea3/pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863", size = 402156 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/74/7b/8e315f80666194b354966ec84b7d567da77ad927ed6323db4006cf915f3f/pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231", size = 1856459 }, + { url = "https://files.pythonhosted.org/packages/14/de/866bdce10ed808323d437612aca1ec9971b981e1c52e5e42ad9b8e17a6f6/pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee", size = 1770007 }, + { url = "https://files.pythonhosted.org/packages/dc/69/8edd5c3cd48bb833a3f7ef9b81d7666ccddd3c9a635225214e044b6e8281/pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87", size = 1790245 }, + { url = "https://files.pythonhosted.org/packages/80/33/9c24334e3af796ce80d2274940aae38dd4e5676298b4398eff103a79e02d/pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8", size = 1801260 }, + { url = "https://files.pythonhosted.org/packages/a5/6f/e9567fd90104b79b101ca9d120219644d3314962caa7948dd8b965e9f83e/pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327", size = 1996872 }, + { url = "https://files.pythonhosted.org/packages/2d/ad/b5f0fe9e6cfee915dd144edbd10b6e9c9c9c9d7a56b69256d124b8ac682e/pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2", size = 2661617 }, + { url = "https://files.pythonhosted.org/packages/06/c8/7d4b708f8d05a5cbfda3243aad468052c6e99de7d0937c9146c24d9f12e9/pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36", size = 2071831 }, + { url = "https://files.pythonhosted.org/packages/89/4d/3079d00c47f22c9a9a8220db088b309ad6e600a73d7a69473e3a8e5e3ea3/pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126", size = 1917453 }, + { url = "https://files.pythonhosted.org/packages/e9/88/9df5b7ce880a4703fcc2d76c8c2d8eb9f861f79d0c56f4b8f5f2607ccec8/pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e", size = 1968793 }, + { url = "https://files.pythonhosted.org/packages/e3/b9/41f7efe80f6ce2ed3ee3c2dcfe10ab7adc1172f778cc9659509a79518c43/pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24", size = 2116872 }, + { url = "https://files.pythonhosted.org/packages/63/08/b59b7a92e03dd25554b0436554bf23e7c29abae7cce4b1c459cd92746811/pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84", size = 1738535 }, + { url = "https://files.pythonhosted.org/packages/88/8d/479293e4d39ab409747926eec4329de5b7129beaedc3786eca070605d07f/pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9", size = 1917992 }, + { url = "https://files.pythonhosted.org/packages/ad/ef/16ee2df472bf0e419b6bc68c05bf0145c49247a1095e85cee1463c6a44a1/pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc", size = 1856143 }, + { url = "https://files.pythonhosted.org/packages/da/fa/bc3dbb83605669a34a93308e297ab22be82dfb9dcf88c6cf4b4f264e0a42/pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd", size = 1770063 }, + { url = "https://files.pythonhosted.org/packages/4e/48/e813f3bbd257a712303ebdf55c8dc46f9589ec74b384c9f652597df3288d/pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05", size = 1790013 }, + { url = "https://files.pythonhosted.org/packages/b4/e0/56eda3a37929a1d297fcab1966db8c339023bcca0b64c5a84896db3fcc5c/pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d", size = 1801077 }, + { url = "https://files.pythonhosted.org/packages/04/be/5e49376769bfbf82486da6c5c1683b891809365c20d7c7e52792ce4c71f3/pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510", size = 1996782 }, + { url = "https://files.pythonhosted.org/packages/bc/24/e3ee6c04f1d58cc15f37bcc62f32c7478ff55142b7b3e6d42ea374ea427c/pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6", size = 2661375 }, + { url = "https://files.pythonhosted.org/packages/c1/f8/11a9006de4e89d016b8de74ebb1db727dc100608bb1e6bbe9d56a3cbbcce/pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b", size = 2071635 }, + { url = "https://files.pythonhosted.org/packages/7c/45/bdce5779b59f468bdf262a5bc9eecbae87f271c51aef628d8c073b4b4b4c/pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327", size = 1916994 }, + { url = "https://files.pythonhosted.org/packages/d8/fa/c648308fe711ee1f88192cad6026ab4f925396d1293e8356de7e55be89b5/pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6", size = 1968877 }, + { url = "https://files.pythonhosted.org/packages/16/16/b805c74b35607d24d37103007f899abc4880923b04929547ae68d478b7f4/pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f", size = 2116814 }, + { url = "https://files.pythonhosted.org/packages/d1/58/5305e723d9fcdf1c5a655e6a4cc2a07128bf644ff4b1d98daf7a9dbf57da/pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769", size = 1738360 }, + { url = "https://files.pythonhosted.org/packages/a5/ae/e14b0ff8b3f48e02394d8acd911376b7b66e164535687ef7dc24ea03072f/pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5", size = 1919411 }, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235 }, +] + +[[package]] +name = "tqdm" +version = "4.66.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "platform_system == 'Windows'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/58/83/6ba9844a41128c62e810fddddd72473201f3eacde02046066142a2d96cc5/tqdm-4.66.5.tar.gz", hash = "sha256:e1020aef2e5096702d8a025ac7d16b1577279c9d63f8375b63083e9a5f0fcbad", size = 169504 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/48/5d/acf5905c36149bbaec41ccf7f2b68814647347b72075ac0b1fe3022fdc73/tqdm-4.66.5-py3-none-any.whl", hash = "sha256:90279a3770753eafc9194a0364852159802111925aa30eb3f9d85b0e805ac7cd", size = 78351 }, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438 }, +]