Skip to content

Introduce ruff formatter#601

Merged
s-heppner merged 17 commits into
eclipse-basyx:developfrom
rwth-iat:improve/introduce-ruff-formatter
Jul 23, 2026
Merged

Introduce ruff formatter#601
s-heppner merged 17 commits into
eclipse-basyx:developfrom
rwth-iat:improve/introduce-ruff-formatter

Conversation

@JAB1305

@JAB1305 JAB1305 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

TODO:

  • Update CONTRIBUTING.md to feature new ruff steps
  • Manually introduce (I) - isort
  • Manually introduce (F4) - imports / future
  • Manually introduce (F8) - undefined / unused names
  • Manually introduce (PIE) - small readability improvements
  • Defer remaining checks that we want to issues
  • Manually introduce (PYI) - typing best practices

@JAB1305
JAB1305 force-pushed the improve/introduce-ruff-formatter branch from 90c4473 to bea02d4 Compare July 17, 2026 13:46
@JAB1305
JAB1305 force-pushed the improve/introduce-ruff-formatter branch from d753f24 to 371469d Compare July 19, 2026 18:30
@JAB1305
JAB1305 marked this pull request as ready for review July 20, 2026 12:51
Comment thread sdk/basyx/aas/examples/data/example_aas_missing_attributes.py Outdated
Comment on lines +34 to +46

__all__ = [
"AASFromJsonDecoder",
"StrictAASFromJsonDecoder",
"StrictStrippedAASFromJsonDecoder",
"StrippedAASFromJsonDecoder",
"read_aas_json_file",
"read_aas_json_file_into",
"AASToJsonEncoder",
"StrippedAASToJsonEncoder",
"object_store_to_json",
"write_aas_json_file",
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we sure this "all" really is all? The reason I ask is that we might not use everything from the star import. but if this is not everything public from this module, then we might break other people's code that relies on import adapter.json.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +30 to +43
__all__ = [
"AASFromXmlDecoder",
"StrictAASFromXmlDecoder",
"StrictStrippedAASFromXmlDecoder",
"StrippedAASFromXmlDecoder",
"XMLConstructables",
"read_aas_xml_element",
"read_aas_xml_file",
"read_aas_xml_file_into",
"object_store_to_xml_element",
"object_to_xml_element",
"write_aas_xml_element",
"write_aas_xml_file",
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above, qre we sure this "all" really is all? The reason I ask is that we might not use everything from the star import. but if this is not everything public from this module, then we might break other people's code that relies on import adapter.xml.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So I checked again and your suspicion was correct. With the current __all__ we would lose some functionality / side effect:
E.g.:

from basyx.aas.adapter.xml import *

xml_deserialization.SomeThing # will break, worked before

Previous implementation worked because the imports added the namespaces as a side effect. Now only the actually listed namespaces are exposed.

Although it differs, the current implementation exposes all of the intended public API I think. It would only break in cases where other people's code tries to use the namespaces xml_deserializationand xml_serialization after the star import. It is still possible to use from basyx.aas.adapter.xml import xml_deserialization and go from there.

So I dont think this is really breaking, maybe actually cleaner? What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I absolutely think that this is cleaner. Maybe we can do this and add a small note to the release notes.

Comment thread sdk/test/examples/test_tutorials.py
@s-heppner
s-heppner merged commit 112290a into eclipse-basyx:develop Jul 23, 2026
15 checks passed
@s-heppner
s-heppner deleted the improve/introduce-ruff-formatter branch July 23, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants