From 94d5164e608d0552ddbbb4171904b245d845486e Mon Sep 17 00:00:00 2001 From: Hassan Kibirige Date: Sat, 21 Sep 2024 01:28:12 +0300 Subject: [PATCH] MAINT: Use uv pip to install packages --- .github/workflows/documentation.yml | 17 +++-- .github/workflows/release.yml | 26 +++++-- .github/workflows/testing.yml | 57 ++++++++------ .github/workflows/weekly.yml | 111 ++++++++++++++++++---------- Makefile | 10 +-- 5 files changed, 139 insertions(+), 82 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9ffb682f9..9aeb596d7 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -51,10 +51,16 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - name: Install Quarto uses: quarto-dev/quarto-actions/setup@v2 @@ -71,10 +77,7 @@ jobs: run: | ls -la ls -la doc - pip list - - - name: Get Commit Title - run: | + uv pip list - name: Build docs shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdebe02b5..13fdd178d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,10 +28,16 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: Setup Python + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} - uses: actions/setup-python@v5 + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - name: Check for semantic version tag id: check-tag @@ -66,13 +72,19 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 89e82ee73..14e313810 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -29,30 +29,33 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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 -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 @@ -88,19 +91,22 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" - - name: Install Packages - shell: bash + - name: Install python ${{ matrix.python-version }} run: | - pip install ruff + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate + + - name: Install Packages + run: uv tool install ruff - name: Environment Information - shell: bash - run: pip list + run: uv pip list - name: Check lint with Ruff shell: bash @@ -127,22 +133,25 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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: diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 39406b240..cc3286a09 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -19,24 +19,27 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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 @@ -58,21 +61,27 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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 @@ -111,21 +120,27 @@ jobs: with: ref: ${{ steps.latestrelease.outputs.latestrelease }} - - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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 @@ -163,21 +178,27 @@ jobs: with: ref: ${{ steps.latestrelease.outputs.latestrelease }} - - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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 @@ -203,21 +224,27 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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 @@ -235,21 +262,27 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install a specific version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ matrix.python-version }} + version: "0.4.x" + + - name: Install python ${{ matrix.python-version }} + run: | + uv python install ${{ matrix.python-version }} + uv venv -p ${{ matrix.python-version }} + source .venv/bin/activate - 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 diff --git a/Makefile b/Makefile index 990c13dd4..3e9c55a0f 100644 --- a/Makefile +++ b/Makefile @@ -87,16 +87,16 @@ dist: clean build: dist install: clean - pip install ".[extra]" + uv pip install ".[extra]" doc-deps: - pip install -e ".[doc]" - pip install -r requirements/doc.txt + uv pip install -e ".[doc]" + uv pip install -r requirements/doc.txt cd doc && make deps develop: clean-cache - pip install -e ".[all]" + uv pip install -e ".[all]" develop-update: clean-cache - pip install --upgrade -e ".[all]" + uv pip install --upgrade -e ".[all]" pre-commit autoupdate