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

Fix component placement bug #17

Merged
merged 4 commits into from
Nov 21, 2023
Merged

Fix component placement bug #17

merged 4 commits into from
Nov 21, 2023

Commits on Nov 21, 2023

  1. [Refactor] version and registry file for editable instal

    Importing `__version__` from `mccode_antlr` only works if it is
    installed, otherwise the `__init__` file is not evaluated(?) when
    importing the module.
    It is also not possible to use the importlib.resources files method to
    find the registry files from an editable-installed module.
    
    In an attempt to support ediable installs, for easier debugging of
    dependent modules, the version method is defined in a new
    file, version.py, which is imported and used to populate the module
    __version__ property. This method is then used in place of the dunder
    version throughout mccode_antlr.
    The importlib.metadata module has a distribution method which can be
    used to identify editable installs of modules. This is used in a bit of
    a hack to locate registry files in case the importlib.resources method
    fails.
    
    Unfortunatley, the auto-generation of the grammar files does not work
    for editable installs; so the whole machinery still fails.
    These files *should* be static in the distributed module -- so that the
    dependency on antlr can be reduced to just the runtime. But since this
    is not entirely trivial to change, editable installations will continue
    to not work properly.
    g5t committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    934794e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    84e874d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    61b3831 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f6e6686 View commit details
    Browse the repository at this point in the history