Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ruff.toml, pytest.ini and setup.cfg to pyproject.toml #1734

Merged
merged 3 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,50 @@ Repository = "https://github.com/FreeOpcUa/opcua-asyncio"
[tool.hatch.build.targets.sdist]
include = ["/asyncua"]

[tool.pytest.ini_options]
log_cli = false
log_level = "INFO"
testpaths = ["tests"]
asyncio_mode = "auto"

[tool.ruff]
line-length = 120
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this line was previously ignored since ruff.toml file existed.

If a line length of 120 is set currently (or even 160) there is a bunch of errors. So probably if this is to be fixed, might be easier to start using ruff format...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very strnage I did a reformating of many things in a recent commit.
but ok I can change that later

line-length = 999
extend-exclude = [
"docs",
"nodeset",
"schemas",
"*_auto.py",
"event_objects.py",
"standard_address_space_services.py"
]
target-version = "py37"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 3.9 now, evertyhing else is not supported by Python

[tool.ruff.lint]
select = ["E", "F", "G004", "W", "UP"]
ignore = [
"UP032", # Use f-string instead of `format` call
"UP030", # Use implicit references for positional format fields
"UP027", # Replace unpacked list comprehension with a generator expression
# The following can be removed once the minimum supported Python version is 3.10
# https://github.com/astral-sh/ruff/issues/5035
"UP006", # Use `list` instead of `List` for type annotation
"UP007", # Use `X | Y` for type annotations
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
"examples/*" = ["F841", "E402"]

[tool.mypy]
disable_error_code = ["misc", "arg-type", "assignment", "var-annotated"]
show_error_codes = true
check_untyped_defs = false
mypy_path = "./stubs"
[[tool.mypy.overrides]]
# Autogenerated file
module = "asyncua.ua.uaprotocol_auto.*"
disable_error_code = "literal-required"
[[tool.mypy.overrides]]
module = "asyncua.client.*"
check_untyped_defs = true
[[tool.mypy.overrides]]
module = "asynctest.*"
ignore_missing_imports = true
5 changes: 0 additions & 5 deletions pytest.ini

This file was deleted.

17 changes: 0 additions & 17 deletions ruff.toml

This file was deleted.

21 changes: 0 additions & 21 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
[flake8]
max-line-length = 160
exclude = uaproto*_auto_add.py, *_auto.py, standard_address_space_services.py
ignore = E501, W503, W504
per-file-ignores =
__init__.py: F401, F403
examples/*: F841, E402
[pycodestyle]
max-line-length = 160
Copy link
Contributor Author

@rth rth Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the flake8 and pycodestyle config as it's replaced by ruff check.

[mypy]
disable_error_code = misc, arg-type, assignment, var-annotated
show_error_codes = True
check_untyped_defs = False
mypy_path = ./stubs
[mypy-asyncua.ua.uaprotocol_auto.*]
# Autogenerated file
disable_error_code = literal-required
[mypy-asyncua.client.*]
check_untyped_defs = True
[mypy-asynctest.*]
ignore_missing_imports = True
Loading