Skip to content

Commit a219da5

Browse files
committed
Add project.requires-python instead of target-version
1 parent ac8f793 commit a219da5

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

pyproject.toml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1+
[project]
2+
name = "python-tutorial"
3+
requires-python = ">=3.10"
4+
5+
# pytest
6+
[tool.pytest.ini_options]
7+
addopts = "-v --tb=short"
8+
19
[tool.ruff]
210
# Line length (Black default)
311
line-length = 88
412

5-
# Python target version
6-
target-version = "py38"
7-
813
# Ignored rules for the entire project
914
[tool.ruff.lint]
1015
ignore = [
11-
"E501", # Line too long
12-
"E203", # Whitespace before ':'
13-
# "TRY301", # Raise within try block (this is actually a good practice)
14-
# "W503" # Line break before binary operator (not PEP8 enforced, so not implemented in Ruff)
16+
"E501", # Line too long
17+
"E203", # Whitespace before ':'
18+
# "TRY301", # Raise within try block (this is actually a good practice)
19+
# "W503" # Line break before binary operator (not PEP8 enforced, so not implemented in Ruff)
1520
]
16-
1721
# flake8 plugins to enable:
1822
# - flake8-bugbear B
1923
# - flake8-builtins A
@@ -24,39 +28,33 @@ ignore = [
2428
# - pyflakes F
2529
# - tryceratops TRY
2630
select = [
27-
"A", # flake8-builtins
28-
"B", # flake8-bugbear
29-
"C4", # flake8-comprehensions
30-
"T10", # flake8-debugger
31-
"G", # flake8-logging-format
32-
"N", # pep8-naming
33-
"F", # pyflakes
34-
"TRY", # tryceratops
35-
"I", # isort
36-
"E", # pycodestyle errors
37-
"UP", # pyupgrade
31+
"A", # flake8-builtins
32+
"B", # flake8-bugbear
33+
"C4", # flake8-comprehensions
34+
"T10", # flake8-debugger
35+
"G", # flake8-logging-format
36+
"N", # pep8-naming
37+
"F", # pyflakes
38+
"TRY", # tryceratops
39+
"I", # isort
40+
"E", # pycodestyle errors
41+
"UP", # pyupgrade
3842
]
3943

4044
# Per-file rule ignores
4145
[tool.ruff.lint.per-file-ignores]
4246
# Trailing whitespace in comment
4347
"binder/ipython_config.py" = ["E266"]
44-
4548
# suppress `raise ... from err`
4649
# Why we ignore B904 from the object-oriented tests?
4750
# We do want to raise an assertion error if the check on the solution function attributes fails,
4851
# but Python by default will raise a TypeError via vars(solution_result)
4952
# if the result is not a class and therefore doesn't have a __dict__ attribute.
5053
"tutorial/tests/test_object_oriented_programming.py" = ["B904"]
51-
5254
# Ignore invalid names like `import torch.nn.functional as F`
5355
"25_library_pytorch_language_modeling.ipynb" = ["N812"]
5456

5557
# Ruff formatting
5658
[tool.ruff.format]
5759
quote-style = "double"
5860
indent-style = "space"
59-
60-
# pytest
61-
[tool.pytest.ini_options]
62-
addopts = "-v --tb=short"

0 commit comments

Comments
 (0)