Skip to content

Commit 42d3476

Browse files
Merge pull request #7 from kbayliss/fix/6-without-pip
Exclude `without_pip` when using python3.12+
2 parents 6109bb4 + ca1eb8e commit 42d3476

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: Install custom tap
23+
- name: Set up Homebrew
24+
uses: Homebrew/actions/setup-homebrew@master
25+
- name: Add our custom tap
2426
run: |
25-
mkdir -p /usr/local/Homebrew/Library/Taps/$GITHUB_REPOSITORY
26-
cp -r * /usr/local/Homebrew/Library/Taps/$GITHUB_REPOSITORY/
27+
ln -s "$(pwd)" "$(brew --repository)/Library/Taps/$GITHUB_REPOSITORY"
2728
- name: Install ${{ matrix.formula }}
2829
run: brew install $GITHUB_REPOSITORY/${{ matrix.formula }}
2930
- name: Test ${{ matrix.formula }}

Formula/buckup.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ class Buckup < Formula
1010
depends_on "python@3"
1111

1212
def install
13-
venv = virtualenv_create(libexec, "python3", without_pip: false)
14-
system libexec/"bin/pip", "install", buildpath
15-
system libexec/"bin/pip", "uninstall", "-y", "buckup"
13+
# without_pip is deprecated in python 3.12+, so we only pass it for older versions
14+
if Language::Python.major_minor_version("python3") >= "3.12"
15+
venv = virtualenv_create(libexec, "python3")
16+
system libexec/"bin/python", "-m", "ensurepip"
17+
else
18+
venv = virtualenv_create(libexec, "python3", without_pip: false)
19+
end
20+
system libexec/"bin/python", "-m", "pip", "install", buildpath
21+
system libexec/"bin/python", "-m", "pip", "uninstall", "-y", "buckup"
1622
venv.pip_install_and_link buildpath
1723
end
1824

Formula/heroku-audit.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ class HerokuAudit < Formula
1010
depends_on "python@3"
1111

1212
def install
13-
venv = virtualenv_create(libexec, "python3", without_pip: false)
14-
system libexec/"bin/pip", "install", buildpath
15-
system libexec/"bin/pip", "uninstall", "-y", "heroku-audit"
13+
# without_pip is deprecated in python 3.12+, so we only pass it for older versions
14+
if Language::Python.major_minor_version("python3") >= "3.12"
15+
venv = virtualenv_create(libexec, "python3")
16+
system libexec/"bin/python", "-m", "ensurepip"
17+
else
18+
venv = virtualenv_create(libexec, "python3", without_pip: false)
19+
end
20+
system libexec/"bin/python", "-m", "pip", "install", buildpath
21+
system libexec/"bin/python", "-m", "pip", "uninstall", "-y", "heroku-audit"
1622
venv.pip_install_and_link buildpath
1723
end
1824

0 commit comments

Comments
 (0)