-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [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. * [Ref] minor changes in runtime identified while debugging * [Fix] C component positioning bug using rotation angles instead of position vector * [Add] 0D dat file, [Expand] compiled test case
- Loading branch information
Showing
11 changed files
with
145 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
*/*.egg-info/ | ||
.idea/ | ||
*build/ | ||
*.egg-info/ | ||
*.egg-info/ | ||
*.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def version(): | ||
import sys | ||
if sys.version_info[0] == 3 and sys.version_info[1] < 8: | ||
import importlib_metadata | ||
else: | ||
import importlib.metadata as importlib_metadata | ||
try: | ||
return importlib_metadata.version("mccode_antlr") | ||
except importlib_metadata.PackageNotFoundError: | ||
return "dev" | ||
|
Oops, something went wrong.