Skip to content

Commit ad3594a

Browse files
committed
init pypi tests
1 parent c0fb5b7 commit ad3594a

File tree

3 files changed

+43
-38
lines changed

3 files changed

+43
-38
lines changed

.github/actions/install-pypi/action.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ inputs:
2323
description: 'Whether Cartopy support is needed'
2424
required: false
2525
default: 'false'
26+
install-target:
27+
description: ''
28+
required: false
29+
default: '.'
30+
install-flags:
31+
description: ''
32+
required: false
33+
default: ''
2634

2735
runs:
2836
using: composite
@@ -31,17 +39,12 @@ runs:
3139
uses: actions/setup-python@v6
3240
with:
3341
python-version: ${{ inputs.python-version }}
34-
cache: 'pip'
3542
cache-dependency-path: |
3643
ci-dev/${{ inputs.type }}_requirements.txt
3744
ci/${{ inputs.version-file }}
3845
ci/extra_requirements.txt
3946
40-
- name: Upgrade pip and setuptools
41-
shell: bash
42-
run: |
43-
python -m pip install --upgrade pip
44-
python -m pip install --upgrade setuptools
47+
- uses: astral-sh/setup-uv@v7
4548

4649
- name: Set dependency groups for install
4750
shell: bash
@@ -56,14 +59,14 @@ runs:
5659
- name: Install
5760
shell: bash
5861
run: >
59-
python -m pip install .[${{ env.DEP_GROUPS }}]
62+
uv pip install --system ${{ inputs.install-flags }} ${{ inputs.install-target }}[${{ env.DEP_GROUPS }}]
6063
-c ci/${{ inputs.version-file }} -c ci-dev/${{ inputs.type }}_requirements.txt -c ci/extra_requirements.txt
6164
6265
- name: Install additional test tools
6366
if: ${{ inputs.type == 'test' }}
6467
shell: bash
6568
run: >
66-
python -m pip install coverage
69+
uv pip install --system coverage
6770
-c ci/${{ inputs.version-file }} -c ci-dev/${{ inputs.type }}_requirements.txt -c ci/extra_requirements.txt
6871
6972
- name: Download Cartopy Maps

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
Builds:
2121
uses: ./.github/workflows/packages.yml
2222

23-
# TestsPyPI:
24-
# needs: Builds
25-
# uses: ./.github/workflows/tests-pypi.yml
26-
# with:
27-
# install-flags: --no-index --find-links ./wheelhouse/
28-
# download-name:
23+
TestsPyPI:
24+
needs: Builds
25+
uses: ./.github/workflows/tests-pypi.yml
26+
with:
27+
install-flags: --no-index --find-links ./wheelhouse/
28+
download-name: wheels-${{ runner.name }}
2929

3030
# TestsSDist:
3131

.github/workflows/tests-pypi.yml

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,34 @@ name: PyPI Tests
44
on:
55
workflow_call:
66
inputs:
7+
install-flags:
8+
description: ''
9+
type: string
10+
required: false
11+
default: ''
12+
download-name:
13+
description: ''
14+
type: string
15+
required: false
16+
default: ''
717

8-
concurrency:
9-
group: ${{ github.workflow}}-${{ github.head_ref }}
10-
cancel-in-progress: true
18+
# concurrency:
19+
# group: ${{ github.workflow}}-${{ github.head_ref }}
20+
# cancel-in-progress: true
1121

1222
jobs:
1323
#
1424
# Run all tests on Linux using standard PyPI packages, including minimum requirements
1525
#
1626
PyPITests:
1727
name: ${{ matrix.python-version }} ${{ matrix.dep-versions }} ${{ matrix.no-extras }}
18-
runs-on: ubuntu-latest
28+
runs-on: ${{ matrix.platform }}
29+
env:
30+
INSTALL_FLAGS: ${{ inputs.install-flags }}
1931
strategy:
2032
fail-fast: false
2133
matrix:
34+
platform: ["ubuntu-latest", "macos-latest", "macos-15-intel", "windows-latest", "windows-11-arm"]
2235
python-version: [3.11, 3.12, 3.13, 3.14]
2336
dep-versions: [Latest]
2437
no-extras: ['']
@@ -40,27 +53,15 @@ jobs:
4053
fetch-tags: true
4154
persist-credentials: false
4255

43-
- name: Generate minimum dependencies
44-
if: ${{ matrix.dep-versions == 'Minimum' }}
45-
run: |
46-
pip install tomli
47-
python << EOF
48-
import tomli as tomllib
49-
from pathlib import Path
50-
51-
# Read our pyproject.toml
52-
config = tomllib.load(open('pyproject.toml', 'rb'))['project']
53-
opt_deps = config['optional-dependencies']
56+
- name: Download artifacts if specified
57+
if: ${{ inputs.download-name != '' }}
58+
uses: actions/download-artifact@v8
59+
with:
60+
name: ${{ inputs.download-name }}
5461

55-
# Generate a Minimum dependency file
56-
for src, fname in [(config['dependencies'], 'ci/requirements.txt'),
57-
(opt_deps['test'], 'ci-dev/test_requirements.txt'),
58-
(opt_deps['extras'], 'ci/extra_requirements.txt')]:
59-
with Path(fname).open('wt') as out:
60-
for dep in src:
61-
dep = dep.split(';')[0]
62-
out.write(dep.replace('>=', '==') + '\n')
63-
EOF
62+
- name: Set flag to install minimum dependencies
63+
if: ${{ matrix.dep-versions == 'Minimum' }}
64+
run: echo "INSTALL_FLAGS=${{ env.INSTALL_FLAGS }} --resolution=lowest-direct" >> $GITHUB_ENV
6465

6566
- name: Install from PyPI
6667
uses: ./.github/actions/install-pypi
@@ -70,6 +71,7 @@ jobs:
7071
python-version: ${{ matrix.python-version }}
7172
old-build: ${{ matrix.no-extras != 'No Extras' && matrix.dep-versions == 'Minimum' }}
7273
need-cartopy: ${{ matrix.no-extras != 'No Extras' }}
74+
install-flags: ${{ env.INSTALL_FLAGS }}
7375

7476
- name: Run tests
7577
uses: ./.github/actions/run-tests

0 commit comments

Comments
 (0)