Skip to content

Commit

Permalink
uv
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiristseng committed Aug 22, 2024
1 parent 81d6ae2 commit ebe8a67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ env:
NBCONVERT_JOBS: '4'
LITERATE_PROC: '3'
ALLOWERRORS: 'false'
CACHE_NUM: '1'
CACHE_NUM: '2'
JULIA_CONDAPKG_BACKEND: 'Null'
JULIA_CI: 'true'
JULIA_CPU_TARGET: 'generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1);znver3,clone_all'
NBCACHE: '.cache'
UV_SYSTEM_PYTHON: 1

jobs:
CI:
Expand All @@ -31,22 +33,10 @@ jobs:
id: setup-python
with:
python-version: '3.x'
- name: Cache python venv
uses: actions/cache@v4
if: ${{ contains(runner.name, 'GitHub Actions') }}
id: cache-venv
with:
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
path: .venv
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install Python dependencies
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
echo "${VIRTUAL_ENV}/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=${VIRTUAL_ENV}" >> $GITHUB_ENV
echo "PYTHON=${VIRTUAL_ENV}/bin/python" >> $GITHUB_ENV
echo "JULIA_PYTHONCALL_EXE=${VIRTUAL_ENV}/bin/python">> $GITHUB_ENV
run: uv pip install -r requirements.txt
- name: Cache executed notebooks
uses: actions/cache@v4
id: cache-nb
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
linkcheck:
env:
DIR: 'docs'
UV_SYSTEM_PYTHON: 1
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -45,19 +46,9 @@ jobs:
id: setup-python
with:
python-version: '3.x'
- name: Cache python venv
uses: actions/cache@v4
if: ${{ contains(runner.name, 'GitHub Actions') }}
id: cache-venv
with:
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
path: .venv
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install Python dependencies
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
echo "${VIRTUAL_ENV}/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=${VIRTUAL_ENV}" >> $GITHUB_ENV
run: uv pip install -r requirements.txt
- name: Build website
run: jupyter-book build ${DIR} --builder linkcheck

0 comments on commit ebe8a67

Please sign in to comment.