Skip to content

Commit

Permalink
Modify GitHub CI config to install uv via pipx.
Browse files Browse the repository at this point in the history
This should properly fix GH-83.
  • Loading branch information
dpranke committed Nov 11, 2024
1 parent 68b92fb commit 8f9db20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Python package

on:
on:
push:
pull_request:
branches:
Expand All @@ -20,5 +20,8 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: |
pipx install uv
- name: Run tests
run: python run tests
14 changes: 5 additions & 9 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ def main(argv):
args = parser.parse_args(argv)

global uv_path
if args.func != run_tests:
# TODO(GH-83): Figure out how to get `uv` installed in the GitHub CI.
uv_path = shutil.which('uv')
if uv_path is None:
print('You need to have `uv` installed to run this script.')
sys.exit(2)
uv_path = shutil.which('uv')
if uv_path is None:
print('You need to have `uv` installed to run this script.')
sys.exit(2)

global run_cmd
if 'VIRTUAL_ENV' in os.environ:
Expand Down Expand Up @@ -292,9 +290,7 @@ def run_regen(args):

def run_tests(args):
del args
# TODO(GH-83): Figure out how to get `uv` installed on the GitHub CI.
# call(run_cmd + ['-m', 'unittest', 'discover', '-p', '*_test.py'])
call([sys.executable, '-m', 'unittest', 'discover', '-p', '*_test.py'])
call(run_cmd + ['-m', 'unittest', 'discover', '-p', '*_test.py'])


def _gen_parser():
Expand Down

0 comments on commit 8f9db20

Please sign in to comment.