-
-
Notifications
You must be signed in to change notification settings - Fork 28
77 lines (73 loc) · 3.27 KB
/
Copy pathci.yml
File metadata and controls
77 lines (73 loc) · 3.27 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
67
68
69
70
71
72
73
74
75
76
77
name: Tests
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install project and test runner
run: |
python -m pip install poetry==2.3.2
poetry install --all-extras
- name: Run tests
run: poetry run pytest -q -m "not live" --strict-markers
package:
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.14"]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install build tools
run: python -m pip install poetry==2.3.2 twine==6.2.0
- name: Verify test collection
run: |
poetry install --all-extras
poetry run pytest --collect-only -q --strict-markers
- name: Validate and build package
run: |
poetry check
poetry build
python -m twine check dist/*
- name: Smoke test base wheel installation
run: |
WHEEL=$(find dist -name '*.whl' -print -quit)
python -m venv /tmp/python-substack-base
/tmp/python-substack-base/bin/pip install "$WHEEL"
/tmp/python-substack-base/bin/pip check
/tmp/python-substack-base/bin/substack --version
/tmp/python-substack-base/bin/python -c "import importlib.util; assert importlib.util.find_spec('fastmcp') is None"
/tmp/python-substack-base/bin/python -c "from importlib import metadata; import substack; expected={'substack':'substack.cli:main','substack-auth-check':'substack.cli:auth_check','substack-publish-markdown':'substack.cli:publish_markdown','substack-publish-yaml':'substack.cli:publish_yaml','substack-mcp':'substack_mcp.mcp_server:main'}; actual={entry.name:entry.value for entry in metadata.entry_points(group='console_scripts') if entry.name in expected}; package=metadata.metadata('python-substack'); requirements=metadata.requires('python-substack'); assert actual == expected; assert metadata.version('python-substack') == substack.__version__; assert package['Requires-Python'] == '>=3.10,<4.0'; assert package.get_all('Provides-Extra') == ['mcp']; assert all(any(requirement.startswith(name) for requirement in requirements) for name in ['PyYAML','fastmcp','markdown-it-py','mdit-py-plugins','python-dotenv','requests'])"
- name: Smoke test MCP wheel installation
run: |
WHEEL=$(find dist -name '*.whl' -print -quit)
python -m venv /tmp/python-substack-mcp
/tmp/python-substack-mcp/bin/pip install "${WHEEL}[mcp]"
/tmp/python-substack-mcp/bin/pip check
/tmp/python-substack-mcp/bin/python -c "import substack_mcp.mcp_server"
- uses: actions/upload-artifact@v7
if: matrix.python-version == '3.14'
with:
name: python-substack-distributions
path: dist/
if-no-files-found: error