Skip to content

Commit 327a029

Browse files
committed
Use pyproject files
1 parent fdebe45 commit 327a029

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

.github/workflows/build-docs.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- package: tsbrowse
5050
cache-version: v2
5151
requirements-path: requirements.txt
52-
additional-setup: source venv/bin/activate && playwright install
52+
additional-setup: uv run --no-sync playwright install
5353

5454
- package: pyslim
5555
cache-version: v6
@@ -66,10 +66,12 @@ jobs:
6666
cache-version: v8
6767
requirements-path: docs/requirements.txt
6868

69+
6970
- package: tszip
7071
cache-version: v2
7172
requirements-path: requirements/CI-docs.txt
7273

74+
7375
steps:
7476
- uses: actions/[email protected]
7577
name: Checkout ${{ matrix.package }}
@@ -94,23 +96,31 @@ jobs:
9496
name: Docs cache
9597
with:
9698
path: dist
97-
key: ${{ matrix.package }}-${{ matrix.version }}-docs-v3-${{ matrix.cache-version }}-${{ hashFiles('SHA1') }}
99+
key: ${{ matrix.package }}-${{ matrix.version }}-docs-v4-${{ matrix.cache-version }}-${{ hashFiles('SHA1') }}
98100

99-
- uses: actions/[email protected]
100-
if: steps.docs-cache.outputs.cache-hit != 'true'
101-
name: Setup Python
101+
- name: Install uv and set the python version
102+
uses: astral-sh/setup-uv@v6
102103
with:
103-
python-version: '3.11'
104-
105-
- name: Build virtualenv
106-
if: steps.docs-cache.outputs.cache-hit != 'true'
107-
run: python -m venv venv
104+
python-version: 3.11
105+
version: "0.8.15"
108106

109107
- name: Install deps
110108
if: steps.docs-cache.outputs.cache-hit != 'true'
111109
run: |
112-
source venv/bin/activate
113-
pip install -r ${{ matrix.requirements-path || 'requirements/CI-docs/requirements.txt' }}
110+
uv venv
111+
# These can be removed after everything has had a release
112+
if [ -f "${{ matrix.requirements-path }}" ]; then
113+
uv pip install -r ${{ matrix.requirements-path }}
114+
elif [ -f requirements/CI-docs/requirements.txt ]; then
115+
uv pip install -r requirements/CI-docs/requirements.txt
116+
elif [ -f pyproject.toml ]; then
117+
uv pip install -r pyproject.toml --extra docs
118+
elif [ -f python/pyproject.toml ]; then
119+
uv pip install -r python/pyproject.toml --extra docs
120+
else
121+
echo "No requirements found"
122+
exit 1
123+
fi
114124
115125
- name: Additional setup
116126
if: steps.docs-cache.outputs.cache-hit != 'true' && matrix.additional-setup
@@ -119,13 +129,13 @@ jobs:
119129
- name: Build C module
120130
if: steps.docs-cache.outputs.cache-hit != 'true' && matrix.make-command
121131
run: |
122-
source venv/bin/activate
132+
source .venv/bin/activate
123133
${{ matrix.make-command }}
124134
125135
- name: Build Docs
126136
if: steps.docs-cache.outputs.cache-hit != 'true'
127137
run: |
128-
source venv/bin/activate
138+
source .venv/bin/activate
129139
cd docs
130140
make dist
131141
git checkout .

0 commit comments

Comments
 (0)