Upgrade dev dependencies;
upgrade to newer reusable Github workflow; rename requirements files; add `ruff` linting rules; add `black` config for line length 80
This commit is contained in:
parent
acf4c06404
commit
1a293563d1
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@ -8,9 +8,9 @@ on:
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
uses: daniil-berg/reusable-workflows/.github/workflows/python-test.yaml@v0.2.1
|
||||
uses: daniil-berg/reusable-workflows/.github/workflows/python-test.yaml@v0.2.2
|
||||
with:
|
||||
versions: '["3.9", "3.10", "3.11"]'
|
||||
versions: '["3.9", "3.10", "3.11", "3.12"]'
|
||||
unittest-command: 'scripts/test.sh'
|
||||
coverage-command: 'scripts/cov.sh'
|
||||
unittest-requirements: "-e '.[dev]'"
|
||||
@ -24,7 +24,7 @@ jobs:
|
||||
name: Release
|
||||
if: ${{ github.ref_type == 'tag' }}
|
||||
needs: test
|
||||
uses: daniil-berg/reusable-workflows/.github/workflows/python-release.yaml@v0.2.1
|
||||
uses: daniil-berg/reusable-workflows/.github/workflows/python-release.yaml@v0.2.2
|
||||
with:
|
||||
git-ref: ${{ github.ref_name }}
|
||||
secrets:
|
||||
|
@ -39,18 +39,16 @@ dynamic = [
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
full = [
|
||||
...
|
||||
]
|
||||
full = []
|
||||
dev = [
|
||||
"black==23.7.0",
|
||||
"build==0.10.0",
|
||||
"coverage[toml]==7.2.7",
|
||||
"black==23.9.1",
|
||||
"build==1.0.3",
|
||||
"coverage[toml]==7.3.2",
|
||||
"isort==5.12.0",
|
||||
"mkdocs-material==9.1.18",
|
||||
"mkdocstrings[python]==0.22.0",
|
||||
"mypy==1.4.1",
|
||||
"ruff==0.0.278",
|
||||
"mkdocs-material==9.4.6",
|
||||
"mkdocstrings[python]==0.23.0",
|
||||
"mypy==1.5.1",
|
||||
"ruff==0.0.292",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
@ -109,25 +107,44 @@ omit = [
|
||||
[tool.ruff]
|
||||
cache-dir = ".cache/ruff"
|
||||
select = [
|
||||
"F", # pyflakes
|
||||
"E", # pycodestyle errors
|
||||
"W", # pycodestyle warnings
|
||||
"F", # pyflakes
|
||||
"N", # pep8-naming
|
||||
"D", # pydocstyle
|
||||
"C", # flake8-comprehensions
|
||||
"ANN", # flake8-annotations
|
||||
"S", # flake8-bandit
|
||||
"FBT", # flake8-boolean-trap
|
||||
"B", # flake8-bugbear
|
||||
"A", # flake8-builtins
|
||||
"C", # flake8-comprehensions
|
||||
"PIE", # flake8-pie
|
||||
"T20", # flake8-print
|
||||
"RET", # flake8-return
|
||||
"SIM", # flake8-simplify
|
||||
"TD", # flake8-todos
|
||||
"TCH", # flake8-type-checking
|
||||
"ARG", # flake8-unused-arguments
|
||||
"PTH", # flake8-use-pathlib
|
||||
"ERA", # eradicate
|
||||
"PL", # pylint
|
||||
"TRY", # tryceratops
|
||||
"RUF", # ruff-specific
|
||||
]
|
||||
ignore = [
|
||||
"E501", # Line too long -> handled by black
|
||||
"D203", # 1 blank line required before class docstring -> D211 is better
|
||||
"D212", # Multi-line docstring summary should start at the first line -> ugly, D212 is better
|
||||
"D212", # Multi-line docstring summary should start at the first line -> ugly, D213 is better
|
||||
"D401", # First line of docstring should be in imperative mood -> no, it shouldn't
|
||||
"D407", # Missing dashed underline after section -> different docstring style
|
||||
"ANN101", # Missing type annotation for self in method -> unnecessary
|
||||
"ANN102", # Missing type annotation for cls in classmethod -> unnecessary
|
||||
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed -> we'll use it sparingly
|
||||
]
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
"src/**/__init__.py" = [
|
||||
"A001", # Variable {name} is shadowing a Python builtin
|
||||
"D104", # Missing docstring in public package
|
||||
"F401", # {...} imported but unused
|
||||
]
|
||||
@ -138,9 +155,16 @@ ignore = [
|
||||
"D104", # Missing docstring in public package
|
||||
]
|
||||
|
||||
####################
|
||||
# Code formatting: #
|
||||
|
||||
[tool.black]
|
||||
line_length = 80
|
||||
|
||||
###################
|
||||
# Import sorting: #
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
extra_standard_library = ["typing_extensions"]
|
||||
line_length = 80
|
||||
|
@ -1,9 +1,9 @@
|
||||
-r common.txt
|
||||
black==23.7.0
|
||||
build==0.10.0
|
||||
coverage[toml]==7.2.7
|
||||
-r full.txt
|
||||
black==23.9.1
|
||||
build==1.0.3
|
||||
coverage[toml]==7.3.2
|
||||
isort==5.12.0
|
||||
mkdocs-material==9.1.18
|
||||
mkdocstrings[python]==0.22.0
|
||||
mypy==1.4.1
|
||||
ruff==0.0.278
|
||||
mkdocs-material==9.4.6
|
||||
mkdocstrings[python]==0.23.0
|
||||
mypy==1.5.1
|
||||
ruff==0.0.292
|
||||
|
1
requirements/full.txt
Normal file
1
requirements/full.txt
Normal file
@ -0,0 +1 @@
|
||||
-r base.txt
|
Loading…
Reference in New Issue
Block a user