OpenCyphal / pydsdl

Cyphal DSDL processing front end implemented in Python
https://opencyphal.org
MIT License
11 stars 9 forks source link

Adding support for file-based reads and externalized type dependencies #103

Closed thirtytwobits closed 4 months ago

thirtytwobits commented 5 months ago

This is non-breaking change that adds a new public method:

read_files - a file-oriented entry point to the front end. This takes a list of target DSDL files allowing the user to maintain an explicit list instead of depending on globular filesystem discovery. Furthermore this method returns a set which is the transitive closure of types depended on by the target list of types. This allows consumers to track dependencies and compiler back ends to generate .d files and otherwise support incremental builds.

The new method may increase performance for systems with large pools of messages when generating code for a small sub-set as it only considers the target and dependencies of the target when parsing dsdl files.

thirtytwobits commented 5 months ago

ping? Any chance I can get a review on this?

pavel-kirienko commented 5 months ago

@thirtytwobits Sorry, I will do it today/tomorrow

pavel-kirienko commented 4 months ago

But there's a future import for that

On Thu, Jun 20, 2024, 01:14 Scott Dixon @.***> wrote:

@.**** commented on this pull request.

In noxfile.py https://github.com/OpenCyphal/pydsdl/pull/103#discussion_r1646722260:

  • "--strict",
  • f"--config-file={ROOT_DIR / 'setup.cfg'}",
  • "pydsdl",
  • env={
  • "MYPYPATH": str(THIRD_PARTY_DIR),
  • },
  • )
  • session.run(
  • "pylint",
  • str(ROOT_DIR / "pydsdl"),
  • env={
  • "PYTHONPATH": str(THIRD_PARTY_DIR),
  • },
  • )
  • if is_oldest_python(session):
  • we run mypy and pylint only on the oldest Python version to ensure maximum compatibility

But then it won't be compatible with 3.8.

— Reply to this email directly, view it on GitHub https://github.com/OpenCyphal/pydsdl/pull/103#discussion_r1646722260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZFIZAWRDF3TUYINF7ZS53ZIH7GDAVCNFSM6AAAAABILVRJOSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMRZGA4TCNZTGY . You are receiving this because your review was requested.Message ID: @.***>

thirtytwobits commented 4 months ago

Okay. Just the DsdlPathInferenceError comment is left.

pavel-kirienko commented 4 months ago

I tried pushing this but it says your main is protected; can you please either apply it or remove the main branch protection in your fork?

diff --git a/noxfile.py b/noxfile.py
index f9e73d2..61a409b 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -122,6 +122,3 @@ def docs(session):

 def is_latest_python(session) -> bool:
     return PYTHONS[-1] in session.run("python", "-V", silent=True)
-
-def is_oldest_python(session) -> bool:
-    return PYTHONS[0] in session.run("python", "-V", silent=True)
thirtytwobits commented 4 months ago

I tried pushing this but it says your main is protected; can you please either apply it or remove the main branch protection in your fork?

This change is already in my PR.

thirtytwobits commented 4 months ago

I believe all issues are addressed now?

thirtytwobits commented 4 months ago

I fixed the CI build errors on my end. Everything is ready to go.