Repository navigation
59 lines (56 loc) · 2.49 KB
/
Copy pathpackage-python.yml
File metadata and controls
59 lines (56 loc) · 2.49 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
name: Core distribution verification (python)
on:
pull_request:
paths: &package-paths
- 'python/**'
- 'docs/getting-started.md'
- 'docs/features/streaming.md'
- 'docs/features/module-interface.md'
- 'docs/features/context-object.md'
- 'conformance/extract_doc_examples.py'
- '.github/workflows/package-python.yml'
push:
branches: [main]
paths: *package-paths
workflow_call:
permissions:
contents: read
jobs:
python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.11'
- name: Build wheel and sdist
run: |
python -m pip install build
python -m build
- name: Verify installed wheel
shell: bash
run: |
wheel=( "$PWD"/dist/*.whl )
temporary=$(mktemp -d)
python -m venv "$temporary/venv"
cd "$temporary"
"$temporary/venv/bin/python" -m pip install "${wheel[0]}"
"$temporary/venv/bin/python" -m pip check
"$temporary/venv/bin/python" -c 'from apcore import APCore, Registry; from importlib.util import find_spec; assert all(find_spec(name) is None for name in ("yaml", "watchdog", "aiohttp", "opentelemetry"))'
"$temporary/venv/bin/python" -c 'from importlib.resources import files; assert files("apcore").joinpath("py.typed").is_file(), "installed wheel is missing apcore/py.typed"'
python3 "$GITHUB_WORKSPACE/conformance/extract_doc_examples.py" python "$temporary"
(cd quick-start && "$temporary/venv/bin/python" -I example.py)
(cd typed-module && "$temporary/venv/bin/python" -I example.py)
(cd invocation-budget && "$temporary/venv/bin/python" -I example.py)
python -m venv "$temporary/full"
"$temporary/full/bin/python" -m pip install "${wheel[0]}[all]"
"$temporary/full/bin/python" -m pip check
"$temporary/full/bin/python" -c 'from apcore.full import APCore, Config; from apcore.events import SubscriberRegistry; assert APCore(config=Config.from_defaults()).registry is not None'
(cd governed-stream && "$temporary/full/bin/python" -I example.py)
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: core-python-distributions
path: python/dist/