Skip to content

Commit

Permalink
pip -> uv (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
dakinggg authored Aug 30, 2024
1 parent 5433bd4 commit d3b44d1
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 25 deletions.
11 changes: 9 additions & 2 deletions .github/actions/code-quality/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ runs:
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
- name: Activate virtualenv
shell: bash
run: |
python -m venv ../.venv
. ../.venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup
shell: bash
run: |
set -ex
python -m pip install --upgrade pip wheel
python -m pip install --upgrade .${{ inputs.pip_deps }}
pip install uv
uv pip install --upgrade --system pip wheel
uv pip install --upgrade --system .${{ inputs.pip_deps }}
- name: Run checks
shell: bash
run: |
Expand Down
12 changes: 9 additions & 3 deletions .github/actions/coverage/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ inputs:
runs:
using: composite
steps:
- name: Activate virtualenv
shell: bash
run: |
python -m venv .venv
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup
shell: bash
run: |
set -ex
python -m pip install --upgrade pip wheel
pip install coverage[toml]==6.5.0
pip install uv
uv pip install --upgrade pip wheel
uv pip install coverage[toml]==6.5.0
- name: Download artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -20,7 +27,6 @@ runs:
shell: bash
run: |
set -ex
# Flatten the coverage files
# yamllint disable-line rule:line-length
ls ${{ inputs.download-path }} | while read x; do mv ${{ inputs.download-path }}/$x/.coverage .coverage.$x; done
Expand Down
11 changes: 9 additions & 2 deletions .github/actions/pytest-cpu/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,21 @@ runs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Activate virtualenv
shell: bash
run: |
python -m venv .venv
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup
shell: bash
run: |
set -ex
export PATH=/composer-python:$PATH
export COMPOSER_PACKAGE_NAME='${{ inputs.composer_package_name }}'
python -m pip install --upgrade pip wheel
python -m pip install --upgrade .${{ inputs.pip_deps }}
pip install uv
uv pip install --upgrade pip wheel
uv pip install --upgrade .${{ inputs.pip_deps }}
- name: Run Tests
id: tests
shell: bash
Expand Down
22 changes: 8 additions & 14 deletions .github/actions/pytest-gpu/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,18 @@ runs:
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
- name: Cache pip
uses: actions/cache@v3
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Activate virtualenv
shell: bash
run: |
python -m venv .venv
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup MCLI
shell: bash
run: |
set -ex
python -m pip install mosaicml-cli
pip install uv
uv pip install --system mosaicml-cli
mcli version
- name: Submit Run
id: tests
Expand All @@ -98,7 +95,6 @@ runs:
CODE_EVAL_APIKEY: ${{ inputs.code_eval_apikey }}
run: |
set -ex
PR_NUMBER="$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")"
REF_ARGS=""
Expand Down Expand Up @@ -131,7 +127,6 @@ runs:
MOSAICML_API_KEY: ${{ inputs.mcloud_api_key }}
run: |
set -ex
python .github/mcli/follow_mcli_logs.py \
--name '${{ steps.tests.outputs.RUN_NAME }}'
- name: Stop Run if Cancelled
Expand All @@ -141,6 +136,5 @@ runs:
MOSAICML_API_KEY: ${{ inputs.mcloud_api_key }}
run: |
set -ex
python .github/mcli/cancel_mcli_run.py \
--name '${{ steps.tests.outputs.RUN_NAME }}'
13 changes: 10 additions & 3 deletions .github/actions/smoketest/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ runs:
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
- name: Activate virtualenv
shell: bash
run: |
python -m venv .venv
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup
shell: bash
run: |
set -ex
python -m pip install --upgrade pip wheel
python -m pip install --upgrade .
python -m pip install pytest==7.2.1 pytest_codeblocks==0.16.1
pip install uv
uv pip install --upgrade pip wheel
uv pip install --upgrade .
uv pip install pytest==7.2.1 pytest_codeblocks==0.16.1
- name: Run checks
shell: bash
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/mcli/mcli_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@
export COMPOSER_PACKAGE_NAME='{args.pip_package_name}'
pip install --upgrade --user .{args.pip_deps}
python -m venv --system-site-packages .venv
. .venv/bin/activate
pip install uv
uv pip install --upgrade --no-build-isolation .{args.pip_deps}
export COMMON_ARGS="-v --durations=20 -m '{args.pytest_markers}' {clear_tmp_path_flag}"
'''
Expand Down

0 comments on commit d3b44d1

Please sign in to comment.