Skip to content

Commit

Permalink
use uv instead of pyenv (#238)
Browse files Browse the repository at this point in the history
* remove `pyenv` related files and settings

* move `rust.sh` from `~/.local/bin/server` to `~/.local/bin/common`

* install `uv`

* update

* update

* update
  • Loading branch information
shunk031 authored Nov 5, 2024
1 parent a342a98 commit c914d3b
Show file tree
Hide file tree
Showing 19 changed files with 78 additions and 257 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ jobs:
run: |
./scripts/run_unit_test.sh
- name: Set flag for codecov
- name: Setup for codecov
run: |
if [ "${OS}" == "macos-14" ]; then
echo "flags=${OS}" >> $GITHUB_ENV
brew install gpg
elif [ "${OS}" == "ubuntu-latest" ]; then
echo "flags=${OS}-${SYSTEM}" >> $GITHUB_ENV
sudo apt-get install -y gpg
else
echo "${OS} and ${SYSTEM} are not supported" >&2
exit 1
Expand Down
3 changes: 0 additions & 3 deletions home/.chezmoiscripts/macos/run_once_09-install-pyenv.sh.tmpl

This file was deleted.

8 changes: 0 additions & 8 deletions home/.chezmoiscripts/ubuntu/run_once_09-install-pyenv.sh.tmpl

This file was deleted.

16 changes: 8 additions & 8 deletions home/.chezmoitemplates/chezmoiexternal.d/common.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
".pyenv":
type: "git-repo"
url: "https://github.com/pyenv/pyenv.git"
refreshPeriod: "168h"
# ".pyenv":
# type: "git-repo"
# url: "https://github.com/pyenv/pyenv.git"
# refreshPeriod: "168h"

".pyenv/plugins/pyenv-virtualenv":
type: "git-repo"
url: "https://github.com/pyenv/pyenv-virtualenv"
refreshPeriod: "168h"
# ".pyenv/plugins/pyenv-virtualenv":
# type: "git-repo"
# url: "https://github.com/pyenv/pyenv-virtualenv"
# refreshPeriod: "168h"
4 changes: 0 additions & 4 deletions home/dot_bash/client/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ if ! shopt -oq posix; then
fi
fi

# # for pyenv and pyenv-virtualenv
# # shellcheck source=../../dot_local/bin/server/pyenv.sh
# source "${HOME%/}/.local/bin/server/pyenv.sh"

# # for CUDA
# # shellcheck source=../../dot_local/bin/server/cuda.sh
# source "${HOME%/}/.local/bin/server/cuda.sh"
Expand Down
4 changes: 3 additions & 1 deletion home/dot_config/iterm2/com.googlecode.iterm2.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
<true/>
<key>BootstrapDaemon</key>
<false/>
<key>CommandSelection</key>
<true/>
<key>Default Bookmark Guid</key>
<string>69D4B322-B11C-4B2D-9C86-8A6075632071</string>
<string>00000000-1111-2222-3333-444444444444</string>
<key>DimInactiveSplitPanes</key>
<false/>
<key>DisableWindowSizeSnap</key>
Expand Down
2 changes: 1 addition & 1 deletion home/dot_config/powerlevel10k/p10k.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
os_icon
context
dir
pyenv
virtualenv
# =========================[ Line #2 ]=========================
newline # \n
)
Expand Down
20 changes: 10 additions & 10 deletions home/dot_config/sheldon/plugins.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ apply = ['defer']
[plugins.starship]
inline = 'eval "$(starship init zsh)"'

[plugins.gpg]
local = '~/.local/bin/common'
use = ['gpg.sh']
apply = ['source']

[plugins.rust]
local = '~/.local/bin/common'
use = ['rust.sh']
apply = ['source']

[plugins.alias]
local = '~/.local/bin/server'
use = ['aliases.sh']
Expand All @@ -50,11 +60,6 @@ local = '~/.config/fzf'
use = ['config.zsh']
apply = ['defer']

[plugins.pyenv]
local = '~/.local/bin/server'
use = ['pyenv.sh']
apply = ['defer']

[plugins.cuda]
local = '~/.local/bin/server'
use = ['cuda.sh']
Expand All @@ -65,11 +70,6 @@ local = "~/.local/bin/server"
use = ['ssh_agent.sh']
apply = ['source']

[plugins.gpg]
local = '~/.local/bin/common'
use = ['gpg.sh']
apply = ['source']

[plugins.history]
local = '~/.local/bin/server'
use = ['history.zsh']
Expand Down
File renamed without changes.
41 changes: 0 additions & 41 deletions home/dot_local/bin/server/prompt.sh

This file was deleted.

22 changes: 0 additions & 22 deletions home/dot_local/bin/server/pyenv.sh

This file was deleted.

2 changes: 1 addition & 1 deletion home/dot_zsh/client/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ source-safe "${HOME}/.local/bin/client/golang.sh"
# rust
#

source-safe "${HOME}/.local/bin/client/rust.sh"
source-safe "${HOME}/.local/bin/common/rust.sh"

#
# GPG
Expand Down
28 changes: 28 additions & 0 deletions install/common/uv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -Eeuo pipefail

if [ "${DOTFILES_DEBUG:-}" ]; then
set -x
fi

function install_uv() {
# https://docs.astral.sh/uv/getting-started/installation/#standalone-installer
curl -LsSf https://astral.sh/uv/install.sh | sh
}

function uninstall_uv() {
# https://docs.astral.sh/uv/getting-started/installation/#uninstallation
uv cache clean
rm -rf "$(uv python dir)"
rm -rf "$(uv tool dir)"
rm -f "${HOME}/.cargo/bin/uv" "${HOME}/.cargo/bin/uvx"
}

function main() {
install_uv
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main
fi
19 changes: 0 additions & 19 deletions install/macos/common/pyenv.sh

This file was deleted.

41 changes: 0 additions & 41 deletions install/ubuntu/common/pyenv.sh

This file was deleted.

1 change: 0 additions & 1 deletion tests/files/common.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
directories_exists=(
"${HOME}/.config/fzf"
"${HOME}/.spacemacs.d"
"${HOME}/.pyenv"
)
for directory in "${directories_exists[@]}"; do
echo "Checking ${directory}"
Expand Down
22 changes: 22 additions & 0 deletions tests/install/common/uv.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bats

readonly SCRIPT_PATH="./install/common/uv.sh"

function setup() {
source "${SCRIPT_PATH}"
}

function teardown() {
uninstall_uv

# reset PATH
PATH=$(getconf PATH)
export PATH
}

@test "[common] uv" {
DOTFILES_DEBUG=1 bash "${SCRIPT_PATH}"

export PATH="${PATH}:${HOME}/.cargo/bin"
[ -x "$(command -v uv)" ]
}
24 changes: 0 additions & 24 deletions tests/install/macos/common/pyenv.bats

This file was deleted.

Loading

0 comments on commit c914d3b

Please sign in to comment.