Skip to content

Commit 3190f8e

Browse files
committed
Dropped support for Python2 + Applied minor changes
1 parent 8a902fa commit 3190f8e

46 files changed

Lines changed: 6200 additions & 6286 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
1-
[run]
2-
source = codext
3-
omit =
4-
codext/__info__.py
5-
codext/**/__init__.py
6-
7-
[report]
8-
exclude_lines =
9-
pragma: no cover
10-
if.*?__name__.*?==.*?.__main__.:
11-
def main\(\)\:
12-
def __stdin_pipe\(\)\:
13-
for line in __stdin_pipe\(\)\:
14-
def __format_list\(items, include\=True\)\:
15-
def __print_tabular\(lst, space\=4\)\:
16-
except ImportError:
17-
except NameError:
18-
raise NotImplementedError
19-
if not PY3
20-
if PY3
21-
def encode\(self, input, final\=False\)\:
22-
def decode\(self, input, final\=False\)\:
23-
def _detect\(text\)\:
24-
def _lang\(lang\)\:
25-
if stopfunc\.LANG_BACKEND\:
26-
def _validate\(stop_function, lang_backend\=\"none\"\)\:
27-
except KeyboardInterrupt\:
1+
[run]
2+
source = codext
3+
omit =
4+
src/codext/__info__.py
5+
src/codext/**/__init__.py
6+
7+
[report]
8+
exclude_lines =
9+
pragma: no cover
10+
if.*?__name__.*?==.*?.__main__.:
11+
def main\(\)\:
12+
def __stdin_pipe\(\)\:
13+
for line in __stdin_pipe\(\)\:
14+
def __format_list\(items, include\=True\)\:
15+
def __print_tabular\(lst, space\=4\)\:
16+
except ImportError:
17+
except NameError:
18+
raise NotImplementedError
19+
def _detect\(text\)\:
20+
def _lang\(lang\)\:
21+
if stopfunc\.LANG_BACKEND\:
22+
def _validate\(stop_function, lang_backend\=\"none\"\)\:
23+
except KeyboardInterrupt\:
24+
if alt and len\(t\) \% 2 \=\= 1\:
Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
4-
name: build
5-
6-
env:
7-
package: codext
8-
9-
on:
10-
push:
11-
branches: [ "main" ]
12-
pull_request:
13-
branches: [ "main" ]
14-
15-
jobs:
16-
build:
17-
runs-on: ${{ matrix.os }}
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
os: [ubuntu-latest]
22-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
23-
steps:
24-
- uses: actions/checkout@v3
25-
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v4
27-
with:
28-
python-version: ${{ matrix.python-version }}
29-
- name: Install ${{ env.package }}
30-
run: |
31-
python -m pip install --upgrade pip
32-
python -m pip install flake8 pytest pytest-cov coverage
33-
pip install -r requirements.txt
34-
pip install .
35-
- name: Lint with flake8
36-
run: |
37-
# stop the build if there are Python syntax errors or undefined names
38-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41-
- name: Test ${{ env.package }} with pytest
42-
run: |
43-
pytest --cov=$package
44-
coverage:
45-
needs: build
46-
runs-on: ubuntu-latest
47-
env:
48-
cov_badge_path: docs/coverage.svg
49-
steps:
50-
- uses: actions/checkout@v3
51-
- name: Install ${{ env.package }}
52-
run: |
53-
python -m pip install --upgrade pip
54-
python -m pip install pytest pytest-cov
55-
pip install -r requirements.txt
56-
pip install .
57-
- name: Make coverage badge for ${{ env.package }}
58-
run: |
59-
pip install genbadge[coverage]
60-
pytest --cov=$package --cov-report=xml
61-
genbadge coverage -i coverage.xml -o $cov_badge_path
62-
- name: Verify Changed files
63-
uses: tj-actions/verify-changed-files@v12
64-
id: changed_files
65-
with:
66-
files: ${{ env.cov_badge_path }}
67-
- name: Commit files
68-
if: steps.changed_files.outputs.files_changed == 'true'
69-
run: |
70-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
71-
git config --local user.name "github-actions[bot]"
72-
git add $cov_badge_path
73-
git commit -m "Updated coverage.svg"
74-
- name: Push changes
75-
if: steps.changed_files.outputs.files_changed == 'true'
76-
uses: ad-m/github-push-action@master
77-
with:
78-
github_token: ${{ secrets.github_token }}
79-
branch: ${{ github.ref }}
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: build
5+
6+
env:
7+
package: codext
8+
9+
on:
10+
push:
11+
branches: [ "main" ]
12+
pull_request:
13+
branches: [ "main" ]
14+
15+
jobs:
16+
build:
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest]
22+
python-version: ["3.8", "3.9", "3.10", "3.11"]
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install ${{ env.package }}
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install flake8 pytest pytest-cov pytest-pythonpath coverage
33+
pip install -r requirements.txt
34+
pip install .
35+
- name: Lint with flake8
36+
run: |
37+
# stop the build if there are Python syntax errors or undefined names
38+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
- name: Test ${{ env.package }} with pytest
42+
run: |
43+
pytest --cov=$package
44+
coverage:
45+
needs: build
46+
runs-on: ubuntu-latest
47+
env:
48+
cov_badge_path: docs/coverage.svg
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Install ${{ env.package }}
52+
run: |
53+
python -m pip install --upgrade pip
54+
python -m pip install pytest pytest-cov pytest-pythonpath
55+
pip install -r requirements.txt
56+
pip install .
57+
- name: Make coverage badge for ${{ env.package }}
58+
run: |
59+
pip install genbadge[coverage]
60+
pytest --cov=$package --cov-report=xml
61+
genbadge coverage -i coverage.xml -o $cov_badge_path
62+
- name: Verify Changed files
63+
uses: tj-actions/verify-changed-files@v12
64+
id: changed_files
65+
with:
66+
files: ${{ env.cov_badge_path }}
67+
- name: Commit files
68+
if: steps.changed_files.outputs.files_changed == 'true'
69+
run: |
70+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
71+
git config --local user.name "github-actions[bot]"
72+
git add $cov_badge_path
73+
git commit -m "Updated coverage.svg"
74+
- name: Push changes
75+
if: steps.changed_files.outputs.files_changed == 'true'
76+
uses: ad-m/github-push-action@master
77+
with:
78+
github_token: ${{ secrets.github_token }}
79+
branch: ${{ github.ref }}

0 commit comments

Comments
 (0)