-
Notifications
You must be signed in to change notification settings - Fork 6
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
implemented ability to select python version #21
Conversation
chrisantonellis
commented
Feb 18, 2021
•
edited
Loading
edited
- implemented ability to select python version via configuration, to determine which python version dependencies are installed for. previously system dependencies were installed for all available versions of python, but this resulted in error when testing with wheelhaus service.
- updated assoicated tests
…or via configuration
Codecov Report
@@ Coverage Diff @@
## main #21 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 189 199 +10
Branches 16 19 +3
=========================================
+ Hits 189 199 +10
|
@@ -16,9 +16,13 @@ class Platform(str, Enum): | |||
platform = PLATFORM |
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.
the tests were not accurately emulating the real constants, had to update the shape here
|
||
__version__ = "0.1.0rc1" | ||
__version__ = "0.1.0rc2" |
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.
prep for the immediate next RC release to test with wheelhaus service
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.
Made one suggestion. Other than the CI failures, looks great 👍 !
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.
The CI pipeline is also failing.
little_cheesemonger/_run.py
Outdated
if python_versions is None: | ||
binaries_paths = list(get_python_binaries().values()) | ||
else: | ||
version_keys = [PythonVersion[version] for version in python_versions] |
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.
Since each version
value is an external input, it might not be a valid key. The code should should validate the input or handle the exception.
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'll add exception handling for now but ultimately i want to compare the configuration to a valid json schema or something that knows all the valid values for the platform 👍
little_cheesemonger/_run.py
Outdated
"""Install Python dependencies.""" | ||
|
||
for binaries in get_python_binaries().values(): | ||
if python_versions is None: | ||
binaries_paths = list(get_python_binaries().values()) |
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.
It is not clear to me why values is being converted to a list since it is iterable.
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.
mypy was crying that the assignment was not compatible, List[ ] and ValuesIterable
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 left a comment 👍
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 think a different solution would have been to annotate the variable as Iterable[]
to indicated that is the only interface you intend to use.
little_cheesemonger/_run.py
Outdated
binaries_paths = list(get_python_binaries().values()) | ||
else: | ||
version_keys = [PythonVersion[version] for version in python_versions] | ||
binaries_paths = [get_python_binaries()[version] for version in version_keys] |
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.
This will call get_python_binaries()
N times. Instead, it could be called once before the if since the value is used in both blocks.
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.
👍
Co-authored-by: Floyd Hightower <[email protected]>
…fair-incubator/little-cheesemonger into cantonellis_implement_python_version