Repository navigation
64 lines (56 loc) · 1.79 KB
/
Copy pathpythonpackage.yml
File metadata and controls
64 lines (56 loc) · 1.79 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install deps
run: |
pip install -r requirements.txt
- name: Type check
run: |
pip install mypy
mypy dcs
- name: Lint with flake8
run: |
pip install flake8
# Check the default configuration.
flake8 .
# But also run a limited number of checks to verify that the excluded files are at least correct syntax.
flake8 . --isolated --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Test with pytest
run: |
pip install pytest
pytest
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up uv
uses: astral-sh/setup-uv@v10.3.2
- name: Build sdist and wheel
run: |
uv build
- name: Check package metadata
run: |
uvx twine check --strict dist/*
- name: Smoke test installed wheel
run: |
uv venv /tmp/wheel-test
uv pip install --python /tmp/wheel-test dist/*.whl
cd /tmp && /tmp/wheel-test/bin/python -c "import dcs; assert dcs.terrain.Caucasus().city_graph.nodes"