-
Notifications
You must be signed in to change notification settings - Fork 910
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
Added __version__ to Flower #952
Conversation
Added __version__ using importlib.metadata to retrieve installed package information
@sisco0 Many thanks for your contributions. I can recommend to run the |
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.
@sisco0 just did some digging and a good solution seems to be: python-poetry/poetry#2366 (comment) as importlib.metadata
is only available after Python 3.8. We still support Python 3.7 though so we would need a solution which can handle it too. Would you like to adjust your approach?
I would do it without inconvenience by today by using setup tools instead of importlib. |
Help is needed as I could accomplish this task locally by using 3.7.9 but for some reason, the same result is not obtained when using the Github Actions test, we are going to the incorrect branch of the comparison. Edit |
@sisco0 I took the liberty to update the PR with the latest changes from
|
We are not using an env in the Github Actions environment, I am trying configurations locally with Edit: As the error seems to come from PyLint we must look into that, this must be the key. Trying to go on with |
The good news is that the tests seem to pass now by the |
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.
@sisco0 Amazing! Thank you a lot for this! We can merge it as is but one more improvement I would suggest would be to add a test for this.
My suggestions would be to have a __init___test.py
with e.g. this test:
def test_version() -> None:
"""Tests if version is correctly imported."""
# Execute
from flwr import __version__ # pylint: disable=import-outside-toplevel
# Assert
assert isinstance(__version__, str)
wdyt?
@sisco0 Merged! Thank you! |
Adding the test would be a good point for sure. I would try this during tomorrow but if someone wants to continue on this before me I would create an issue. |
Added
__version__
usingimportlib.metadata
to retrieve installed package information. This pull request accomplishes #883 duty.A screenshot of the testing process is attached below.