Skip to content

Commit 7106955

Browse files
committed
Revert "Drop testing on Python 3.4"
This reverts commit 1ebd40c.
1 parent 3712017 commit 7106955

File tree

4 files changed

+95
-0
lines changed

4 files changed

+95
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test Python 3.4 compatibility
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-18.04
13+
strategy:
14+
matrix:
15+
python-version: [3.4.10]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r legacy_requirements/requirements.txt
27+
pip install -r legacy_requirements/test_requirements.txt
28+
- name: Lint with flake8
29+
run: |
30+
# stop the build if there are Python syntax errors or undefined names
31+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
- name: Test with pytest
35+
run: |
36+
pytest --doctest-modules changetext ./tests

.github/workflows/test.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.7", "3.8", "3.9", "3.10"] # Not 3.11 yet, because pymorphy2 is not updated to 3.11
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Install Poetry
21+
run: pipx install poetry
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: "poetry"
28+
cache-dependency-path: poetry.lock
29+
30+
- name: Install library and dependencies
31+
run: poetry install --no-interaction
32+
33+
- name: Lint with flake8
34+
run: |
35+
# stop the build if there are Python syntax errors or undefined names
36+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38+
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39+
40+
- name: Test with pytest
41+
run: |
42+
poetry run pytest --doctest-modules changetext ./tests --cov=.
43+
44+
- name: Upload coverage data to coveralls.io
45+
run: |
46+
pip install coveralls==3.3.1
47+
coveralls --service=github | true
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
# - name: Test & publish code coverage
51+
# uses: paambaati/[email protected]
52+
# with:
53+
# coverageCommand: poetry run pytest --doctest-modules changetext ./tests --cov=.
54+
# debug: true

legacy_requirements/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pymorphy2
2+
typing;python_version<"3.5"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
flake8
2+
pytest
3+
pytest-cov

0 commit comments

Comments
 (0)