Skip to content
New issue

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

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

Already on GitHub? # to your account

Propagate import dependencies to components #2009

Closed
oxisto opened this issue Jan 30, 2025 · 0 comments · Fixed by #2010
Closed

Propagate import dependencies to components #2009

oxisto opened this issue Jan 30, 2025 · 0 comments · Fixed by #2010

Comments

@oxisto
Copy link
Member

oxisto commented Jan 30, 2025

After finally extensively using the components system, I noticed that while we create import dependencies of translation units and packages across different components (e.g., file a.py in application uses the package os in stdlib component), we store only this information in the individual components. The list is a sorted list of translation units (for example for the symbol resolver) in ascending order of least-dependencies. While this is useful inside a component to resolve them in the correct order, this does not help us when resolving across components.

For example, if we have the following structure (from above):

  • application component
    • a.py imports os (which can be found in stdlib)
    • b.py imports a (of application)
    • c.py imports nothing
  • stdlib component
    • os.py imports nothing

We would then have a sorted list of units ["c.py", "a.py", "b.py"] for application and ["os.py"] for stdlib. But the order of components is currently not influenced by the information. We can be lucky that we parse stdlib before the application (or not).

Instead, if we would consolidate this information across all components, we would end up with ["os.py", "c.py", "a.py", "b.py"] or ["c.py", "os.py", "a.py", "b.py"] which would provide a better picture.

An even better approach is that, we would need just the information that stdlib needs to be parsed before application. This would allows us to keep the processing of components still separate but do it in the correct order.

@oxisto oxisto changed the title Consolidate dependencies of namespaces across components Propagate dependencies of namespaces to components Jan 30, 2025
@oxisto oxisto changed the title Propagate dependencies of namespaces to components Propagate import dependencies to components Jan 30, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant