Skip to content

Commit b40955c

Browse files
dependabot[bot]noyainrain
authored andcommitted
Update pylint requirement from ~=2.17 to ~=3.3
Updates the requirements on [pylint](https://github.com/pylint-dev/pylint) to permit the latest version. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](pylint-dev/pylint@v2.17.0...v3.3.7) Also specify py-version, add PYLINTFLAGS to Makefile, use the GitHub workflow format for Pylint, enable Python 3.12 and 3.13 for CI, spell out make dependencies and dependencies-dev, treat warnings as errors for unit tests, fix make clean POSIX incompatibility, vendor fonts with package.json, migrate .mypy.ini and .pylintrc to pyproject.toml and specify files in the mypy configuration. Close #25. --- updated-dependencies: - dependency-name: pylint dependency-version: 3.3.7 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
1 parent 46b07d5 commit b40955c

8 files changed

Lines changed: 52 additions & 46 deletions

File tree

.github/workflows/check.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check code
1+
name: Check Code
22
on:
33
- push
44
- pull_request
@@ -10,14 +10,16 @@ jobs:
1010
- "3.9"
1111
- "3.10"
1212
- "3.11"
13+
- "3.12"
14+
- "3.13"
1315
runs-on: ubuntu-latest
1416
steps:
1517
- uses: actions/checkout@v3
1618
- uses: actions/setup-python@v4
1719
with:
1820
python-version: ${{ matrix.python }}
19-
- run: make deps deps-dev
21+
- run: make dependencies dependencies-dev
2022
- run: make type
2123
- run: make test
22-
- run: make lint
24+
- run: make lint PYLINTFLAGS=--output-format=github
2325
continue-on-error: ${{ contains(github.event.head_commit.message, 'WIP') }}

.mypy.ini

Lines changed: 0 additions & 5 deletions
This file was deleted.

.pylintrc

Lines changed: 0 additions & 18 deletions
This file was deleted.

Makefile

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,39 @@
11
PYTHON=python3
2+
PYTHONFLAGS=-W error
23
PIP=pip3
34
PIPFLAGS=--upgrade
5+
PYLINTFLAGS=
46
NPM=npm
57
NPMFLAGS=--no-save
68

79
.PHONY: test
810
test:
9-
$(PYTHON) -m unittest
11+
$(PYTHON) $(PYTHONFLAGS) -m unittest
1012

1113
.PHONY: type
1214
type:
13-
mypy flatdir
15+
mypy
1416

1517
.PHONY: lint
1618
lint:
17-
pylint flatdir
19+
pylint $(PYLINTFLAGS) flatdir
1820

1921
.PHONY: check
2022
check: type test lint
2123

22-
.PHONY: deps
23-
deps:
24-
$(PIP) install $(PIPFLAGS) --requirement requirements.txt
24+
.PHONY: dependencies
25+
dependencies:
26+
$(PIP) install $(PIPFLAGS) --requirement=requirements.txt
2527

26-
.PHONY: deps-dev
27-
deps-dev:
28-
$(PIP) install $(PIPFLAGS) --requirement requirements-dev.txt
28+
.PHONY: dependencies-dev
29+
dependencies-dev:
30+
$(PIP) install $(PIPFLAGS) --requirement=requirements-dev.txt
2931

30-
FONTSMODULE=node_modules/@fontsource/noto-sans
31-
FONTSRESOURCE=flatdir/res/fonts
3232
.PHONY: fonts
3333
fonts:
3434
@# Work around npm 7 update modifying package.json (see https://github.com/npm/cli/issues/3044)
3535
$(NPM) install $(NPMFLAGS)
36-
mkdir --parents $(FONTSRESOURCE)/files
37-
cp $(FONTSMODULE)/400.css $(FONTSMODULE)/600.css $(FONTSRESOURCE)/
38-
cp $(FONTSMODULE)/files/noto-sans-*-400-normal.woff2 \
39-
$(FONTSMODULE)/files/noto-sans-all-400-normal.woff \
40-
$(FONTSMODULE)/files/noto-sans-*-600-normal.woff2 \
41-
$(FONTSMODULE)/files/noto-sans-all-600-normal.woff $(FONTSRESOURCE)/files/
4236

4337
.PHONY: clean
4438
clean:
45-
rm --recursive --force $$(find . -name __pycache__) .mypy_cache node_modules
39+
rm -rf $$(find . -name __pycache__) .mypy_cache node_modules

flatdir/util.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from collections.abc import Mapping
1919
from enum import Enum
20-
from importlib.abc import Traversable
2120
from itertools import chain
2221
import logging
2322
from logging import Formatter, LogRecord, StreamHandler
@@ -27,6 +26,14 @@
2726
from typing import Iterable, Literal, TextIO, TypeVar, cast, overload
2827
from xml.etree.ElementTree import Element
2928

29+
if sys.version_info < (3, 11):
30+
# Work around Pylint rejecting deprecated features in compatibility code (see
31+
# https://github.com/pylint-dev/pylint/issues/9533)
32+
# pylint: disable=deprecated-class
33+
from importlib.abc import Traversable
34+
else:
35+
from importlib.resources.abc import Traversable
36+
3037
FormatStyle = Literal['%', '{', '$']
3138

3239
T = TypeVar('T')

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{
2+
"scripts": {
3+
"dependencies": "mkdir -p flatdir/res/fonts/files && cp $npm_package_config_vendored_root flatdir/res/fonts/ && cp $npm_package_config_vendored_files flatdir/res/fonts/files/"
4+
},
5+
"config": {
6+
"vendored": {
7+
"root": "node_modules/@fontsource/noto-sans/400.css node_modules/@fontsource/noto-sans/600.css",
8+
"files": "node_modules/@fontsource/noto-sans/files/noto-sans-*-400-normal.woff2 node_modules/@fontsource/noto-sans/files/noto-sans-all-400-normal.woff node_modules/@fontsource/noto-sans/files/noto-sans-*-600-normal.woff2 node_modules/@fontsource/noto-sans/files/noto-sans-all-600-normal.woff"
9+
}
10+
},
211
"dependencies": {
312
"@fontsource/noto-sans": "^4.5"
413
}

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[tool.mypy]
2+
files = ["flatdir"]
3+
strict = true
4+
disallow_any_expr = true
5+
disallow_any_decorated = true
6+
disallow_any_explicit = true
7+
8+
[tool.pylint.main]
9+
disable = [
10+
# Good design is best figured out by humans yet
11+
"design", "too-many-lines", "too-many-nested-blocks",
12+
# Handled by mypy
13+
"classes", "typecheck"
14+
]
15+
jobs = 0
16+
output-format = "colorized"
17+
py-version = "3.9"

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
mypy ~= 1.2
2-
pylint ~= 2.17
2+
pylint ~= 3.3

0 commit comments

Comments
 (0)