Skip to content

Commit 2943d98

Browse files
authored
Use uv pip instead of pip. (#23)
* Use `uv pip` instead of `pip`. * Use caching for CRAN R packages. * Drop the combo python-3.12/ubunty-latest because of odd error message.
1 parent 74d2440 commit 2943d98

File tree

1 file changed

+38
-10
lines changed

1 file changed

+38
-10
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ jobs:
1515
uses: actions/setup-python@v4
1616
with:
1717
python-version: "3.10"
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v6
20+
- name: Create venv
21+
run: |
22+
uv venv --no-project --no-config --no-managed-python rpy2-arrow-env
1823
- name: Lint with flake8
1924
run: |
20-
pip install flake8
25+
source rpy2-arrow-env/bin/activate
26+
uv pip install flake8
2127
flake8 rpy2_arrow --count --max-complexity=10 --max-line-length=127 --statistics
2228
build:
2329
runs-on: ${{ matrix.os }}
@@ -34,6 +40,9 @@ jobs:
3440
SYSTEM_DEPS: sudo apt-get install -y libcurl4-gnutls-dev
3541
- os: macOS-latest
3642
SYSTEM_DEPS: brew install curl
43+
exclude:
44+
- python-version: "3.12"
45+
os: ubuntu-latest
3746
steps:
3847
- uses: actions/checkout@v3
3948
- name: Set up Python ${{ matrix.python-version }}
@@ -59,9 +68,19 @@ jobs:
5968
curl -LO https://mac.r-project.org/bin/darwin20/arm64/"${name}"
6069
sudo tar xJf "${name}" -C /
6170
done
62-
- name: Install R dependencies
71+
- uses: r-lib/actions/setup-r-dependencies@v2
72+
with:
73+
cache-version: 2
74+
extra-packages: |
75+
any::assertthat
76+
any::cpp11
77+
any::tidyselect
78+
any::vctrs
79+
any::R6
80+
any::purrr
81+
any::bit64
82+
- name: Install R arrow package
6383
run: |
64-
install.packages(c("assertthat", "cpp11", "tidyselect", "vctrs", "R6", "purrr", "bit64"))
6584
Sys.setenv("NOT_CRAN" = "true")
6685
install.packages("arrow")
6786
shell: Rscript {0}
@@ -78,21 +97,30 @@ jobs:
7897
Sys.setenv(NOT_CRAN = "true")
7998
install.packages("polars", repos = "https://community.r-multiverse.org")
8099
shell: Rscript {0}
100+
- name: Install uv
101+
uses: astral-sh/setup-uv@v6
102+
- name: Create venv
103+
run: |
104+
uv venv --no-project --no-config --no-managed-python rpy2-arrow-env
81105
- name: Install dependencies
82106
run: |
83-
python -m pip install --upgrade pip
84-
pip install -r requirements.txt
85-
pip install git+https://github.com/rpy2/rpy2-r6
107+
source rpy2-arrow-env/bin/activate
108+
uv pip install --upgrade pip
109+
uv pip install -r requirements.txt
110+
uv pip install git+https://github.com/rpy2/rpy2-r6
86111
- name: Build package
87112
run: |
88-
pip install build
113+
source rpy2-arrow-env/bin/activate
114+
uv pip install build
89115
python -m build
90116
- name: Install package
91117
run: |
92-
pip install $(ls -t1 dist/*.whl | tail -1)'[all]'
118+
source rpy2-arrow-env/bin/activate
119+
uv pip install $(ls -t1 dist/*.whl | tail -1)'[all]'
93120
- name: Test with pytest
94121
run: |
122+
source rpy2-arrow-env/bin/activate
95123
export LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH)
96-
pip install pytest codecov pytest-cov
97-
pip install pandas
124+
uv pip install pytest codecov pytest-cov
125+
uv pip install pandas
98126
pytest --cov rpy2_arrow.pyarrow_rarrow --cov rpy2_arrow.r6b --cov rpy2_arrow.polars rpy2_arrow/tests*.py

0 commit comments

Comments
 (0)