-
Notifications
You must be signed in to change notification settings - Fork 51
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
push solution to 664 #672
base: master
Are you sure you want to change the base?
push solution to 664 #672
Conversation
are you sure the PR is based on the current master ? The lines |
opengate/utility.py
Outdated
@@ -379,17 +379,16 @@ def read_mac_file_to_commands(filename): | |||
# read a file located into the 'mac' folder of the source code | |||
# return a list of commands | |||
resource_package = __name__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at why CI fails and I think that resource_package = __name__
should become resource_package = __package__
. After I tried that, I got another error though:
File "/home/gate/dev/.venv/lib/python3.12/site-packages/gatetools/gate_helpers.py", line 11, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
It is not really clear for me where this gate_helpers.py is coming from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is very useful. I'll make the change tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gate_helpers came from https://github.com/OpenGATE/GateTools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In gatetools/gate_helpers.py
, the following
import pkg_resources
gtv = pkg_resources.get_distribution("gatetools").version
could be replaced by
import importlib.metadata
gtv = importlib.metadata.version("gatetools")
Thank you, ChatGPT :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dsarrut I have pushed both changes
solving OpenGATE/opengate#664 from discussion in OpenGATE/opengate#672
Possible solution to #664