Skip to content

Commit 213c570

Browse files
Use system Python in CI for uv
1 parent fe25474 commit 213c570

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,13 @@ jobs:
1414
- name: Setup uv and Handle Its Cache
1515
uses: hynek/setup-cached-uv@v2.0.0
1616

17-
- name: Intall Python and create virtualenv
18-
run: |
19-
uv python install
20-
uv venv
21-
22-
- name: Activate Python virtualenv
23-
uses: knicknic/os-specific-run@v1
17+
- name: Install Python
18+
uses: actions/setup-python@v2
2419
with:
25-
linux: source .venv/bin/activate
26-
macos: source .venv/bin/activate
27-
windows: .\.venv\Scripts\active
20+
python-version: ${{ matrix.python-version }}
2821

2922
- name: Install Dependencies
30-
run: uv sync
23+
run: uv sync --python-preference system
3124

3225
- name: Run pytest
3326
uses: pavelzw/pytest-action@v2.2.0
@@ -36,3 +29,4 @@ jobs:
3629
strategy:
3730
matrix:
3831
os: [ubuntu-latest, macos-latest, windows-latest]
32+
python-version: [3.12]

doc/philosophy/introspection.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,8 @@ necessarily listed chronologically):
2828
- Ran `uv init --name usethis`.
2929
- Ran `uv python pin 3.12.4`.
3030

31-
## Local development configuration
32-
33-
- Cloned the repo from GitHub.
34-
- Ran `uv sync`.
35-
- Set up git username, email, and signing key.
36-
37-
## Set up tests
31+
## Add GitHub actions CI
3832

39-
- Ran `uv add pytest`.
40-
- Created a tests folder.
41-
- Added a trivial test module `test_nothing.py`.
42-
- Add a trivial test `test_pass` to the test module.
43-
- Confirm pytest is working with `pytest tests` in the CLI.
4433
- Create a GitHub workflow file for CI manually in `.github/workflows/ci.yml`.
4534
- Use the following configuration to support GitFlow-style branch management:
4635

@@ -55,7 +44,22 @@ on:
5544
5645
- Add <https://github.com/hynek/setup-cached-uv> to set up uv in CI.
5746
- Add <https://github.com/actions/checkout>.
58-
- Set up the GitHub actions matrix to use Ubuntu, Windows and MacOS.
59-
- Set up logic to use uv to install Python, create a venv, activate it, and sync.
47+
- Set up the GitHub actions matrix to use Ubuntu, Windows and MacOS
48+
- Set up the GitHub actions to use different Python versions.
49+
- Set up logic to use uv in GitHub actions.
50+
51+
## Local development configuration
52+
53+
- Cloned the repo from GitHub.
54+
- Ran `uv sync`.
55+
- Set up git username, email, and signing key.
56+
57+
## Set up tests
58+
59+
- Ran `uv add pytest`.
60+
- Created a tests folder.
61+
- Added a trivial test module `test_nothing.py`.
62+
- Add a trivial test `test_pass` to the test module.
63+
- Confirm pytest is working with `pytest tests` in the CLI.
6064
- Add <https://github.com/pavelzw/pytest-action> to set up pytest in CI, using the
6165
correct CLI args to pytest.

0 commit comments

Comments
 (0)