Repository navigation
66 lines (62 loc) · 2.14 KB
/
Copy pathpython-package.yml
File metadata and controls
66 lines (62 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Python package
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: python-package-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
package:
name: Python ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
python: ['3.11', '3.12', '3.13', '3.14']
include:
- os: windows-latest
python: '3.12'
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Install development dependencies
run: python -m pip install '.[dev]'
- name: Lint Python sources
run: python -m ruff check .
- name: Check formatting
run: python -m ruff format --check .
- name: Test launcher branches
run: python -m coverage run -m unittest discover -s tests -p 'test_python_*.py' -v
- name: Require complete launcher branch coverage
run: python -m coverage report
- name: Build source distribution and wheel
run: python -m build
- name: Validate PyPI metadata and README
shell: bash
run: python -m twine check --strict dist/*
- name: Check isolated installation and rebuild from sdist
run: python tests/python_package.py
- name: Install Linux round-trip prerequisites
if: matrix.os == 'ubuntu-24.04' && matrix.python == '3.11'
shell: bash
run: |
go install github.com/mikefarah/yq/v4@v4.45.1
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Test real installed-package backup and recovery
if: matrix.os == 'ubuntu-24.04' && matrix.python == '3.11'
run: python tests/python_package.py --round-trip
- name: Preserve distributions
if: matrix.os == 'ubuntu-24.04' && matrix.python == '3.11'
uses: actions/upload-artifact@v7
with:
name: backfort-python-distributions
path: |
dist/*.whl
dist/*.tar.gz
if-no-files-found: error