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

[ImportError] Circular dependencies in __init__ EReference eType initialization #2

Open
cgava opened this issue Mar 11, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@cgava
Copy link
Owner

cgava commented Mar 11, 2021

pyecoregen generates initializations of EReference.eType and EReference.eOpposite inside the init.py of each subpackage, which requires a lot of import from other packages, and increase the amount of circular dependencies.

Solution proposed : do those initializations only in the top pyEcoreCapella.init.py module

Implementation:

  • generate all those initializations in an intermediate file (called cross_init.inc) in each package submodule
  • at top level, create a init.inc with the import statements for each packages
  • at top level, create init.py by concatenation of top init.inc and the cross_init.inc of all the packages

attached is the templates (rename txt to tpl in pyecoregen) and the patch for ecore.py

cross_init.inc.tpl
package.py.tpl
ecore.py.patch

@cgava cgava added the enhancement New feature or request label Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant