Skip to content

Commit e389c92

Browse files
committed
Enhance Python 3.13 installation process in workflow and formula
- Added linking for Python 3.13 in the workflow - Improved detection logic for Python 3.13 in the formula with additional checks and logging
1 parent 91e2f59 commit e389c92

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/brew.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ jobs:
3232
- name: Install Python 3.13
3333
run: |
3434
brew install [email protected]
35+
brew link --overwrite [email protected]
3536
python3 --version
3637
brew --prefix [email protected]
38+
ls -la $(brew --prefix [email protected])/bin
3739
3840
- name: Style check
3941
run: |

Formula/ssh-studio.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,27 @@ def install
3131
ENV.prepend_path "PATH", libexec/"bin"
3232

3333
python3 = Formula["[email protected]"]
34+
ohai "Checking for Python 3.13..."
35+
ohai "opt_bin: #{python3.opt_bin}"
36+
3437
python_bin = if (python3.opt_bin/"python3").exist?
3538
python3.opt_bin/"python3"
39+
elsif (python3.opt_bin/"python3.13").exist?
40+
python3.opt_bin/"python3.13"
3641
else
3742
prefix = `brew --prefix [email protected] 2>/dev/null`.strip
38-
Pathname.new("#{prefix}/bin/python3") unless prefix.empty?
43+
ohai "brew --prefix: #{prefix}"
44+
if !prefix.empty?
45+
if File.exist?("#{prefix}/bin/python3")
46+
Pathname.new("#{prefix}/bin/python3")
47+
elsif File.exist?("#{prefix}/bin/python3.13")
48+
Pathname.new("#{prefix}/bin/python3.13")
49+
end
50+
end
3951
end
4052

53+
ohai "Selected python_bin: #{python_bin}" if python_bin
54+
4155
unless python_bin&.exist?
4256
odie "Python 3.13 not found. Please ensure [email protected] is installed: brew install [email protected]"
4357
end

0 commit comments

Comments
 (0)