Skip to content

Commit

Permalink
MAINT: Use uv pip to install packages
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Sep 20, 2024
1 parent 737611e commit aece8d8
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 62 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
Expand All @@ -71,10 +79,7 @@ jobs:
run: |
ls -la
ls -la doc
pip list
- name: Get Commit Title
run: |
uv pip list
- name: Build docs
shell: bash
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,17 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
uses: actions/setup-python@v5

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Check for semantic version tag
id: check-tag
Expand Down Expand Up @@ -71,8 +79,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
run: python -m pip install build
run: uv pip install build

- name: Build a wheel and a source tarball
run: make dist
Expand Down
54 changes: 36 additions & 18 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,43 @@ jobs:
strategy:
matrix:
python-version: ["3.10", 3.12]

resolution: highest
include:
- python-version: "3:10"
resolution: lowest-direct
steps:
- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
# Install as an editable so that the coverage path
# is predicable
pip install -e ".[extra,test]"
uv pip install --resolution=${{ matrix.resolution }} -e ".[extra,test]"
- name: Environment Information
shell: bash
run: |
pip list
uv pip list
- name: Run Tests
shell: bash
run: |
coverage erase
make test
- name: List Directory
shell: bash
run: |
ls -la
Expand Down Expand Up @@ -93,14 +101,19 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install ruff
run: uv tool install ruff

- name: Environment Information
shell: bash
run: pip list
run: uv pip list

- name: Check lint with Ruff
shell: bash
Expand Down Expand Up @@ -132,17 +145,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install ".[extra, typing]"
uv pip install ".[extra, typing]"
- name: Environment Information
shell: bash
run: pip list
run: uv pip list

- name: Run Tests
shell: bash
run: make typecheck

call-build-documentation:
Expand Down
111 changes: 78 additions & 33 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,29 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install --upgrade pip
pip install ".[extra,test]"
pip install --upgrade git+https://github.com/matplotlib/matplotlib
uv pip install ".[extra,test]"
uv pip install --upgrade git+https://github.com/matplotlib/matplotlib
- name: Environment Information
shell: bash
run: |
pip list
uv pip list
- name: Run Tests
shell: bash
run: |
make test
Expand All @@ -58,21 +63,29 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install --upgrade pip
pip install ".[extra,test]"
pip install --upgrade git+https://github.com/pandas-dev/pandas
uv pip install ".[extra,test]"
uv pip install --upgrade git+https://github.com/pandas-dev/pandas
- name: Environment Information
shell: bash
run: |
pip list
uv pip list
# to do: think about catching deprecations earlier
- name: Run Tests
Expand Down Expand Up @@ -111,21 +124,29 @@ jobs:
with:
ref: ${{ steps.latestrelease.outputs.latestrelease }}

- uses: actions/setup-python@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install --upgrade pip
pip install --upgrade git+https://github.com/matplotlib/matplotlib
pip install ".[extra,test]"
uv pip install --upgrade git+https://github.com/matplotlib/matplotlib
uv pip install ".[extra,test]"
- name: Environment Information
shell: bash
run: |
pip list
uv pip list
- name: Run Tests
shell: bash
Expand Down Expand Up @@ -163,21 +184,29 @@ jobs:
with:
ref: ${{ steps.latestrelease.outputs.latestrelease }}

- uses: actions/setup-python@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install --upgrade pip
pip install --upgrade git+https://github.com/pandas-dev/pandas
pip install ".[extra,test]"
uv pip install --upgrade git+https://github.com/pandas-dev/pandas
uv pip install ".[extra,test]"
- name: Environment Information
shell: bash
run: |
pip list
uv pip list
# to do: think about catching deprecations earlier
- name: Run Tests
Expand All @@ -203,21 +232,29 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install --upgrade pip
pip install ".[extra,typing]"
pip install --upgrade git+https://github.com/matplotlib/matplotlib
uv pip install ".[extra,typing]"
uv pip install --upgrade git+https://github.com/matplotlib/matplotlib
- name: Environment Information
shell: bash
run: |
pip list
uv pip list
- name: Run Tests
shell: bash
Expand All @@ -235,21 +272,29 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install --upgrade pip
pip install ".[extra,typing]"
pip install --upgrade git+https://github.com/pandas-dev/pandas
uv pip install ".[extra,typing]"
uv pip install --upgrade git+https://github.com/pandas-dev/pandas
- name: Environment Information
shell: bash
run: |
pip list
uv pip list
# to do: think about catching deprecations earlier
- name: Run Tests
Expand Down
Loading

0 comments on commit aece8d8

Please sign in to comment.