Skip to content

Commit 58ec6f0

Browse files
gaborbernatibdafna
authored andcommitted
Bump linters and add 3.10 to the CI
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 473c768 commit 58ec6f0

File tree

7 files changed

+90
-84
lines changed

7 files changed

+90
-84
lines changed

.github/workflows/check.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
name: check
2-
3-
on: [push, pull_request]
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: "0 8 * * *"
47

58
concurrency:
69
group: check-${{ github.ref }}
710
cancel-in-progress: true
811

912
jobs:
1013
lint:
11-
runs-on: ubuntu-latest
12-
14+
runs-on: ubuntu-20.04
1315
steps:
1416
- uses: actions/checkout@v2
1517
- uses: actions/setup-python@v2
16-
- uses: pre-commit/[email protected].0
18+
- uses: pre-commit/[email protected].3
1719

1820
test:
19-
name: ${{ matrix.py }}
20-
runs-on: Ubuntu-latest
21+
name: test on ${{ matrix.py }}
22+
runs-on: ubuntu-20.04
2123
strategy:
2224
fail-fast: false
2325
matrix:
2426
py:
25-
- 3.9
26-
- 3.8
27-
- 3.7
28-
- 3.6
27+
- "3.10"
28+
- "3.9"
29+
- "3.8"
30+
- "3.7"
31+
- "3.6"
2932
- pypy3
30-
3133
steps:
3234
- uses: actions/checkout@v2
3335
- name: setup python for tox
3436
uses: actions/setup-python@v2
3537
with:
36-
python-version: 3.9
38+
python-version: "3.10"
3739
- name: install tox
3840
run: python -m pip install tox
3941
- name: setup python for test ${{ matrix.py }}
@@ -57,19 +59,19 @@ jobs:
5759

5860
check:
5961
name: check ${{ matrix.tox_env }}
60-
runs-on: Ubuntu-latest
62+
runs-on: ubuntu-20.04
6163
strategy:
6264
fail-fast: false
6365
matrix:
6466
tox_env:
6567
- pkg_desc
66-
68+
- dev
6769
steps:
6870
- uses: actions/checkout@v2
69-
- name: setup Python 3.9
71+
- name: setup Python 3.10
7072
uses: actions/setup-python@v2
7173
with:
72-
python-version: 3.9
74+
python-version: "3.10"
7375
- name: install tox
7476
run: python -m pip install tox
7577
- name: run check for ${{ matrix.tox_env }}
@@ -83,7 +85,7 @@ jobs:
8385
- name: setup python to build package
8486
uses: actions/setup-python@v2
8587
with:
86-
python-version: 3.9
88+
python-version: "3.10"
8789
- name: install build
8890
run: python -m pip install build
8991
- uses: actions/checkout@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,4 @@ ipydatagrid/labextension
162162

163163
conda_out
164164
recipe
165+
/examples/trees.json

.pre-commit-config.yaml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
3+
rev: v4.1.0
44
hooks:
5+
- id: check-ast
6+
- id: check-builtin-literals
7+
- id: check-docstring-first
8+
- id: check-merge-conflict
59
- id: check-yaml
6-
- id: trailing-whitespace
10+
- id: check-toml
11+
- id: debug-statements
712
- id: end-of-file-fixer
13+
- id: trailing-whitespace
814
- repo: https://github.com/asottile/pyupgrade
9-
rev: v2.10.0
15+
rev: v2.29.1
1016
hooks:
1117
- id: pyupgrade
12-
args: ['--py36-plus']
18+
args: [ "--py36-plus" ]
19+
- repo: https://github.com/PyCQA/isort
20+
rev: 5.10.1
21+
hooks:
22+
- id: isort
1323
- repo: https://github.com/psf/black
14-
rev: 21.4b0
24+
rev: 21.12b0
1525
hooks:
1626
- id: black
17-
args: [--safe]
18-
- repo: https://github.com/tomcatling/black-nb
19-
rev: 0.5.0
27+
args: [ --safe ]
28+
- repo: https://github.com/asottile/blacken-docs
29+
rev: v1.12.0
2030
hooks:
21-
- id: black-nb
22-
- repo: https://github.com/PyCQA/isort
23-
rev: 5.7.0
31+
- id: blacken-docs
32+
additional_dependencies: [ black==21.12b0 ]
33+
- repo: https://github.com/pre-commit/pygrep-hooks
34+
rev: v1.9.0
2435
hooks:
25-
- id: isort
26-
- repo: https://github.com/PyCQA/flake8
27-
rev: 3.8.4
36+
- id: rst-backticks
37+
- repo: https://github.com/tox-dev/tox-ini-fmt
38+
rev: "0.5.1"
2839
hooks:
29-
- id: flake8
30-
additional_dependencies:
31-
- 'flake8-bugbear == 20.11.1'
32-
- 'flake8-unused-arguments == 0.0.6'
33-
- 'flake8-comprehensions == 3.3.1'
40+
- id: tox-ini-fmt
41+
args: [ "-p", "fix" ]
3442
- repo: https://github.com/asottile/setup-cfg-fmt
35-
rev: v1.16.0
43+
rev: v1.20.0
3644
hooks:
3745
- id: setup-cfg-fmt
38-
- repo: https://github.com/tox-dev/tox-ini-fmt
39-
rev: '0.5.0'
46+
args: [ --min-py3-version, "3.6", "--max-py-version", "3.10" ]
47+
- repo: https://github.com/PyCQA/flake8
48+
rev: 4.0.1
4049
hooks:
41-
- id: tox-ini-fmt
42-
args: ['-p', 'fix_lint']
43-
- repo: https://github.com/pre-commit/mirrors-eslint
44-
rev: 'v7.29.0'
45-
hooks:
46-
- id: eslint
47-
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
48-
types: [file]
49-
args: ['--fix']
50+
- id: flake8
5051
additional_dependencies:
51-
52-
- [email protected] # prettier used with eslint directly
53-
54-
55-
56-
- '@typescript-eslint/eslint-plugin'
57-
- '@typescript-eslint/parser'
52+
- flake8-bugbear==21.11.29
53+
- flake8-comprehensions==3.7
54+
- flake8-pytest-style==1.6
55+
- flake8-unused-arguments==0.0.9
56+
- flake8-noqa==1.2.1
57+
- pep8-naming==0.12.1

ipydatagrid/__init__.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Copyright (c) Bloomberg.
22
# Distributed under the terms of the Modified BSD License.
33

4-
from ._version import __version__ # noqa
5-
from .cellrenderer import ( # noqa
4+
from ._version import __version__
5+
from .cellrenderer import (
66
BarRenderer,
77
CellRenderer,
88
Expr,
99
HyperlinkRenderer,
1010
TextRenderer,
1111
VegaExpr,
1212
)
13-
from .datagrid import DataGrid, SelectionHelper # noqa
13+
from .datagrid import DataGrid, SelectionHelper
1414

1515

1616
def _jupyter_nbextension_paths():
@@ -26,3 +26,16 @@ def _jupyter_nbextension_paths():
2626

2727
def _jupyter_labextension_paths():
2828
return [{"src": "labextension", "dest": "ipydatagrid"}]
29+
30+
31+
__all__ = [
32+
"__version__",
33+
"BarRenderer",
34+
"CellRenderer",
35+
"Expr",
36+
"HyperlinkRenderer",
37+
"TextRenderer",
38+
"VegaExpr",
39+
"DataGrid",
40+
"SelectionHelper",
41+
]

setup.cfg

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers =
2020
Programming Language :: Python :: 3.7
2121
Programming Language :: Python :: 3.8
2222
Programming Language :: Python :: 3.9
23+
Programming Language :: Python :: 3.10
2324
description_file = README.md
2425
keywords = Jupyter, Widgets, IPython
2526

@@ -35,18 +36,7 @@ include_package_data = True
3536
zip_safe = False
3637

3738
[options.extras_require]
38-
dev =
39-
pre-commit
40-
docs =
41-
jupyter_sphinx
42-
nbsphinx>=0.2.13,<0.4.0
43-
nbsphinx-link
44-
pypandoc
45-
pytest_check_links
46-
recommonmark
47-
sphinx>=1.5
48-
sphinx_rtd_theme
4939
test =
50-
nbval
51-
pytest>=3.6
52-
pytest-cov
40+
nbval>=0.9
41+
pytest>=6
42+
pytest-cov>=3

tests/test_datagrid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
from ipydatagrid import DataGrid
55

66

7-
@pytest.fixture
7+
@pytest.fixture()
88
def dataframe() -> None:
99
return pd.DataFrame(
1010
data={"A": [1, 2, 3], "B": [4, 5, 6]}, index=["One", "Two", "Three"]
1111
)
1212

1313

14-
@pytest.fixture
14+
@pytest.fixture()
1515
def datagrid(dataframe) -> None:
1616
return DataGrid(dataframe)
1717

1818

19-
@pytest.fixture
19+
@pytest.fixture()
2020
def data_object(dataframe) -> None:
2121
return DataGrid.generate_data_object(dataframe, "ipydguuid", "key")
2222

tox.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[tox]
22
envlist =
3-
fix_lint
3+
fix
4+
py310
45
py39
56
py38
67
py37
78
py36
89
pypy3
10+
docs
911
pkg_desc
1012
isolated_build = true
1113
skip_missing_interpreters = true
@@ -15,12 +17,12 @@ minversion = 3.7
1517
extras =
1618
test
1719
commands =
18-
pytest tests
20+
pytest {tty:--color=yes} tests
1921
pytest --nbval examples
2022
package = wheel
2123
wheel_build_env = .pkg
2224

23-
[testenv:fix_lint]
25+
[testenv:fix]
2426
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
2527
passenv =
2628
PROGRAMDATA
@@ -29,15 +31,13 @@ deps =
2931
pre-commit>=2
3032
commands =
3133
pre-commit run --all-files --show-diff-on-failure
32-
python -c 'import pathlib; print("hint: run \{\} install to add checks as pre-commit hook".format(pathlib.Path(r"{envdir}") / "bin" / "pre-commit"))'
3334

3435
[testenv:pkg_desc]
3536
description = check that the long description is valid
3637
skip_install = true
3738
deps =
38-
build>=0.2
39-
readme-renderer[md]>=24
40-
twine>=3
39+
build[virtualenv]>=0.7
40+
twine>=3.7
4141
commands =
4242
python -m build --sdist --wheel . -o {envtmpdir}
4343
twine check {envtmpdir}/*
@@ -47,7 +47,6 @@ description = dev environment with all deps at {envdir}
4747
usedevelop = true
4848
extras =
4949
dev
50-
docs
5150
test
5251
commands =
5352
python -m pip list --format=columns
@@ -57,6 +56,7 @@ commands =
5756
max-complexity = 22
5857
max-line-length = 80
5958
extend-ignore = E203, W503
59+
noqa-require-code = true
6060

6161
[pep8]
6262
max-line-length = 80

0 commit comments

Comments
 (0)