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

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

Merged
merged 17 commits into from
Jun 28, 2024

Conversation

thirtytwobits
Copy link
Member

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.

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
Copy link
Member Author

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

@pavel-kirienko
Copy link
Member

pavel-kirienko commented Jun 6, 2024

@thirtytwobits Sorry, I will do it today/tomorrow

Copy link
Member

@pavel-kirienko pavel-kirienko left a comment

Choose a reason for hiding this comment

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

to be continued

docs/requirements.txt Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
pydsdl/_data_type_builder.py Outdated Show resolved Hide resolved
pydsdl/_dsdl_definition.py Outdated Show resolved Hide resolved
Copy link
Member

@pavel-kirienko pavel-kirienko left a comment

Choose a reason for hiding this comment

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

Please see the comments to #101.

Suppose I invoke read_files with a root namespace foo and a DSDL definition named foo.foo.Bar.1.0; is this going to work? What about foo.baz.foo.Bar.1.0?

pydsdl/_namespace.py Outdated Show resolved Hide resolved
pydsdl/_namespace.py Outdated Show resolved Hide resolved
test/test_public_types.py Outdated Show resolved Hide resolved
pydsdl/_dsdl.py Outdated Show resolved Hide resolved
pydsdl/_dsdl.py Outdated Show resolved Hide resolved
pydsdl/_dsdl.py Outdated Show resolved Hide resolved
thirtytwobits and others added 2 commits June 19, 2024 10:34
@pavel-kirienko
Copy link
Member

pavel-kirienko commented Jun 19, 2024 via email

@thirtytwobits
Copy link
Member Author

Okay. Just the DsdlPathInferenceError comment is left.

@pavel-kirienko
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

I believe all issues are addressed now?

@thirtytwobits
Copy link
Member Author

thirtytwobits commented Jun 25, 2024

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

@pavel-kirienko pavel-kirienko enabled auto-merge (squash) June 28, 2024 21:17
@pavel-kirienko pavel-kirienko merged commit c7d8ef9 into OpenCyphal:master Jun 28, 2024
12 checks passed
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