-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (114 loc) · 3.2 KB
/
python-package.yaml
File metadata and controls
130 lines (114 loc) · 3.2 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Python package
on:
push:
pull_request:
permissions:
contents: read
jobs:
test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Wait for Postgres
run: |
for i in {1..30}; do
pg_isready -h localhost -p 5432 -U postgres && exit 0
sleep 1
done
exit 1
- name: Initialize GiST extension
env:
PGPASSWORD: postgres
run: |
psql -h localhost -p 5432 -U postgres -d postgres \
-c "CREATE EXTENSION IF NOT EXISTS btree_gist;"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install dependencies
run: uv sync --extra test
- name: Run tests
run: uv run pytest
env:
ANYVLM_TEST_STORAGE_URI: postgresql://postgres:postgres@localhost:5432/postgres
ANYVLM_ANYVAR_TEST_STORAGE_URI: postgresql://postgres:postgres@localhost:5432/postgres
HANDOVER_TYPE_ID: "CUSTOM:GREGoR-NCH"
HANDOVER_TYPE_LABEL: "GREGoR AnyVLM Reference"
BEACON_HANDOVER_URL: https://variants.gregorconsortium.org/
BEACON_NODE_ID: org.anyvlm.gregor
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install dependencies
run: uv sync --extra dev
- name: Check style
run: uv run ruff check && uv run ruff format --check
precommit_hooks:
runs-on: ubuntu-latest
strategy:
matrix:
cmd:
- "end-of-file-fixer"
- "trailing-whitespace"
- "mixed-line-ending"
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- uses: pre-commit/action@v3.0.1
with:
extra_args: ${{ matrix.cmd }} --all-files
docs:
runs-on: ubuntu-latest
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.11
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: uv sync --extra docs
- name: Attempt docs build
working-directory: ./docs
run: source ../.venv/bin/activate && make html