Skip to content
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

Merged
merged 8 commits into from
Feb 18, 2021

Conversation

chrisantonellis
Copy link
Contributor

@chrisantonellis chrisantonellis commented Feb 18, 2021

  • 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

@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #21 (664829c) into main (5731590) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #21   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          189       199   +10     
  Branches        16        19    +3     
=========================================
+ Hits           189       199   +10     
Impacted Files Coverage Δ
little_cheesemonger/_constants.py 100.00% <ø> (ø)
little_cheesemonger/_run.py 100.00% <100.00%> (ø)
little_cheesemonger/_types.py 100.00% <100.00%> (ø)

@@ -16,9 +16,13 @@ class Platform(str, Enum):
platform = PLATFORM
Copy link
Contributor Author

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"
Copy link
Contributor Author

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

@fhightower fhightower self-requested a review February 18, 2021 14:03
Copy link
Collaborator

@fhightower fhightower left a 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 👍 !

little_cheesemonger/_run.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@plannigan plannigan left a 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.

if python_versions is None:
binaries_paths = list(get_python_binaries().values())
else:
version_keys = [PythonVersion[version] for version in python_versions]
Copy link
Collaborator

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.

Copy link
Contributor Author

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 👍

"""Install Python dependencies."""

for binaries in get_python_binaries().values():
if python_versions is None:
binaries_paths = list(get_python_binaries().values())
Copy link
Collaborator

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i left a comment 👍

Copy link
Collaborator

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.

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]
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chrisantonellis chrisantonellis merged commit 3e5c1e4 into main Feb 18, 2021
@chrisantonellis chrisantonellis deleted the cantonellis_implement_python_version branch February 18, 2021 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants