Repository navigation
75 lines (60 loc) · 2.22 KB
/
Copy pathpython.yml
File metadata and controls
75 lines (60 loc) · 2.22 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
name: Hydrogram
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.13.6"
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --locked --all-extras --dev
- name: Generate API
run: |
uv run --locked make api
- name: Run tests
run: |
uv run --locked pytest
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.13.6"
enable-cache: true
python-version: "3.14"
- name: Install a fresh checkout with pip
run: |
uv venv --seed "$RUNNER_TEMP/hydrogram-source"
"$RUNNER_TEMP/hydrogram-source/bin/python" -m pip install .
"$RUNNER_TEMP/hydrogram-source/bin/python" -I -c "from hydrogram import Client, raw, errors; print(Client.APP_VERSION)"
- name: Install editable development dependencies
run: |
make clean-api
uv sync --locked --dev
uv run --locked python -c "from hydrogram import Client; print(Client.APP_VERSION)"
- name: Build and validate distributions
run: |
uv run --locked make build
uv run --locked twine check --strict dist/*
- name: Import the wheel outside the checkout
working-directory: ${{ runner.temp }}
run: |
uv run --isolated --no-project --with "$GITHUB_WORKSPACE"/dist/*.whl python -c "from hydrogram import Client, raw, errors; print(Client.APP_VERSION)"
- name: Import the source distribution outside the checkout
working-directory: ${{ runner.temp }}
run: |
uv run --isolated --no-project --with "$GITHUB_WORKSPACE"/dist/*.tar.gz python -c "from hydrogram import Client, raw, errors; print(Client.APP_VERSION)"