-
Notifications
You must be signed in to change notification settings - Fork 12
126 lines (107 loc) · 3.66 KB
/
tests.yml
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
name: tests
on:
push:
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
validate:
name: Validate
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Configure Python version
uses: actions/setup-python@v5
with:
python-version: "3.7"
- name: black
run: |
python -m pip install black -c requirements.txt
python -m black confection --check
- name: isort
run: |
python -m pip install isort -c requirements.txt
python -m isort confection --check
- name: flake8
run: |
python -m pip install flake8 -c requirements.txt
python -m flake8 confection --count --select=E901,E999,F821,F822,F823,W605 --show-source --statistics
tests:
name: Test
needs: Validate
if: github.repository == 'explosion/confection'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_version: [ "3.12" ]
include:
- os: windows-2019
python_version: "3.6"
- os: ubuntu-latest
python_version: "3.7"
- os: windows-latest
python_version: "3.8"
- os: macos-latest
python_version: "3.9"
- os: ubuntu-latest
python_version: "3.10"
- os: windows-latest
python_version: "3.11"
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Configure Python version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Build sdist
run: |
python -m pip install -U build pip setuptools
python -m pip install -U -r requirements.txt
python -m build --sdist
- name: Run mypy for Pydantic v2
run: |
python -m mypy confection
if: matrix.python_version != '3.6' && matrix.python_version != '3.7'
- name: Run mypy for Pydantic v1.10
run: |
python -m pip install -U pydantic==1.10.*
python -m mypy confection
if: matrix.python_version != '3.6' && matrix.python_version != '3.7'
- name: Delete source directory
run: rm -rf confection
shell: bash
- name: Uninstall all packages
run: |
python -m pip freeze > installed.txt
python -m pip uninstall -y -r installed.txt
- name: Install from sdist
run: |
SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
python -m pip install dist/$SDIST
shell: bash
- name: Test import
run: python -c "import confection" -Werror
- name: Install test requirements with Pydantic v1
run: |
python -m pip install -U -r requirements.txt
python -m pip install -U "pydantic<2.0"
- name: Run tests for Pydantic v1
run: |
python -c "import pydantic; print(pydantic.VERSION)"
python -m pytest --pyargs confection -Werror
- name: Install test requirements with Pydantic v2
run: |
python -m pip install -U -r requirements.txt
python -m pip install -U pydantic
- name: Run tests for Pydantic v2
run: |
python -c "import pydantic; print(pydantic.VERSION)"
python -m pytest --pyargs confection -Werror
- name: Test for import conflicts with hypothesis
run: |
python -m pip install hypothesis
python -c "import confection; import hypothesis"