Skip to content

Commit 5bad501

Browse files
authored
Merge pull request #203 from MC-kit/devel
Devel
2 parents 6f5a04b + d9c4891 commit 5bad501

Some content is hidden

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

60 files changed

+3746
-2767
lines changed

.flake8

+32-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
[flake8]
2-
select=ANN,B,B9,BLK,C,D,DAR,E,F,I,TC,S,W
3-
max-complexity=12
4-
max-line-length=88
2+
select=ANN,B,B9,BLK,C,D,DAR,E,F,I,N,PD,R,TC,TR,S,W
3+
max-complexity=15
4+
max-mccabe-complexity=6
5+
max-cognitive-complexity=10
6+
max-line-length=100
57
ignore=
6-
# ANN001 Missing type annotation for function argument
8+
# ANN001 Missing type annotation for function argument: doesn't allow to use functools dispatching
79
ANN001
10+
# ANN002 Missing type annotation for *drop_items: ... as above
11+
ANN002
812
# ANN101 Missing type annotation for self in method
913
ANN101
1014
# ANN102 Missing type annotation for cls in classmethod
1115
ANN102
16+
# ANN202 Missing return type annotation for protected function: ... dispatching
17+
ANN202
1218
#ANN204 Missing return type annotation for special method
1319
ANN204
14-
# zip() without `strict` parameter, pythons <3.10 don't have this keyword
20+
# B905 `zip()` without an explicit `strict=` parameter - ignore while support 3.8, 3.9
1521
B905
1622
# C812 Missing trailing comma: black compatibility
1723
C812
@@ -25,11 +31,21 @@ ignore=
2531
E501
2632
# W503: Line break before binary operator: for compatibility with black settings
2733
W503
28-
# import is controlled by isort
34+
35+
# import order is controlled by isort
2936
I100
3037
I101
3138
I201
3239
I202
40+
41+
# ignore some questionable pandas-vet warnings
42+
# PD005: use operator instead of method
43+
PD005
44+
# We use at() to access single values
45+
PD008
46+
# And we use iat()
47+
PD009
48+
3349
exclude=
3450
.git
3551
__pycache__
@@ -39,20 +55,27 @@ exclude=
3955
wrk
4056
build
4157
dist
42-
tools/install-poetry.py
4358
*.pyc
4459
*.egg-info
4560
.cache
4661
.eggs
62+
notebooks/dvp/*.py
63+
.nox
64+
.idea
65+
4766
per-file-ignores =
4867
noxfile.py:ANN,DAR101
4968
tools/clear-prev-dist-info.py:S404,S603,S607
50-
tools/install_flake8_deps.py:S404,S603,S607,B950
5169
config.py:ANN001,ANN201
52-
tests/*:S101,ANN,DAR100,D100,D103,DAR101,DAR103
70+
src/mapstp/cli/logging.py:PD005
71+
tests/*:ANN,B950,DAR100,D100,D101,D102,D103,D104,DAR101,DAR103,S101
5372
ignore-decorators=click,pytest
5473
docstring-convention = google
5574
rst-roles = class,const,func,meth,mod,ref
5675
rst-directives = deprecated
76+
extend-ignore =
77+
# Google Python style is not RST until after processed by Napoleon
78+
# See https://github.com/peterjc/flake8-rst-docstrings/issues/17
79+
RST201,RST203,RST301,
5780

5881
# vim: set ts=4 sw=0 tw=79 ss=0 ft=ini et ai :

.github/constraints.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
pip==22.3.1
2-
nox==2022.11.21
3-
poetry==1.3.1
4-
virtualenv==20.16.5 # restricted by poetry on Windows, current 20.17.1
5-
wheel-0.38.4
1+
pip==23.0.1
2+
poetry==1.4.2
3+

.github/workflows/clean-workflow-logs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# repo: ${{ github.event.repository.name }}
2323
# days_old: ${{ github.event.inputs.days_old }}
2424
- name: Clean workflow runs
25-
uses: dmvict/[email protected].0
25+
uses: dmvict/[email protected].1
2626
with:
2727
token: ${{ secrets.MCKIT_GITHUB_TOKEN }}
2828
save_period: 30

.github/workflows/labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Check out the repository
29-
uses: actions/checkout@v3.2.0
29+
uses: actions/checkout@v3.5.3
3030

3131
- name: Sync GitHub Issue Labels
3232
uses: crazy-max/ghaction-github-labeler@v4

.github/workflows/release-drafter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ jobs:
77
draft_release:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: release-drafter/release-drafter@v5.21.1
10+
- uses: release-drafter/release-drafter@v5.23.0
1111
env:
1212
GITHUB_TOKEN: ${{ secrets.MCKIT_GITHUB_TOKEN }}

.github/workflows/release.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727

2828
steps:
2929
- name: Check out the repository
30-
uses: actions/checkout@v3.2.0
30+
uses: actions/checkout@v3.5.3
3131
with:
3232
fetch-depth: 2 # need previous revision to define tag
3333

3434
- name: Set up Python
35-
uses: actions/setup-python@v4.3.1
35+
uses: actions/setup-python@v4.6.1
3636
with:
3737
python-version: ${{ env.PYTHON_VERSION }}
3838

@@ -71,21 +71,21 @@ jobs:
7171
7272
- name: Publish package on PyPI
7373
if: steps.check-version.outputs.tag
74-
uses: pypa/gh-action-pypi-publish@v1.6.4
74+
uses: pypa/gh-action-pypi-publish@v1.8.6
7575
with:
7676
user: __token__
7777
password: ${{ secrets.PYPI_TOKEN }}
7878

7979
- name: Publish package on TestPyPI
8080
if: "! steps.check-version.outputs.tag"
81-
uses: pypa/gh-action-pypi-publish@v1.6.4
81+
uses: pypa/gh-action-pypi-publish@v1.8.6
8282
with:
8383
user: __token__
8484
password: ${{ secrets.TEST_PYPI_TOKEN }}
8585
repository_url: https://test.pypi.org/legacy/
8686

8787
- name: Publish the release notes
88-
uses: release-drafter/release-drafter@v5.21.1
88+
uses: release-drafter/release-drafter@v5.23.0
8989
with:
9090
publish: ${{ steps.check-version.outputs.tag != '' }}
9191
tag: ${{ steps.check-version.outputs.tag }}

.github/workflows/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/stale@v6
13+
- uses: actions/stale@v8
1414
with:
1515
repo-token: ${{ secrets.MCKIT_GITHUB_TOKEN }}
1616
stale-issue-message: 'Stale issue message'

.github/workflows/tests.yml

+79-31
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,37 @@ jobs:
3636
!contains(github.event.head_commit.message, '[skip_ci]')
3737
steps:
3838
- name: Check out the repository
39-
uses: actions/checkout@v3.2.0
39+
uses: actions/checkout@v3.5.3
4040

41-
- name: Set up Python 3.11
42-
uses: actions/setup-python@v4.3.1
41+
- name: Set up Python 3.10 # on 3.11 pip install in unstable: "canonicalize" fails occasionally
42+
uses: actions/setup-python@v4.6.1
4343
with:
44-
python-version: '3.11'
44+
python-version: '3.10'
4545

46-
- name: Upgrade pip
46+
- name: Use frozen pip version
4747
run: |
4848
pip install --constraint=.github/constraints.txt pip
4949
pip --version
5050
51-
- name: Install Poetry
52-
run: |
53-
pip install --constraint=.github/constraints.txt poetry
54-
poetry --version
55-
5651
- name: Install Nox
5752
run: |
5853
pip install --constraint=.github/constraints.txt nox
5954
nox --version
6055
61-
# - name: Run safety session
62-
# run: |
63-
# nox --force-color --session=safety
56+
- name: Load poetry cache
57+
id: cached-poetry-dependencies
58+
uses: actions/[email protected]
59+
with:
60+
path: |
61+
.cache/pypoetry
62+
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
63+
64+
- name: Install Poetry
65+
run: |
66+
pip install --constraint=.github/constraints.txt poetry
67+
poetry --version
68+
poetry config --local cache-dir .cache/pypoetry
69+
poetry config --local virtualenvs.create false
6470
6571
- name: Run pre commit checks
6672
run: |
@@ -75,34 +81,45 @@ jobs:
7581
needs: lint
7682
steps:
7783
- name: Check out the repository
78-
uses: actions/[email protected]
84+
uses: actions/[email protected]
85+
with:
86+
fetch-depth: 1
7987

8088
- name: Set up Python 3.11
81-
uses: actions/setup-python@v4.3.1
89+
uses: actions/setup-python@v4.6.1
8290
with:
8391
python-version: '3.11'
8492

85-
- name: Upgrade pip
93+
- name: Use frozen pip version
8694
run: |
8795
pip install --constraint=.github/constraints.txt pip
8896
pip --version
8997
90-
- name: Install Poetry
91-
run: |
92-
pip install --constraint=.github/constraints.txt poetry
93-
poetry --version
94-
9598
- name: Install Nox
9699
run: |
97100
pip install --constraint=.github/constraints.txt nox
98101
nox --version
99102
103+
- name: Load poetry cache
104+
id: cached-poetry-dependencies
105+
uses: actions/[email protected]
106+
with:
107+
path: |
108+
.cache/pypoetry
109+
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
110+
111+
- name: Install Poetry
112+
run: |
113+
pip install --constraint=.github/constraints.txt poetry
114+
poetry --version
115+
poetry config --local cache-dir .cache/pypoetry
116+
poetry config --local virtualenvs.create false
117+
poetry env info
118+
100119
- name: Build documentation
101120
run: |
102121
nox --force-color --session=docs-build
103122
104-
105-
106123
tests:
107124
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
108125
needs: lint
@@ -112,31 +129,50 @@ jobs:
112129
matrix:
113130
os: [ubuntu-latest, macos-latest, windows-latest]
114131
python-version: ['3.8', '3.9', '3.10', '3.11']
132+
115133
steps:
134+
116135
- name: Checkout repository
117-
uses: actions/checkout@v3.2.0
136+
uses: actions/checkout@v3.5.3
118137
with:
119138
fetch-depth: 1
120-
- uses: actions/[email protected]
139+
140+
- uses: actions/[email protected]
121141
with:
122142
python-version: ${{ matrix.python-version }}
123143
architecture: x64
144+
124145
- name: Use frozen pip version
125146
run: |
126147
pip install --constraint=.github/constraints.txt pip virtualenv
127148
pip --version
149+
128150
- name: Install nox
129151
run: |
130152
pip install --constraint=.github/constraints.txt nox
131153
nox --version
132-
- name: Install poetry
154+
155+
- name: Load poetry cache
156+
id: cached-poetry-dependencies
157+
uses: actions/[email protected]
158+
with:
159+
path: |
160+
.cache/pypoetry
161+
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
162+
163+
- name: Install Poetry
133164
run: |
134165
pip install --constraint=.github/constraints.txt poetry
135166
poetry --version
167+
poetry config --local cache-dir .cache/pypoetry
168+
poetry config --local virtualenvs.create false
169+
poetry env info
170+
136171
- name: Run nox tests
137172
run: nox --force-color --session tests --python ${{ matrix.python-version }}
173+
138174
- name: Upload coverage data
139-
uses: actions/[email protected].1
175+
uses: actions/[email protected].2
140176
with:
141177
name: coverage-data
142178
path: ".coverage.*"
@@ -145,11 +181,12 @@ jobs:
145181
runs-on: ubuntu-latest
146182
needs: tests
147183
steps:
184+
148185
- name: Check out the repository
149-
uses: actions/checkout@v3.2.0
186+
uses: actions/checkout@v3.5.3
150187

151188
- name: Set up Python 3.11
152-
uses: actions/setup-python@v4.3.1
189+
uses: actions/setup-python@v4.6.1
153190
with:
154191
python-version: '3.11'
155192

@@ -158,18 +195,29 @@ jobs:
158195
pip install --constraint=.github/constraints.txt pip
159196
pip --version
160197
198+
- name: Load poetry cache
199+
id: cached-poetry-dependencies
200+
uses: actions/[email protected]
201+
with:
202+
path: |
203+
.cache/pypoetry
204+
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
205+
161206
- name: Install Poetry
162207
run: |
163208
pip install --constraint=.github/constraints.txt poetry
164209
poetry --version
210+
poetry config --local cache-dir .cache/pypoetry
211+
poetry config --local virtualenvs.create false
212+
poetry env info
165213
166214
- name: Install Nox
167215
run: |
168216
pip install --constraint=.github/constraints.txt nox
169217
nox --version
170218
171219
- name: Download coverage data
172-
uses: actions/[email protected].1
220+
uses: actions/[email protected].2
173221
with:
174222
name: coverage-data
175223

@@ -182,4 +230,4 @@ jobs:
182230
nox --force-color --session=coverage -- xml
183231
184232
- name: Upload coverage report
185-
uses: codecov/[email protected].1
233+
uses: codecov/[email protected].4

0 commit comments

Comments
 (0)