Skip to content

Commit

Permalink
Merge pull request #7 from kbayliss/fix/6-without-pip
Browse files Browse the repository at this point in the history
Exclude `without_pip` when using python3.12+
  • Loading branch information
RealOrangeOne authored Nov 20, 2024
2 parents 6109bb4 + ca1eb8e commit 42d3476
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install custom tap
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Add our custom tap
run: |
mkdir -p /usr/local/Homebrew/Library/Taps/$GITHUB_REPOSITORY
cp -r * /usr/local/Homebrew/Library/Taps/$GITHUB_REPOSITORY/
ln -s "$(pwd)" "$(brew --repository)/Library/Taps/$GITHUB_REPOSITORY"
- name: Install ${{ matrix.formula }}
run: brew install $GITHUB_REPOSITORY/${{ matrix.formula }}
- name: Test ${{ matrix.formula }}
Expand Down
12 changes: 9 additions & 3 deletions Formula/buckup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ class Buckup < Formula
depends_on "python@3"

def install
venv = virtualenv_create(libexec, "python3", without_pip: false)
system libexec/"bin/pip", "install", buildpath
system libexec/"bin/pip", "uninstall", "-y", "buckup"
# without_pip is deprecated in python 3.12+, so we only pass it for older versions
if Language::Python.major_minor_version("python3") >= "3.12"
venv = virtualenv_create(libexec, "python3")
system libexec/"bin/python", "-m", "ensurepip"
else
venv = virtualenv_create(libexec, "python3", without_pip: false)
end
system libexec/"bin/python", "-m", "pip", "install", buildpath
system libexec/"bin/python", "-m", "pip", "uninstall", "-y", "buckup"
venv.pip_install_and_link buildpath
end

Expand Down
12 changes: 9 additions & 3 deletions Formula/heroku-audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ class HerokuAudit < Formula
depends_on "python@3"

def install
venv = virtualenv_create(libexec, "python3", without_pip: false)
system libexec/"bin/pip", "install", buildpath
system libexec/"bin/pip", "uninstall", "-y", "heroku-audit"
# without_pip is deprecated in python 3.12+, so we only pass it for older versions
if Language::Python.major_minor_version("python3") >= "3.12"
venv = virtualenv_create(libexec, "python3")
system libexec/"bin/python", "-m", "ensurepip"
else
venv = virtualenv_create(libexec, "python3", without_pip: false)
end
system libexec/"bin/python", "-m", "pip", "install", buildpath
system libexec/"bin/python", "-m", "pip", "uninstall", "-y", "heroku-audit"
venv.pip_install_and_link buildpath
end

Expand Down

0 comments on commit 42d3476

Please sign in to comment.