|
4 | 4 | push: |
5 | 5 | branches: [master, develop] |
6 | 6 | workflow_dispatch: # allows running CI manually from the Actions tab |
| 7 | + |
7 | 8 | concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109 |
8 | 9 | group: ${{ github.workflow }}-${{ github.ref || github.run_id }} |
9 | 10 | cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
10 | | -jobs: |
11 | | - linters: |
12 | | - runs-on: ubuntu-24.04 |
13 | | - steps: |
14 | | - - uses: actions/checkout@v5 |
15 | | - with: |
16 | | - fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__) |
17 | | - |
18 | | - - name: Setup up Python 3.11 |
19 | | - uses: actions/setup-python@v5 |
20 | | - with: |
21 | | - python-version: "3.11" |
22 | | - |
23 | | - - name: Install dependencies |
24 | | - run: pip install flake8 -e .[all] |
25 | | - |
26 | | - - name: Run flake8 linter (source) |
27 | | - run: flake8 --show-source smart_open |
28 | | - |
29 | | - - name: "Check whether help.txt update was forgotten" |
30 | | - if: github.event_name == 'pull_request' |
31 | | - run: | |
32 | | - python update_helptext.py |
33 | | - test ! "$(git diff)" && echo "no changes" || ( git diff && echo 'looks like "python update_helptext.py" was forgotten' && exit 1 ) |
34 | 11 |
|
35 | | - unit_tests: |
36 | | - needs: [linters] |
| 12 | +jobs: |
| 13 | + ci: |
37 | 14 | runs-on: ${{ matrix.os }} |
| 15 | + timeout-minutes: 10 |
38 | 16 | strategy: |
39 | 17 | matrix: |
40 | 18 | include: |
41 | | - - {python-version: '3.8', os: ubuntu-24.04} |
| 19 | + # sync with linting steps below |
42 | 20 | - {python-version: '3.9', os: ubuntu-24.04} |
43 | | - - {python-version: '3.10', os: ubuntu-24.04} |
44 | | - - {python-version: '3.11', os: ubuntu-24.04} |
45 | | - - {python-version: '3.12', os: ubuntu-24.04} |
46 | | - - {python-version: '3.13', os: ubuntu-24.04} |
| 21 | + - {python-version: '3.14', os: ubuntu-24.04} |
47 | 22 |
|
48 | | - - {python-version: '3.8', os: windows-2025} |
49 | 23 | - {python-version: '3.9', os: windows-2025} |
50 | | - - {python-version: '3.10', os: windows-2025} |
51 | | - - {python-version: '3.11', os: windows-2025} |
52 | | - - {python-version: '3.12', os: windows-2025} |
53 | | - - {python-version: '3.13', os: windows-2025} |
| 24 | + - {python-version: '3.14', os: windows-2025} |
| 25 | + |
| 26 | + # deprecate macos-15-intel when python 3.9 becomes the minimum supported version |
| 27 | + # ref https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/ |
| 28 | + # ref https://github.com/actions/python-versions/blob/d026dedcb/versions-manifest.json#L9969-L10016 |
| 29 | + - {python-version: '3.9', os: macos-15-intel} |
| 30 | + - {python-version: '3.14', os: macos-15} |
| 31 | + |
54 | 32 | steps: |
55 | 33 | - uses: actions/checkout@v5 |
56 | 34 | with: |
57 | 35 | fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__) |
58 | 36 |
|
59 | | - - uses: actions/setup-python@v5 |
| 37 | + - uses: astral-sh/setup-uv@v6 |
60 | 38 | with: |
61 | 39 | python-version: ${{ matrix.python-version }} |
| 40 | + activate-environment: true |
| 41 | + enable-cache: true |
| 42 | + cache-dependency-glob: "**/pyproject.toml" |
62 | 43 |
|
63 | 44 | - name: Install smart_open without dependencies |
64 | | - run: pip install -e . |
| 45 | + run: uv pip install -e . |
65 | 46 |
|
66 | 47 | - name: Check that smart_open imports without dependencies |
67 | 48 | run: python -c 'import smart_open' |
68 | 49 |
|
69 | 50 | - name: Install smart_open and its dependencies |
70 | | - run: pip install -e .[test] |
| 51 | + run: uv pip install -e .[test] |
71 | 52 |
|
72 | | - - name: Run unit tests |
73 | | - run: pytest tests -v -rfxECs --durations=20 |
74 | | - |
75 | | - doctest: |
76 | | - needs: [linters,unit_tests] |
77 | | - runs-on: ${{ matrix.os }} |
78 | | - strategy: |
79 | | - matrix: |
80 | | - include: |
81 | | - - {python-version: '3.8', os: ubuntu-24.04} |
82 | | - - {python-version: '3.9', os: ubuntu-24.04} |
83 | | - - {python-version: '3.10', os: ubuntu-24.04} |
84 | | - - {python-version: '3.11', os: ubuntu-24.04} |
85 | | - - {python-version: '3.12', os: ubuntu-24.04} |
86 | | - - {python-version: '3.13', os: ubuntu-24.04} |
87 | | - |
88 | | - # |
89 | | - # Some of the doctests don't pass on Windows because of Windows-specific |
90 | | - # character encoding issues. |
91 | | - # |
92 | | - # - {python-version: '3.8', os: windows-2025} |
93 | | - # - {python-version: '3.9', os: windows-2025} |
94 | | - # - {python-version: '3.10', os: windows-2025} |
95 | | - # - {python-version: '3.11', os: windows-2025} |
96 | | - # - {python-version: '3.12', os: windows-2025} |
97 | | - # - {python-version: '3.13', os: windows-2025} |
98 | | - |
99 | | - steps: |
100 | | - - uses: actions/checkout@v5 |
101 | | - with: |
102 | | - fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__) |
| 53 | + - name: Run flake8 linter (source) |
| 54 | + if: matrix.python-version == '3.9' # sync with matrix above |
| 55 | + run: flake8 --show-source smart_open |
103 | 56 |
|
104 | | - - uses: actions/setup-python@v5 |
105 | | - with: |
106 | | - python-version: ${{ matrix.python-version }} |
| 57 | + - name: "Check whether help.txt update was forgotten" |
| 58 | + if: matrix.python-version == '3.9' && github.event_name == 'pull_request' # sync with matrix above |
| 59 | + run: | |
| 60 | + python update_helptext.py |
| 61 | + test ! "$(git diff)" && echo "no changes" || ( git diff && echo 'looks like "python update_helptext.py" was forgotten' && exit 1 ) |
107 | 62 |
|
108 | | - - name: Install smart_open and its dependencies |
109 | | - run: pip install -e .[test] |
| 63 | + - name: Run unit tests |
| 64 | + # configuration in pyproject.toml |
| 65 | + run: pytest tests -v |
110 | 66 |
|
111 | 67 | - name: Run doctests |
| 68 | + if: startsWith(matrix.os, 'ubuntu') |
112 | 69 | run: python ci_helpers/doctest.py |
113 | 70 | env: |
114 | 71 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
115 | 72 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
116 | 73 |
|
117 | | - integration: |
118 | | - needs: [linters,unit_tests] |
119 | | - runs-on: ${{ matrix.os }} |
120 | | - strategy: |
121 | | - matrix: |
122 | | - include: |
123 | | - - {python-version: '3.8', os: ubuntu-24.04} |
124 | | - - {python-version: '3.9', os: ubuntu-24.04} |
125 | | - - {python-version: '3.10', os: ubuntu-24.04} |
126 | | - - {python-version: '3.11', os: ubuntu-24.04} |
127 | | - - {python-version: '3.12', os: ubuntu-24.04} |
128 | | - - {python-version: '3.13', os: ubuntu-24.04} |
129 | | - |
130 | | - # Not sure why we exclude these, perhaps for historical reasons? |
131 | | - # |
132 | | - # - {python-version: '3.8', os: windows-2025} |
133 | | - # - {python-version: '3.9', os: windows-2025} |
134 | | - # - {python-version: '3.10', os: windows-2025} |
135 | | - # - {python-version: '3.11', os: windows-2025} |
136 | | - # - {python-version: '3.12', os: windows-2025} |
137 | | - # - {python-version: '3.13', os: windows-2025} |
138 | | - |
139 | | - steps: |
140 | | - - uses: actions/checkout@v5 |
141 | | - with: |
142 | | - fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__) |
143 | | - |
144 | | - - uses: actions/setup-python@v5 |
145 | | - with: |
146 | | - python-version: ${{ matrix.python-version }} |
147 | | - |
148 | | - - name: Install smart_open and its dependencies |
149 | | - run: pip install -e .[test] |
150 | | - |
151 | | - - run: bash ci_helpers/helpers.sh enable_moto_server |
152 | | - if: ${{ matrix.moto_server }} |
153 | | - |
154 | 74 | - name: Start vsftpd |
| 75 | + if: startsWith(matrix.os, 'ubuntu') |
155 | 76 | timeout-minutes: 2 |
156 | 77 | run: | |
157 | 78 | sudo apt-get install vsftpd |
158 | 79 | sudo bash ci_helpers/helpers.sh create_ftp_ftps_servers |
159 | 80 |
|
160 | 81 | - name: Run integration tests |
| 82 | + if: startsWith(matrix.os, 'ubuntu') |
161 | 83 | run: python ci_helpers/run_integration_tests.py |
162 | 84 | env: |
163 | 85 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
164 | 86 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
165 | 87 |
|
166 | | - - run: bash ci_helpers/helpers.sh disable_moto_server |
167 | | - if: ${{ matrix.moto_server }} |
168 | | - |
169 | | - - run: sudo bash ci_helpers/helpers.sh delete_ftp_ftps_servers |
170 | | - |
171 | | - benchmarks: |
172 | | - needs: [linters,unit_tests] |
173 | | - runs-on: ${{ matrix.os }} |
174 | | - strategy: |
175 | | - matrix: |
176 | | - include: |
177 | | - - {python-version: '3.8', os: ubuntu-24.04} |
178 | | - - {python-version: '3.9', os: ubuntu-24.04} |
179 | | - - {python-version: '3.10', os: ubuntu-24.04} |
180 | | - - {python-version: '3.11', os: ubuntu-24.04} |
181 | | - - {python-version: '3.12', os: ubuntu-24.04} |
182 | | - - {python-version: '3.13', os: ubuntu-24.04} |
183 | | - |
184 | | - # - {python-version: '3.8', os: windows-2025} |
185 | | - # - {python-version: '3.9', os: windows-2025} |
186 | | - # - {python-version: '3.10', os: windows-2025} |
187 | | - # - {python-version: '3.11', os: windows-2025} |
188 | | - # - {python-version: '3.12', os: windows-2025} |
189 | | - # - {python-version: '3.13', os: windows-2025} |
190 | | - |
191 | | - steps: |
192 | | - - uses: actions/checkout@v5 |
193 | | - with: |
194 | | - fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__) |
195 | | - |
196 | | - - uses: actions/setup-python@v5 |
197 | | - with: |
198 | | - python-version: ${{ matrix.python-version }} |
199 | | - |
200 | | - - name: Install smart_open and its dependencies |
201 | | - run: pip install -e .[test] |
202 | | - |
203 | 88 | - name: Run benchmarks |
| 89 | + if: startsWith(matrix.os, 'ubuntu') |
204 | 90 | run: python ci_helpers/run_benchmarks.py |
205 | 91 | env: |
206 | 92 | SO_BUCKET: smart-open |
|
0 commit comments