-
Notifications
You must be signed in to change notification settings - Fork 12
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
Maintenance/drop include #87
Conversation
CI is failing due to outdated formatting. This is fixed in #86. |
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 a lot for taking care and replacing an outdated third party package with stdlib means.
I have only one comment, although as stated I am not sure whether this is feasible and reasonable to include.
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 a lot, looks good to go to me 👍
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.
Awesome you recognised that the used library so far is deprecated and that now you only rely on standards.
I never worked with those yet and also did not check the implementations. So please have a look on my comments before merging.
src/cobald/daemon/config/python.py
Outdated
such as ``.py`` or ``.pyc`` for a plaintext or bytecode python module. | ||
""" | ||
global _loaded | ||
current_index = _loaded = _loaded + 1 |
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.
What is the actual purpose of _loaded
? Is it to create unique module_name
s or do you also want to have a kind of counter on how many configurations have been loaded? I am just curious as in case of an error the counter is not being decremented.
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.
Yes, it's just to have a unique number. You are right that this isn't obvious, I'll think of another 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.
Changed the naming to indicate this is for identifying modules. Also using an itertools.count
to get rid of the global
(and possible race condition).
Changed/commented the code to make it a tad more maintainable, and added a test for what I assume are expected usage errors. |
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.
Nice extension to the already great contribution. Go for it 👍
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.
Nothing to add. Looks good.
This PR replaces the outdated
include
package with the stdlibimportlib
.Closes #82.
See also #85 since this is a candidate for deprecation in the long run.